Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(517)

Side by Side Diff: headless/lib/browser/headless_web_contents_impl.h

Issue 2830753004: Pipe the devTools FrameId from blink into the browser for headless (Closed)
Patch Set: Changes for Sami and creis@ Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef HEADLESS_LIB_BROWSER_HEADLESS_WEB_CONTENTS_IMPL_H_ 5 #ifndef HEADLESS_LIB_BROWSER_HEADLESS_WEB_CONTENTS_IMPL_H_
6 #define HEADLESS_LIB_BROWSER_HEADLESS_WEB_CONTENTS_IMPL_H_ 6 #define HEADLESS_LIB_BROWSER_HEADLESS_WEB_CONTENTS_IMPL_H_
7 7
8 #include <list> 8 #include <list>
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 HeadlessBrowserImpl* browser() const; 85 HeadlessBrowserImpl* browser() const;
86 HeadlessBrowserContextImpl* browser_context() const; 86 HeadlessBrowserContextImpl* browser_context() const;
87 87
88 void set_window_tree_host(std::unique_ptr<HeadlessWindowTreeHost> host) { 88 void set_window_tree_host(std::unique_ptr<HeadlessWindowTreeHost> host) {
89 window_tree_host_ = std::move(host); 89 window_tree_host_ = std::move(host);
90 } 90 }
91 HeadlessWindowTreeHost* window_tree_host() const { 91 HeadlessWindowTreeHost* window_tree_host() const {
92 return window_tree_host_.get(); 92 return window_tree_host_.get();
93 } 93 }
94 94
95 // Returns the devtools frame id corresponding to the |frame_tree_node_id|, if
96 // any. Note this relies on an IPC sent from blink during navigation.
97 std::string GetUntrustedDevToolsFrameIdForFrameTreeNodeId(
98 int process_id,
99 int frame_tree_node_id) const;
100
101 int GetRenderProcessId() const;
102
95 private: 103 private:
96 // Takes ownership of |web_contents|. 104 // Takes ownership of |web_contents|.
97 HeadlessWebContentsImpl(content::WebContents* web_contents, 105 HeadlessWebContentsImpl(content::WebContents* web_contents,
98 HeadlessBrowserContextImpl* browser_context); 106 HeadlessBrowserContextImpl* browser_context);
99 107
100 void InitializeScreen(const gfx::Size& initial_size); 108 void InitializeScreen(const gfx::Size& initial_size);
101 using MojoService = HeadlessWebContents::Builder::MojoService; 109 using MojoService = HeadlessWebContents::Builder::MojoService;
102 110
103 std::unordered_map<content::RenderFrameHost*, std::string> 111 std::unordered_map<content::RenderFrameHost*, std::string>
104 render_frame_host_to_devtools_agent_host_id_; 112 render_frame_host_to_devtools_agent_host_id_;
(...skipping 14 matching lines...) Expand all
119 std::unordered_map<HeadlessWebContents::Observer*, 127 std::unordered_map<HeadlessWebContents::Observer*,
120 std::unique_ptr<WebContentsObserverAdapter>>; 128 std::unique_ptr<WebContentsObserverAdapter>>;
121 ObserverMap observer_map_; 129 ObserverMap observer_map_;
122 130
123 DISALLOW_COPY_AND_ASSIGN(HeadlessWebContentsImpl); 131 DISALLOW_COPY_AND_ASSIGN(HeadlessWebContentsImpl);
124 }; 132 };
125 133
126 } // namespace headless 134 } // namespace headless
127 135
128 #endif // HEADLESS_LIB_BROWSER_HEADLESS_WEB_CONTENTS_IMPL_H_ 136 #endif // HEADLESS_LIB_BROWSER_HEADLESS_WEB_CONTENTS_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698