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

Unified Diff: content/renderer/web_ui_runner.cc

Issue 302573002: Add a Javascript wrapper around ServiceRegistry and expose it to WebUI. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@render-view-shell
Patch Set: address comments Created 6 years, 5 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 | « content/renderer/web_ui_mojo_context_state.cc ('k') | content/test/data/web_ui_mojo.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/web_ui_runner.cc
diff --git a/content/renderer/web_ui_runner.cc b/content/renderer/web_ui_runner.cc
index a091636cc942b83699cbb43ef86975268ddebb1a..f6b6f5a26f54ed58d8511ba7c82e8f0253fa14e9 100644
--- a/content/renderer/web_ui_runner.cc
+++ b/content/renderer/web_ui_runner.cc
@@ -4,6 +4,9 @@
#include "content/renderer/web_ui_runner.h"
+#include "content/public/common/service_registry.h"
+#include "content/public/renderer/render_frame.h"
+#include "content/renderer/mojo/service_registry_js_wrapper.h"
#include "gin/modules/module_registry.h"
#include "gin/per_context_data.h"
#include "gin/public/context_holder.h"
@@ -47,6 +50,12 @@ void WebUIRunner::RegisterBuiltinModules() {
mojo::js::Support::kModuleName,
mojo::js::Support::GetModule(
context_holder_->isolate()));
+ registry->AddBuiltinModule(
+ context_holder_->isolate(),
+ ServiceRegistryJsWrapper::kModuleName,
+ ServiceRegistryJsWrapper::Create(
+ context_holder_->isolate(),
+ RenderFrame::FromWebFrame(frame_)->GetServiceRegistry()).ToV8());
}
void WebUIRunner::Run(const std::string& source,
« no previous file with comments | « content/renderer/web_ui_mojo_context_state.cc ('k') | content/test/data/web_ui_mojo.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698