2017-04-11 21:25:56 -06:00
|
|
|
// Copyright (c) 2017 GitHub, Inc.
|
|
|
|
// Use of this source code is governed by the MIT license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
2021-11-22 00:34:31 -07:00
|
|
|
#ifndef ELECTRON_SHELL_BROWSER_CHILD_WEB_CONTENTS_TRACKER_H_
|
|
|
|
#define ELECTRON_SHELL_BROWSER_CHILD_WEB_CONTENTS_TRACKER_H_
|
2017-04-05 21:15:27 -06:00
|
|
|
|
2018-10-22 12:02:25 -06:00
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include "content/public/browser/web_contents_user_data.h"
|
2017-04-05 21:15:27 -06:00
|
|
|
|
2019-06-19 15:23:04 -06:00
|
|
|
namespace electron {
|
2017-04-05 21:15:27 -06:00
|
|
|
|
2017-04-11 21:20:53 -06:00
|
|
|
// ChildWebContentsTracker tracks child WebContents
|
|
|
|
// created by native `window.open()`
|
2018-10-22 12:02:25 -06:00
|
|
|
struct ChildWebContentsTracker
|
|
|
|
: public content::WebContentsUserData<ChildWebContentsTracker> {
|
2020-03-26 12:05:45 -06:00
|
|
|
~ChildWebContentsTracker() override;
|
|
|
|
|
2021-11-03 05:41:45 -06:00
|
|
|
// disable copy
|
|
|
|
ChildWebContentsTracker(const ChildWebContentsTracker&) = delete;
|
|
|
|
ChildWebContentsTracker& operator=(const ChildWebContentsTracker&) = delete;
|
|
|
|
|
2018-10-22 12:02:25 -06:00
|
|
|
GURL url;
|
|
|
|
std::string frame_name;
|
2020-03-26 12:05:45 -06:00
|
|
|
content::Referrer referrer;
|
|
|
|
std::string raw_features;
|
|
|
|
scoped_refptr<network::ResourceRequestBody> body;
|
2018-10-22 12:02:25 -06:00
|
|
|
|
|
|
|
private:
|
2019-01-21 09:56:54 -07:00
|
|
|
explicit ChildWebContentsTracker(content::WebContents* web_contents);
|
2018-10-22 12:02:25 -06:00
|
|
|
friend class content::WebContentsUserData<ChildWebContentsTracker>;
|
2017-04-05 21:15:27 -06:00
|
|
|
|
2019-01-21 09:56:54 -07:00
|
|
|
WEB_CONTENTS_USER_DATA_KEY_DECL();
|
2017-04-05 21:15:27 -06:00
|
|
|
};
|
|
|
|
|
2019-06-19 15:23:04 -06:00
|
|
|
} // namespace electron
|
2017-04-05 21:15:27 -06:00
|
|
|
|
2021-11-22 00:34:31 -07:00
|
|
|
#endif // ELECTRON_SHELL_BROWSER_CHILD_WEB_CONTENTS_TRACKER_H_
|