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

Side by Side Diff: content/renderer/web_ui_mojo_context_state.cc

Issue 1113783002: Use Local instead of Handle in src/content/* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 unified diff | Download patch
« no previous file with comments | « content/renderer/web_ui_mojo_context_state.h ('k') | content/renderer/web_ui_runner.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/web_ui_mojo_context_state.h" 5 #include "content/renderer/web_ui_mojo_context_state.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "content/public/renderer/render_frame.h" 9 #include "content/public/renderer/render_frame.h"
10 #include "content/public/renderer/resource_fetcher.h" 10 #include "content/public/renderer/resource_fetcher.h"
(...skipping 16 matching lines...) Expand all
27 27
28 namespace content { 28 namespace content {
29 29
30 namespace { 30 namespace {
31 31
32 // All modules have this prefixed to them when downloading. 32 // All modules have this prefixed to them when downloading.
33 // TODO(sky): move this into some common place. 33 // TODO(sky): move this into some common place.
34 const char kModulePrefix[] = "chrome://mojo/"; 34 const char kModulePrefix[] = "chrome://mojo/";
35 35
36 void RunMain(base::WeakPtr<gin::Runner> runner, 36 void RunMain(base::WeakPtr<gin::Runner> runner,
37 v8::Handle<v8::Value> module) { 37 v8::Local<v8::Value> module) {
38 v8::Isolate* isolate = runner->GetContextHolder()->isolate(); 38 v8::Isolate* isolate = runner->GetContextHolder()->isolate();
39 v8::Handle<v8::Function> start; 39 v8::Local<v8::Function> start;
40 CHECK(gin::ConvertFromV8(isolate, module, &start)); 40 CHECK(gin::ConvertFromV8(isolate, module, &start));
41 runner->Call(start, runner->global(), 0, NULL); 41 runner->Call(start, runner->global(), 0, NULL);
42 } 42 }
43 43
44 } // namespace 44 } // namespace
45 45
46 // WebUIMojo ------------------------------------------------------------------- 46 // WebUIMojo -------------------------------------------------------------------
47 47
48 WebUIMojoContextState::WebUIMojoContextState(blink::WebFrame* frame, 48 WebUIMojoContextState::WebUIMojoContextState(blink::WebFrame* frame,
49 v8::Handle<v8::Context> context) 49 v8::Local<v8::Context> context)
50 : frame_(frame), 50 : frame_(frame),
51 module_added_(false) { 51 module_added_(false) {
52 gin::PerContextData* context_data = gin::PerContextData::From(context); 52 gin::PerContextData* context_data = gin::PerContextData::From(context);
53 gin::ContextHolder* context_holder = context_data->context_holder(); 53 gin::ContextHolder* context_holder = context_data->context_holder();
54 runner_.reset(new WebUIRunner(frame_, context_holder)); 54 runner_.reset(new WebUIRunner(frame_, context_holder));
55 gin::Runner::Scope scoper(runner_.get()); 55 gin::Runner::Scope scoper(runner_.get());
56 gin::ModuleRegistry::From(context)->AddObserver(this); 56 gin::ModuleRegistry::From(context)->AddObserver(this);
57 content::RenderFrame::FromWebFrame(frame) 57 content::RenderFrame::FromWebFrame(frame)
58 ->EnsureMojoBuiltinsAreAvailable(context_holder->isolate(), context); 58 ->EnsureMojoBuiltinsAreAvailable(context_holder->isolate(), context);
59 gin::ModuleRegistry::InstallGlobals(context->GetIsolate(), context->Global()); 59 gin::ModuleRegistry::InstallGlobals(context->GetIsolate(), context->Global());
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 const std::vector<std::string>& dependencies) { 131 const std::vector<std::string>& dependencies) {
132 FetchModules(dependencies); 132 FetchModules(dependencies);
133 133
134 gin::ContextHolder* context_holder = runner_->GetContextHolder(); 134 gin::ContextHolder* context_holder = runner_->GetContextHolder();
135 gin::ModuleRegistry* registry = gin::ModuleRegistry::From( 135 gin::ModuleRegistry* registry = gin::ModuleRegistry::From(
136 context_holder->context()); 136 context_holder->context());
137 registry->AttemptToLoadMoreModules(context_holder->isolate()); 137 registry->AttemptToLoadMoreModules(context_holder->isolate());
138 } 138 }
139 139
140 } // namespace content 140 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/web_ui_mojo_context_state.h ('k') | content/renderer/web_ui_runner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698