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

Unified Diff: headless/lib/browser/headless_browser_context_impl.cc

Issue 2813953002: Add HeadlessTabSocket (Closed)
Patch Set: Change HeadlessTabSocketImpl::SetListener Created 3 years, 8 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/BUILD.gn ('k') | headless/lib/browser/headless_tab_socket_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: headless/lib/browser/headless_browser_context_impl.cc
diff --git a/headless/lib/browser/headless_browser_context_impl.cc b/headless/lib/browser/headless_browser_context_impl.cc
index ca3c9a75c444c39bb06784adfc21df064496d709..b691760e4a4206b8a7f344cdd6f24ca768237cfd 100644
--- a/headless/lib/browser/headless_browser_context_impl.cc
+++ b/headless/lib/browser/headless_browser_context_impl.cc
@@ -15,6 +15,7 @@
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/resource_context.h"
#include "content/public/browser/storage_partition.h"
+#include "headless/grit/headless_lib_resources.h"
#include "headless/lib/browser/headless_browser_context_options.h"
#include "headless/lib/browser/headless_browser_impl.h"
#include "headless/lib/browser/headless_permission_manager.h"
@@ -22,6 +23,7 @@
#include "headless/public/util/black_hole_protocol_handler.h"
#include "headless/public/util/in_memory_protocol_handler.h"
#include "net/url_request/url_request_context.h"
+#include "ui/base/resource/resource_bundle.h"
namespace headless {
@@ -366,6 +368,16 @@ HeadlessBrowserContext::Builder::AddJsMojoBindings(
}
HeadlessBrowserContext::Builder&
+HeadlessBrowserContext::Builder::AddTabSocketMojoBindings() {
+ std::string js_bindings =
+ ui::ResourceBundle::GetSharedInstance()
+ .GetRawDataResource(IDR_HEADLESS_TAB_SOCKET_MOJOM_JS)
+ .as_string();
+ mojo_bindings_.emplace_back("headless/lib/tab_socket.mojom", js_bindings);
+ return *this;
+}
+
+HeadlessBrowserContext::Builder&
HeadlessBrowserContext::Builder::EnableUnsafeNetworkAccessWithMojoBindings(
bool enable_http_and_https_if_mojo_used) {
enable_http_and_https_if_mojo_used_ = enable_http_and_https_if_mojo_used;
« no previous file with comments | « headless/BUILD.gn ('k') | headless/lib/browser/headless_tab_socket_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698