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

Unified Diff: headless/public/headless_browser_context.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/public/headless_browser.cc ('k') | headless/public/headless_web_contents.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: headless/public/headless_browser_context.h
diff --git a/headless/public/headless_browser_context.h b/headless/public/headless_browser_context.h
new file mode 100644
index 0000000000000000000000000000000000000000..b72abb3c3ec669722981d974d6eeb34a47e17f4f
--- /dev/null
+++ b/headless/public/headless_browser_context.h
@@ -0,0 +1,51 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef HEADLESS_PUBLIC_HEADLESS_BROWSER_CONTEXT_H_
+#define HEADLESS_PUBLIC_HEADLESS_BROWSER_CONTEXT_H_
+
+#include "headless/public/headless_export.h"
+
+namespace headless {
+class HeadlessBrowserImpl;
+
+// Represents an isolated session with a unique cache, cookies, and other
+// profile/session related data.
+class HEADLESS_EXPORT HeadlessBrowserContext {
+ public:
+ class Builder;
+
+ virtual ~HeadlessBrowserContext() {}
+
+ // TODO(skyostil): Allow saving and restoring contexts (crbug.com/617931).
+
+ protected:
+ HeadlessBrowserContext() {}
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(HeadlessBrowserContext);
+};
+
+class HEADLESS_EXPORT HeadlessBrowserContext::Builder {
+ public:
+ Builder(Builder&&);
+ ~Builder();
+
+ // TODO(skyostil): Allow overriding protocol handlers.
+
+ std::unique_ptr<HeadlessBrowserContext> Build();
+
+ private:
+ friend class HeadlessBrowserImpl;
+
+ explicit Builder(HeadlessBrowserImpl* browser);
+
+ HeadlessBrowserImpl* browser_;
+
+ DISALLOW_COPY_AND_ASSIGN(Builder);
+};
+
+} // namespace headless
+
+#endif // HEADLESS_PUBLIC_HEADLESS_BROWSER_CONTEXT_H_
« no previous file with comments | « headless/public/headless_browser.cc ('k') | headless/public/headless_web_contents.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698