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

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

Issue 1350023003: Add a Mojo EDK for Chrome that uses one OS pipe per message pipe. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: move to mojo::edk namespace in preparation for runtim flag Created 5 years, 3 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/render_frame_impl.h" 5 #include "content/renderer/render_frame_impl.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 #include "third_party/WebKit/public/web/WebScopedUserGesture.h" 141 #include "third_party/WebKit/public/web/WebScopedUserGesture.h"
142 #include "third_party/WebKit/public/web/WebScriptSource.h" 142 #include "third_party/WebKit/public/web/WebScriptSource.h"
143 #include "third_party/WebKit/public/web/WebSearchableFormData.h" 143 #include "third_party/WebKit/public/web/WebSearchableFormData.h"
144 #include "third_party/WebKit/public/web/WebSecurityOrigin.h" 144 #include "third_party/WebKit/public/web/WebSecurityOrigin.h"
145 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" 145 #include "third_party/WebKit/public/web/WebSecurityPolicy.h"
146 #include "third_party/WebKit/public/web/WebSerializedScriptValue.h" 146 #include "third_party/WebKit/public/web/WebSerializedScriptValue.h"
147 #include "third_party/WebKit/public/web/WebSettings.h" 147 #include "third_party/WebKit/public/web/WebSettings.h"
148 #include "third_party/WebKit/public/web/WebSurroundingText.h" 148 #include "third_party/WebKit/public/web/WebSurroundingText.h"
149 #include "third_party/WebKit/public/web/WebUserGestureIndicator.h" 149 #include "third_party/WebKit/public/web/WebUserGestureIndicator.h"
150 #include "third_party/WebKit/public/web/WebView.h" 150 #include "third_party/WebKit/public/web/WebView.h"
151 #include "third_party/mojo/src/mojo/edk/js/core.h"
152 #include "third_party/mojo/src/mojo/edk/js/support.h"
153 #include "url/url_util.h" 151 #include "url/url_util.h"
154 152
155 #if defined(ENABLE_PLUGINS) 153 #if defined(ENABLE_PLUGINS)
156 #include "content/renderer/npapi/webplugin_impl.h" 154 #include "content/renderer/npapi/webplugin_impl.h"
157 #include "content/renderer/pepper/pepper_browser_connection.h" 155 #include "content/renderer/pepper/pepper_browser_connection.h"
158 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" 156 #include "content/renderer/pepper/pepper_plugin_instance_impl.h"
159 #include "content/renderer/pepper/pepper_webplugin_impl.h" 157 #include "content/renderer/pepper/pepper_webplugin_impl.h"
160 #include "content/renderer/pepper/plugin_module.h" 158 #include "content/renderer/pepper/plugin_module.h"
161 #endif 159 #endif
162 160
(...skipping 29 matching lines...) Expand all
192 #include "mojo/application/public/interfaces/shell.mojom.h" 190 #include "mojo/application/public/interfaces/shell.mojom.h"
193 #include "third_party/mojo/src/mojo/public/cpp/bindings/interface_request.h" 191 #include "third_party/mojo/src/mojo/public/cpp/bindings/interface_request.h"
194 #else 192 #else
195 #include "media/renderers/default_renderer_factory.h" 193 #include "media/renderers/default_renderer_factory.h"
196 #endif 194 #endif
197 195
198 #if defined(ENABLE_WEBVR) 196 #if defined(ENABLE_WEBVR)
199 #include "content/renderer/vr/vr_dispatcher.h" 197 #include "content/renderer/vr/vr_dispatcher.h"
200 #endif 198 #endif
201 199
200 #if defined(USE_CHROME_EDK)
201 #include "mojo/edk/js/core.h"
202 #include "mojo/edk/js/support.h"
203 #else
204 #include "third_party/mojo/src/mojo/edk/js/core.h"
205 #include "third_party/mojo/src/mojo/edk/js/support.h"
206 #endif
207
202 using blink::WebContentDecryptionModule; 208 using blink::WebContentDecryptionModule;
203 using blink::WebContextMenuData; 209 using blink::WebContextMenuData;
204 using blink::WebData; 210 using blink::WebData;
205 using blink::WebDataSource; 211 using blink::WebDataSource;
206 using blink::WebDocument; 212 using blink::WebDocument;
207 using blink::WebDOMEvent; 213 using blink::WebDOMEvent;
208 using blink::WebDOMMessageEvent; 214 using blink::WebDOMMessageEvent;
209 using blink::WebElement; 215 using blink::WebElement;
210 using blink::WebExternalPopupMenu; 216 using blink::WebExternalPopupMenu;
211 using blink::WebExternalPopupMenuClient; 217 using blink::WebExternalPopupMenuClient;
(...skipping 1745 matching lines...) Expand 10 before | Expand all | Expand 10 after
1957 Send(new ViewHostMsg_SelectionChanged(GetRenderWidget()->routing_id(), 1963 Send(new ViewHostMsg_SelectionChanged(GetRenderWidget()->routing_id(),
1958 selection_text, 1964 selection_text,
1959 offset, 1965 offset,
1960 range)); 1966 range));
1961 } 1967 }
1962 1968
1963 void RenderFrameImpl::EnsureMojoBuiltinsAreAvailable( 1969 void RenderFrameImpl::EnsureMojoBuiltinsAreAvailable(
1964 v8::Isolate* isolate, 1970 v8::Isolate* isolate,
1965 v8::Local<v8::Context> context) { 1971 v8::Local<v8::Context> context) {
1966 gin::ModuleRegistry* registry = gin::ModuleRegistry::From(context); 1972 gin::ModuleRegistry* registry = gin::ModuleRegistry::From(context);
1973 #if defined(USE_CHROME_EDK)
1974 if (registry->available_modules().count(mojo::edk::Core::kModuleName))
1975 return;
1976
1977 v8::HandleScope handle_scope(isolate);
1978 registry->AddBuiltinModule(
1979 isolate, mojo::edk::Core::kModuleName,
1980 mojo::edk::Core::GetModule(isolate));
1981 registry->AddBuiltinModule(isolate,
1982 mojo::edk::Support::kModuleName,
1983 mojo::edk::Support::GetModule(isolate));
1984 #else
1967 if (registry->available_modules().count(mojo::js::Core::kModuleName)) 1985 if (registry->available_modules().count(mojo::js::Core::kModuleName))
1968 return; 1986 return;
1969 1987
1970 v8::HandleScope handle_scope(isolate); 1988 v8::HandleScope handle_scope(isolate);
1971 registry->AddBuiltinModule( 1989 registry->AddBuiltinModule(
1972 isolate, mojo::js::Core::kModuleName, mojo::js::Core::GetModule(isolate)); 1990 isolate, mojo::js::Core::kModuleName, mojo::js::Core::GetModule(isolate));
1973 registry->AddBuiltinModule(isolate, 1991 registry->AddBuiltinModule(isolate,
1974 mojo::js::Support::kModuleName, 1992 mojo::js::Support::kModuleName,
1975 mojo::js::Support::GetModule(isolate)); 1993 mojo::js::Support::GetModule(isolate));
1994 #endif
1976 registry->AddBuiltinModule( 1995 registry->AddBuiltinModule(
1977 isolate, 1996 isolate,
1978 ServiceRegistryJsWrapper::kModuleName, 1997 ServiceRegistryJsWrapper::kModuleName,
1979 ServiceRegistryJsWrapper::Create(isolate, &service_registry_).ToV8()); 1998 ServiceRegistryJsWrapper::Create(isolate, &service_registry_).ToV8());
1980 } 1999 }
1981 2000
1982 void RenderFrameImpl::AddMessageToConsole(ConsoleMessageLevel level, 2001 void RenderFrameImpl::AddMessageToConsole(ConsoleMessageLevel level,
1983 const std::string& message) { 2002 const std::string& message) {
1984 if (devtools_agent_) 2003 if (devtools_agent_)
1985 devtools_agent_->AddMessageToConsole(level, message); 2004 devtools_agent_->AddMessageToConsole(level, message);
(...skipping 3081 matching lines...) Expand 10 before | Expand all | Expand 10 after
5067 mojo::ServiceProviderPtr service_provider; 5086 mojo::ServiceProviderPtr service_provider;
5068 mojo::URLRequestPtr request(mojo::URLRequest::New()); 5087 mojo::URLRequestPtr request(mojo::URLRequest::New());
5069 request->url = mojo::String::From(url); 5088 request->url = mojo::String::From(url);
5070 mojo_shell_->ConnectToApplication(request.Pass(), GetProxy(&service_provider), 5089 mojo_shell_->ConnectToApplication(request.Pass(), GetProxy(&service_provider),
5071 nullptr, nullptr, 5090 nullptr, nullptr,
5072 base::Bind(&OnGotContentHandlerID)); 5091 base::Bind(&OnGotContentHandlerID));
5073 return service_provider.Pass(); 5092 return service_provider.Pass();
5074 } 5093 }
5075 5094
5076 } // namespace content 5095 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698