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

Unified Diff: headless/public/headless_web_contents.h

Issue 2181413002: [headless] Remove default browser context. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Small fixes Created 4 years, 4 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
Index: headless/public/headless_web_contents.h
diff --git a/headless/public/headless_web_contents.h b/headless/public/headless_web_contents.h
index ee17c0ebd9433ae8eba0028fa463eeec9cbc2d8d..91626482ec2bd64d51fd511391a18b790daf1521 100644
--- a/headless/public/headless_web_contents.h
+++ b/headless/public/headless_web_contents.h
@@ -6,6 +6,8 @@
#define HEADLESS_PUBLIC_HEADLESS_WEB_CONTENTS_H_
#include <list>
+#include <string>
+#include <utility>
#include "base/callback.h"
#include "base/macros.h"
@@ -15,7 +17,7 @@
#include "url/gurl.h"
namespace headless {
-class HeadlessBrowserContext;
+class HeadlessBrowserContextImpl;
class HeadlessBrowserImpl;
class HeadlessDevToolsTarget;
@@ -79,12 +81,6 @@ class HEADLESS_EXPORT HeadlessWebContents::Builder {
// Specify the initial window size (default is 800x600).
Builder& SetWindowSize(const gfx::Size& size);
- // Set a browser context for storing session data (e.g., cookies, cache, local
- // storage) for the tab. Several tabs can share the same browser context. If
- // unset, the default browser context will be used. The browser context must
- // outlive this HeadlessWebContents.
- Builder& SetBrowserContext(HeadlessBrowserContext* browser_context);
-
// Specify an embedder provided Mojo service to be installed. The
// |service_factory| callback is called on demand by Mojo to instantiate the
// service if a client asks for it.
@@ -107,8 +103,11 @@ class HEADLESS_EXPORT HeadlessWebContents::Builder {
private:
friend class HeadlessBrowserImpl;
+ friend class HeadlessBrowserContextImpl;
friend class HeadlessWebContentsImpl;
+ explicit Builder(HeadlessBrowserContextImpl* browser_context);
+
template <typename Interface>
static void ForwardToServiceFactory(
const base::Callback<void(mojo::InterfaceRequest<Interface>)>&
@@ -131,12 +130,9 @@ class HEADLESS_EXPORT HeadlessWebContents::Builder {
DISALLOW_COPY_AND_ASSIGN(MojoService);
};
- explicit Builder(HeadlessBrowserImpl* browser);
-
- HeadlessBrowserImpl* browser_;
+ HeadlessBrowserContextImpl* browser_context_;
GURL initial_url_ = GURL("about:blank");
gfx::Size window_size_ = gfx::Size(800, 600);
- HeadlessBrowserContext* browser_context_;
std::list<MojoService> mojo_services_;
DISALLOW_COPY_AND_ASSIGN(Builder);

Powered by Google App Engine
This is Rietveld 408576698