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

Unified Diff: headless/public/headless_browser_context.h

Issue 2049363003: Adds support for headless chrome embedder mojo services (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Abandon (for now) the concice bindings. Add BINDINGS_POLICY_HEADLESS and headless-mojo:// 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
Index: headless/public/headless_browser_context.h
diff --git a/headless/public/headless_browser_context.h b/headless/public/headless_browser_context.h
index f8c581c2fd5fb0a17cfce226cca63e9f380cdaff..5479e369b22d4ca94f08700575d3c84b460cefeb 100644
--- a/headless/public/headless_browser_context.h
+++ b/headless/public/headless_browser_context.h
@@ -5,6 +5,8 @@
#ifndef HEADLESS_PUBLIC_HEADLESS_BROWSER_CONTEXT_H_
#define HEADLESS_PUBLIC_HEADLESS_BROWSER_CONTEXT_H_
+#include <list>
+
#include "headless/public/headless_export.h"
#include "net/url_request/url_request_job_factory.h"
@@ -41,15 +43,36 @@ class HEADLESS_EXPORT HeadlessBrowserContext::Builder {
// fetching for different network schemes.
Builder& SetProtocolHandlers(ProtocolHandlerMap protocol_handlers);
+ // Specify JS mojo module bindings to be installed, one per mojom file.
+ // Note a single mojom file could potentially define many interfaces.
+ // |mojom_name| the name including path of the .mojom file.
+ // |js_bindings| compiletime generated javascript bindings. Typically loaded
+ // from gen/path/name.mojom.js.
+ Builder& AddJsMojoBindings(const std::string& mojom_name,
Sami 2016/06/27 11:10:42 Let's have a TODO to add this to the default conte
alex clarke (OOO till 29th) 2016/06/27 11:35:52 Done.
+ const std::string& js_bindings);
+
std::unique_ptr<HeadlessBrowserContext> Build();
private:
friend class HeadlessBrowserImpl;
+ struct MojoBindings {
+ MojoBindings();
+ MojoBindings(const std::string& mojom_name, const std::string& js_bindings);
+ ~MojoBindings();
+
+ std::string mojom_name;
+ std::string js_bindings;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(MojoBindings);
+ };
+
explicit Builder(HeadlessBrowserImpl* browser);
HeadlessBrowserImpl* browser_;
ProtocolHandlerMap protocol_handlers_;
+ std::list<MojoBindings> mojo_bindings_;
DISALLOW_COPY_AND_ASSIGN(Builder);
};

Powered by Google App Engine
This is Rietveld 408576698