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

Unified Diff: content/renderer/web_ui_mojo_context_state.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.h ('k') | content/renderer/web_ui_runner.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/web_ui_mojo_context_state.cc
diff --git a/content/renderer/web_ui_mojo_context_state.cc b/content/renderer/web_ui_mojo_context_state.cc
index f1ff5f4896a058ee2ec87a868a4467211387fcf6..e993da6277d427af6bd4161e8328d0261b24306e 100644
--- a/content/renderer/web_ui_mojo_context_state.cc
+++ b/content/renderer/web_ui_mojo_context_state.cc
@@ -36,14 +36,11 @@ namespace {
const char kModulePrefix[] = "chrome://mojo/";
void RunMain(base::WeakPtr<gin::Runner> runner,
- mojo::ScopedMessagePipeHandle* handle,
v8::Handle<v8::Value> module) {
v8::Isolate* isolate = runner->GetContextHolder()->isolate();
v8::Handle<v8::Function> start;
CHECK(gin::ConvertFromV8(isolate, module, &start));
- v8::Handle<v8::Value> args[] = {
- gin::ConvertToV8(isolate, mojo::Handle(handle->release().value())) };
- runner->Call(start, runner->global(), 1, args);
+ runner->Call(start, runner->global(), 0, NULL);
}
} // namespace
@@ -71,14 +68,12 @@ WebUIMojoContextState::~WebUIMojoContextState() {
runner_->GetContextHolder()->context())->RemoveObserver(this);
}
-void WebUIMojoContextState::SetHandle(mojo::ScopedMessagePipeHandle handle) {
+void WebUIMojoContextState::Run() {
gin::ContextHolder* context_holder = runner_->GetContextHolder();
- mojo::ScopedMessagePipeHandle* passed_handle =
- new mojo::ScopedMessagePipeHandle(handle.Pass());
gin::ModuleRegistry::From(context_holder->context())->LoadModule(
context_holder->isolate(),
"main",
- base::Bind(RunMain, runner_->GetWeakPtr(), base::Owned(passed_handle)));
+ base::Bind(RunMain, runner_->GetWeakPtr()));
}
void WebUIMojoContextState::FetchModules(const std::vector<std::string>& ids) {
« no previous file with comments | « content/renderer/web_ui_mojo_context_state.h ('k') | content/renderer/web_ui_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698