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

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

Issue 2626823003: [headless] Add default browser context to HeadlessBrowser. (Closed)
Patch Set: Address Alex' comments + fix vtable. Created 3 years, 11 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_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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 // Returns the HeadlessWebContents associated with the 49 // Returns the HeadlessWebContents associated with the
50 // |devtools_agent_host_id| if any. Otherwise returns null. 50 // |devtools_agent_host_id| if any. Otherwise returns null.
51 virtual HeadlessWebContents* GetWebContentsForDevToolsAgentHostId( 51 virtual HeadlessWebContents* GetWebContentsForDevToolsAgentHostId(
52 const std::string& devtools_agent_host_id) = 0; 52 const std::string& devtools_agent_host_id) = 0;
53 53
54 // Returns HeadlessBrowserContext associated with the given id if any. 54 // Returns HeadlessBrowserContext associated with the given id if any.
55 // Otherwise returns null. 55 // Otherwise returns null.
56 virtual HeadlessBrowserContext* GetBrowserContextForId( 56 virtual HeadlessBrowserContext* GetBrowserContextForId(
57 const std::string& id) = 0; 57 const std::string& id) = 0;
58 58
59 // Allows setting and getting the browser context that DevTools will create
60 // new targets in by default.
Sami 2017/01/11 10:54:21 One side effect of this change is that now you mus
Eric Seckler 2017/01/11 11:37:13 Hehe :) I pondered this a bit as well and went wit
Sami 2017/01/11 18:20:30 All good points. I think we should go with making
61 virtual void SetDefaultBrowserContext(
62 HeadlessBrowserContext* browser_context) = 0;
63 virtual HeadlessBrowserContext* GetDefaultBrowserContext() = 0;
64
59 // Returns a task runner for submitting work to the browser file thread. 65 // Returns a task runner for submitting work to the browser file thread.
60 virtual scoped_refptr<base::SingleThreadTaskRunner> BrowserFileThread() 66 virtual scoped_refptr<base::SingleThreadTaskRunner> BrowserFileThread()
61 const = 0; 67 const = 0;
62 68
63 // Returns a task runner for submitting work to the browser io thread. 69 // Returns a task runner for submitting work to the browser io thread.
64 virtual scoped_refptr<base::SingleThreadTaskRunner> BrowserIOThread() 70 virtual scoped_refptr<base::SingleThreadTaskRunner> BrowserIOThread()
65 const = 0; 71 const = 0;
66 72
67 // Returns a task runner for submitting work to the browser main thread. 73 // Returns a task runner for submitting work to the browser main thread.
68 virtual scoped_refptr<base::SingleThreadTaskRunner> BrowserMainThread() 74 virtual scoped_refptr<base::SingleThreadTaskRunner> BrowserMainThread()
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 // the main loop, it will only return after HeadlessBrowser::Shutdown() is 216 // the main loop, it will only return after HeadlessBrowser::Shutdown() is
211 // called, returning the exit code for the process. It is not possible to 217 // called, returning the exit code for the process. It is not possible to
212 // initialize the browser again after it has been torn down. 218 // initialize the browser again after it has been torn down.
213 int HeadlessBrowserMain( 219 int HeadlessBrowserMain(
214 HeadlessBrowser::Options options, 220 HeadlessBrowser::Options options,
215 const base::Callback<void(HeadlessBrowser*)>& on_browser_start_callback); 221 const base::Callback<void(HeadlessBrowser*)>& on_browser_start_callback);
216 222
217 } // namespace headless 223 } // namespace headless
218 224
219 #endif // HEADLESS_PUBLIC_HEADLESS_BROWSER_H_ 225 #endif // HEADLESS_PUBLIC_HEADLESS_BROWSER_H_
OLDNEW
« no previous file with comments | « headless/lib/browser/headless_devtools_manager_delegate.cc ('k') | headless/test/headless_browser_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698