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

Side by Side Diff: headless/public/headless_browser.h

Issue 2840993003: [headless] Expose DevToolsTarget via HeadlessBrowser + add tracing test. (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « headless/lib/headless_browser_browsertest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_PUBLIC_HEADLESS_BROWSER_H_ 5 #ifndef HEADLESS_PUBLIC_HEADLESS_BROWSER_H_
6 #define HEADLESS_PUBLIC_HEADLESS_BROWSER_H_ 6 #define HEADLESS_PUBLIC_HEADLESS_BROWSER_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 #include <unordered_map> 10 #include <unordered_map>
(...skipping 28 matching lines...) Expand all
39 39
40 // Create a new browser context which can be used to create tabs and isolate 40 // Create a new browser context which can be used to create tabs and isolate
41 // them from one another. 41 // them from one another.
42 // Pointer to HeadlessBrowserContext becomes invalid after: 42 // Pointer to HeadlessBrowserContext becomes invalid after:
43 // a) Calling HeadlessBrowserContext::Close or 43 // a) Calling HeadlessBrowserContext::Close or
44 // b) Calling HeadlessBrowser::Shutdown 44 // b) Calling HeadlessBrowser::Shutdown
45 virtual HeadlessBrowserContext::Builder CreateBrowserContextBuilder() = 0; 45 virtual HeadlessBrowserContext::Builder CreateBrowserContextBuilder() = 0;
46 46
47 virtual std::vector<HeadlessBrowserContext*> GetAllBrowserContexts() = 0; 47 virtual std::vector<HeadlessBrowserContext*> GetAllBrowserContexts() = 0;
48 48
49 // Return a DevTools target corresponding to this tab. Note that this method
Sami 2017/04/26 15:47:06 s/tab/browser/?
Eric Seckler 2017/04/27 09:14:20 Uh, indeed! :)
50 // only returns a valid target after browser has been initialized on the main
51 // thread. The target only supports the domains available on the
52 // browser endpoint excluding the Tethering domain.
53 virtual HeadlessDevToolsTarget* GetDevToolsTarget() = 0;
54
49 // Returns the HeadlessWebContents associated with the 55 // Returns the HeadlessWebContents associated with the
50 // |devtools_agent_host_id| if any. Otherwise returns null. 56 // |devtools_agent_host_id| if any. Otherwise returns null.
51 virtual HeadlessWebContents* GetWebContentsForDevToolsAgentHostId( 57 virtual HeadlessWebContents* GetWebContentsForDevToolsAgentHostId(
52 const std::string& devtools_agent_host_id) = 0; 58 const std::string& devtools_agent_host_id) = 0;
53 59
54 // Returns HeadlessBrowserContext associated with the given id if any. 60 // Returns HeadlessBrowserContext associated with the given id if any.
55 // Otherwise returns null. 61 // Otherwise returns null.
56 virtual HeadlessBrowserContext* GetBrowserContextForId( 62 virtual HeadlessBrowserContext* GetBrowserContextForId(
57 const std::string& id) = 0; 63 const std::string& id) = 0;
58 64
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 // the main loop, it will only return after HeadlessBrowser::Shutdown() is 243 // the main loop, it will only return after HeadlessBrowser::Shutdown() is
238 // called, returning the exit code for the process. It is not possible to 244 // called, returning the exit code for the process. It is not possible to
239 // initialize the browser again after it has been torn down. 245 // initialize the browser again after it has been torn down.
240 int HeadlessBrowserMain( 246 int HeadlessBrowserMain(
241 HeadlessBrowser::Options options, 247 HeadlessBrowser::Options options,
242 const base::Callback<void(HeadlessBrowser*)>& on_browser_start_callback); 248 const base::Callback<void(HeadlessBrowser*)>& on_browser_start_callback);
243 249
244 } // namespace headless 250 } // namespace headless
245 251
246 #endif // HEADLESS_PUBLIC_HEADLESS_BROWSER_H_ 252 #endif // HEADLESS_PUBLIC_HEADLESS_BROWSER_H_
OLDNEW
« no previous file with comments | « headless/lib/headless_browser_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698