OLD | NEW |
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 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 2431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2442 | 2442 |
2443 AssociatedInterfaceRegistry* | 2443 AssociatedInterfaceRegistry* |
2444 RenderFrameImpl::GetAssociatedInterfaceRegistry() { | 2444 RenderFrameImpl::GetAssociatedInterfaceRegistry() { |
2445 return &associated_interfaces_; | 2445 return &associated_interfaces_; |
2446 } | 2446 } |
2447 | 2447 |
2448 AssociatedInterfaceProvider* | 2448 AssociatedInterfaceProvider* |
2449 RenderFrameImpl::GetRemoteAssociatedInterfaces() { | 2449 RenderFrameImpl::GetRemoteAssociatedInterfaces() { |
2450 if (!remote_associated_interfaces_) { | 2450 if (!remote_associated_interfaces_) { |
2451 ChildThreadImpl* thread = ChildThreadImpl::current(); | 2451 ChildThreadImpl* thread = ChildThreadImpl::current(); |
2452 mojom::AssociatedInterfaceProviderAssociatedPtr remote_interfaces; | 2452 if (thread) { |
2453 thread->GetRemoteRouteProvider()->GetRoute( | 2453 mojom::AssociatedInterfaceProviderAssociatedPtr remote_interfaces; |
2454 routing_id_, | 2454 thread->GetRemoteRouteProvider()->GetRoute( |
2455 mojo::GetProxy(&remote_interfaces, | 2455 routing_id_, mojo::GetProxy(&remote_interfaces, |
2456 thread->channel()->GetAssociatedGroup())); | 2456 thread->channel()->GetAssociatedGroup())); |
2457 remote_associated_interfaces_.reset(new AssociatedInterfaceProviderImpl( | 2457 remote_associated_interfaces_.reset( |
2458 std::move(remote_interfaces))); | 2458 new AssociatedInterfaceProviderImpl(std::move(remote_interfaces))); |
| 2459 } else { |
| 2460 // In some tests the thread may be null, |
| 2461 // so set up a self-contained interface provider instead. |
| 2462 remote_associated_interfaces_.reset( |
| 2463 new AssociatedInterfaceProviderImpl()); |
| 2464 } |
2459 } | 2465 } |
2460 return remote_associated_interfaces_.get(); | 2466 return remote_associated_interfaces_.get(); |
2461 } | 2467 } |
2462 | 2468 |
2463 #if defined(ENABLE_PLUGINS) | 2469 #if defined(ENABLE_PLUGINS) |
2464 void RenderFrameImpl::RegisterPeripheralPlugin( | 2470 void RenderFrameImpl::RegisterPeripheralPlugin( |
2465 const url::Origin& content_origin, | 2471 const url::Origin& content_origin, |
2466 const base::Closure& unthrottle_callback) { | 2472 const base::Closure& unthrottle_callback) { |
2467 return plugin_power_saver_helper_->RegisterPeripheralPlugin( | 2473 return plugin_power_saver_helper_->RegisterPeripheralPlugin( |
2468 content_origin, unthrottle_callback); | 2474 content_origin, unthrottle_callback); |
(...skipping 3922 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6391 // event target. Potentially a Pepper plugin will receive the event. | 6397 // event target. Potentially a Pepper plugin will receive the event. |
6392 // In order to tell whether a plugin gets the last mouse event and which it | 6398 // In order to tell whether a plugin gets the last mouse event and which it |
6393 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets | 6399 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets |
6394 // the event, it will notify us via DidReceiveMouseEvent() and set itself as | 6400 // the event, it will notify us via DidReceiveMouseEvent() and set itself as |
6395 // |pepper_last_mouse_event_target_|. | 6401 // |pepper_last_mouse_event_target_|. |
6396 pepper_last_mouse_event_target_ = nullptr; | 6402 pepper_last_mouse_event_target_ = nullptr; |
6397 #endif | 6403 #endif |
6398 } | 6404 } |
6399 | 6405 |
6400 } // namespace content | 6406 } // namespace content |
OLD | NEW |