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

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

Issue 1146813003: Remove mojo::InterfaceImpl from render_thread_impl and web_ui_mojo_browsertest. (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/browser/webui/web_ui_mojo_browsertest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_thread_impl.h" 5 #include "content/renderer/render_thread_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <map> 9 #include <map>
10 #include <vector> 10 #include <vector>
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 #include "third_party/WebKit/public/web/WebFrame.h" 131 #include "third_party/WebKit/public/web/WebFrame.h"
132 #include "third_party/WebKit/public/web/WebImageCache.h" 132 #include "third_party/WebKit/public/web/WebImageCache.h"
133 #include "third_party/WebKit/public/web/WebKit.h" 133 #include "third_party/WebKit/public/web/WebKit.h"
134 #include "third_party/WebKit/public/web/WebNetworkStateNotifier.h" 134 #include "third_party/WebKit/public/web/WebNetworkStateNotifier.h"
135 #include "third_party/WebKit/public/web/WebPopupMenu.h" 135 #include "third_party/WebKit/public/web/WebPopupMenu.h"
136 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" 136 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h"
137 #include "third_party/WebKit/public/web/WebScriptController.h" 137 #include "third_party/WebKit/public/web/WebScriptController.h"
138 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" 138 #include "third_party/WebKit/public/web/WebSecurityPolicy.h"
139 #include "third_party/WebKit/public/web/WebView.h" 139 #include "third_party/WebKit/public/web/WebView.h"
140 #include "third_party/icu/source/i18n/unicode/timezone.h" 140 #include "third_party/icu/source/i18n/unicode/timezone.h"
141 #include "third_party/mojo/src/mojo/public/cpp/bindings/strong_binding.h"
141 #include "third_party/skia/include/core/SkGraphics.h" 142 #include "third_party/skia/include/core/SkGraphics.h"
142 #include "ui/base/layout.h" 143 #include "ui/base/layout.h"
143 #include "ui/base/ui_base_switches.h" 144 #include "ui/base/ui_base_switches.h"
144 #include "v8/include/v8.h" 145 #include "v8/include/v8.h"
145 146
146 #if defined(OS_ANDROID) 147 #if defined(OS_ANDROID)
147 #include <cpu-features.h> 148 #include <cpu-features.h>
148 #include "content/renderer/android/synchronous_compositor_factory.h" 149 #include "content/renderer/android/synchronous_compositor_factory.h"
149 #include "content/renderer/media/android/renderer_demuxer_android.h" 150 #include "content/renderer/media/android/renderer_demuxer_android.h"
150 #endif 151 #endif
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 v8::Date::DateTimeConfigurationChangeNotification(isolate); 334 v8::Date::DateTimeConfigurationChangeNotification(isolate);
334 } 335 }
335 336
336 void LowMemoryNotificationOnThisThread() { 337 void LowMemoryNotificationOnThisThread() {
337 v8::Isolate* isolate = v8::Isolate::GetCurrent(); 338 v8::Isolate* isolate = v8::Isolate::GetCurrent();
338 if (!isolate) 339 if (!isolate)
339 return; 340 return;
340 isolate->LowMemoryNotification(); 341 isolate->LowMemoryNotification();
341 } 342 }
342 343
343 class RenderFrameSetupImpl : public mojo::InterfaceImpl<RenderFrameSetup> { 344 class RenderFrameSetupImpl : public RenderFrameSetup {
344 public: 345 public:
345 RenderFrameSetupImpl() 346 explicit RenderFrameSetupImpl(
346 : routing_id_highmark_(-1) { 347 mojo::InterfaceRequest<RenderFrameSetup> request)
347 } 348 : routing_id_highmark_(-1), binding_(this, request.Pass()) {}
348 349
349 void ExchangeServiceProviders( 350 void ExchangeServiceProviders(
350 int32_t frame_routing_id, 351 int32_t frame_routing_id,
351 mojo::InterfaceRequest<mojo::ServiceProvider> services, 352 mojo::InterfaceRequest<mojo::ServiceProvider> services,
352 mojo::ServiceProviderPtr exposed_services) 353 mojo::ServiceProviderPtr exposed_services)
353 override { 354 override {
354 // TODO(morrita): This is for investigating http://crbug.com/415059 and 355 // TODO(morrita): This is for investigating http://crbug.com/415059 and
355 // should be removed once it is fixed. 356 // should be removed once it is fixed.
356 CHECK_LT(routing_id_highmark_, frame_routing_id); 357 CHECK_LT(routing_id_highmark_, frame_routing_id);
357 routing_id_highmark_ = frame_routing_id; 358 routing_id_highmark_ = frame_routing_id;
358 359
359 RenderFrameImpl* frame = RenderFrameImpl::FromRoutingID(frame_routing_id); 360 RenderFrameImpl* frame = RenderFrameImpl::FromRoutingID(frame_routing_id);
360 // We can receive a GetServiceProviderForFrame message for a frame not yet 361 // We can receive a GetServiceProviderForFrame message for a frame not yet
361 // created due to a race between the message and a ViewMsg_New IPC that 362 // created due to a race between the message and a ViewMsg_New IPC that
362 // triggers creation of the RenderFrame we want. 363 // triggers creation of the RenderFrame we want.
363 if (!frame) { 364 if (!frame) {
364 RenderThreadImpl::current()->RegisterPendingRenderFrameConnect( 365 RenderThreadImpl::current()->RegisterPendingRenderFrameConnect(
365 frame_routing_id, services.Pass(), exposed_services.Pass()); 366 frame_routing_id, services.Pass(), exposed_services.Pass());
366 return; 367 return;
367 } 368 }
368 369
369 frame->BindServiceRegistry(services.Pass(), exposed_services.Pass()); 370 frame->BindServiceRegistry(services.Pass(), exposed_services.Pass());
370 } 371 }
371 372
372 private: 373 private:
373 int32_t routing_id_highmark_; 374 int32_t routing_id_highmark_;
375 mojo::StrongBinding<RenderFrameSetup> binding_;
374 }; 376 };
375 377
376 void CreateRenderFrameSetup(mojo::InterfaceRequest<RenderFrameSetup> request) { 378 void CreateRenderFrameSetup(mojo::InterfaceRequest<RenderFrameSetup> request) {
377 mojo::BindToRequest(new RenderFrameSetupImpl(), &request); 379 new RenderFrameSetupImpl(request.Pass());
378 } 380 }
379 381
380 blink::WebGraphicsContext3D::Attributes GetOffscreenAttribs() { 382 blink::WebGraphicsContext3D::Attributes GetOffscreenAttribs() {
381 blink::WebGraphicsContext3D::Attributes attributes; 383 blink::WebGraphicsContext3D::Attributes attributes;
382 attributes.shareResources = true; 384 attributes.shareResources = true;
383 attributes.depth = false; 385 attributes.depth = false;
384 attributes.stencil = false; 386 attributes.stencil = false;
385 attributes.antialias = false; 387 attributes.antialias = false;
386 attributes.noAutomaticFlushes = true; 388 attributes.noAutomaticFlushes = true;
387 return attributes; 389 return attributes;
(...skipping 1497 matching lines...) Expand 10 before | Expand all | Expand 10 after
1885 } 1887 }
1886 1888
1887 void RenderThreadImpl::PendingRenderFrameConnect::OnConnectionError() { 1889 void RenderThreadImpl::PendingRenderFrameConnect::OnConnectionError() {
1888 size_t erased = 1890 size_t erased =
1889 RenderThreadImpl::current()->pending_render_frame_connects_.erase( 1891 RenderThreadImpl::current()->pending_render_frame_connects_.erase(
1890 routing_id_); 1892 routing_id_);
1891 DCHECK_EQ(1u, erased); 1893 DCHECK_EQ(1u, erased);
1892 } 1894 }
1893 1895
1894 } // namespace content 1896 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/webui/web_ui_mojo_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698