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