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

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

Issue 358743002: Mojo: Remove InterfaceProvider. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/renderer/render_thread_impl.cc ('k') | content/utility/BUILD.gn » ('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.h" 5 #include "content/renderer/web_ui_mojo.h"
6 6
7 #include "content/common/view_messages.h" 7 #include "content/common/view_messages.h"
8 #include "content/public/common/service_registry.h" 8 #include "content/public/common/service_registry.h"
9 #include "content/public/renderer/render_frame.h" 9 #include "content/public/renderer/render_frame.h"
10 #include "content/public/renderer/render_view.h" 10 #include "content/public/renderer/render_view.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 return; 82 return;
83 context_data->RemoveUserData(kWebUIMojoContextStateKey); 83 context_data->RemoveUserData(kWebUIMojoContextStateKey);
84 } 84 }
85 85
86 void WebUIMojo::OnDidFinishDocumentLoad() { 86 void WebUIMojo::OnDidFinishDocumentLoad() {
87 did_finish_document_load_ = true; 87 did_finish_document_load_ = true;
88 mojo::MessagePipe pipe; 88 mojo::MessagePipe pipe;
89 SetHandleOnContextState(pipe.handle0.Pass()); 89 SetHandleOnContextState(pipe.handle0.Pass());
90 RenderFrame::FromWebFrame(render_view()->GetWebView()->mainFrame())-> 90 RenderFrame::FromWebFrame(render_view()->GetWebView()->mainFrame())->
91 GetServiceRegistry()-> 91 GetServiceRegistry()->
92 GetRemoteInterface("webui_controller", pipe.handle1.Pass()); 92 ConnectToRemoteService("webui_controller", pipe.handle1.Pass());
93 } 93 }
94 94
95 void WebUIMojo::SetHandleOnContextState(mojo::ScopedMessagePipeHandle handle) { 95 void WebUIMojo::SetHandleOnContextState(mojo::ScopedMessagePipeHandle handle) {
96 DCHECK(did_finish_document_load_); 96 DCHECK(did_finish_document_load_);
97 v8::HandleScope handle_scope(blink::mainThreadIsolate()); 97 v8::HandleScope handle_scope(blink::mainThreadIsolate());
98 WebUIMojoContextState* state = GetContextState(); 98 WebUIMojoContextState* state = GetContextState();
99 if (state) 99 if (state)
100 state->SetHandle(handle.Pass()); 100 state->SetHandle(handle.Pass());
101 } 101 }
102 102
(...skipping 25 matching lines...) Expand all
128 WebUIMojoContextState* state = GetContextState(); 128 WebUIMojoContextState* state = GetContextState();
129 if (state && !state->module_added()) 129 if (state && !state->module_added())
130 return; 130 return;
131 131
132 v8::HandleScope handle_scope(blink::mainThreadIsolate()); 132 v8::HandleScope handle_scope(blink::mainThreadIsolate());
133 DestroyContextState(frame->mainWorldScriptContext()); 133 DestroyContextState(frame->mainWorldScriptContext());
134 CreateContextState(); 134 CreateContextState();
135 } 135 }
136 136
137 } // namespace content 137 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_thread_impl.cc ('k') | content/utility/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698