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

Unified Diff: headless/public/headless_browser.h

Issue 2043603004: headless: Introduce a browser context (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address nits Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « headless/lib/headless_web_contents_browsertest.cc ('k') | headless/public/headless_browser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: headless/public/headless_browser.h
diff --git a/headless/public/headless_browser.h b/headless/public/headless_browser.h
index b869fc44fdf2c48fcfd5d870b8eb6ce2c760e3de..d3db68d21f1638bcdf4264f0b4e5f015a8d5f781 100644
--- a/headless/public/headless_browser.h
+++ b/headless/public/headless_browser.h
@@ -13,7 +13,9 @@
#include "base/callback.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
+#include "headless/public/headless_browser_context.h"
#include "headless/public/headless_export.h"
+#include "headless/public/headless_web_contents.h"
#include "net/base/host_port_pair.h"
#include "net/base/ip_endpoint.h"
#include "net/url_request/url_request_job_factory.h"
@@ -28,7 +30,6 @@ class Size;
}
namespace headless {
-class HeadlessWebContents;
// This class represents the global headless browser instance. To get a pointer
// to one, call |HeadlessBrowserMain| to initiate the browser main loop. An
@@ -38,11 +39,11 @@ class HEADLESS_EXPORT HeadlessBrowser {
public:
struct Options;
- // Create a new browser tab which navigates to |initial_url|. |size| is in
- // physical pixels.
- // We require the user to pass an initial URL to ensure that the renderer
- // gets initialized and eventually becomes ready to be inspected. See
- // HeadlessWebContents::Observer::DevToolsTargetReady.
+ // Open a new tab. Returns a builder object which can be used to set
+ // properties for the new tab.
+ virtual HeadlessWebContents::Builder CreateWebContentsBuilder() = 0;
+
+ // Deprecated. Use CreateWebContentsBuilder() instead.
virtual HeadlessWebContents* CreateWebContents(const GURL& initial_url,
const gfx::Size& size) = 0;
@@ -60,6 +61,10 @@ class HEADLESS_EXPORT HeadlessBrowser {
// browser stops.
virtual void Shutdown() = 0;
+ // Create a new browser context, which can be used to isolate
+ // HeadlessWebContents from one another.
+ virtual HeadlessBrowserContext::Builder CreateBrowserContextBuilder() = 0;
+
protected:
HeadlessBrowser() {}
virtual ~HeadlessBrowser() {}
« no previous file with comments | « headless/lib/headless_web_contents_browsertest.cc ('k') | headless/public/headless_browser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698