Chromium Code Reviews| OLD | NEW |
|---|---|
| 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/browser_plugin/browser_plugin_manager_impl.h" | 5 #include "content/renderer/browser_plugin/browser_plugin_manager_impl.h" |
| 6 | 6 |
| 7 #include "content/common/browser_plugin/browser_plugin_constants.h" | 7 #include "content/common/browser_plugin/browser_plugin_constants.h" |
| 8 #include "content/common/browser_plugin/browser_plugin_messages.h" | 8 #include "content/common/browser_plugin/browser_plugin_messages.h" |
| 9 #include "content/common/cursors/webcursor.h" | 9 #include "content/common/cursors/webcursor.h" |
| 10 #include "content/renderer/browser_plugin/browser_plugin.h" | 10 #include "content/renderer/browser_plugin/browser_plugin.h" |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 28 bool auto_navigate) { | 28 bool auto_navigate) { |
| 29 return new BrowserPlugin(render_view, frame, auto_navigate); | 29 return new BrowserPlugin(render_view, frame, auto_navigate); |
| 30 } | 30 } |
| 31 | 31 |
| 32 void BrowserPluginManagerImpl::AllocateInstanceID( | 32 void BrowserPluginManagerImpl::AllocateInstanceID( |
| 33 const base::WeakPtr<BrowserPlugin>& browser_plugin) { | 33 const base::WeakPtr<BrowserPlugin>& browser_plugin) { |
| 34 int request_id = ++request_id_counter_; | 34 int request_id = ++request_id_counter_; |
| 35 pending_allocate_guest_instance_id_requests_.insert( | 35 pending_allocate_guest_instance_id_requests_.insert( |
| 36 std::make_pair(request_id, browser_plugin)); | 36 std::make_pair(request_id, browser_plugin)); |
| 37 Send(new BrowserPluginHostMsg_AllocateInstanceID( | 37 Send(new BrowserPluginHostMsg_AllocateInstanceID( |
| 38 browser_plugin->render_view_routing_id(), request_id)); | 38 browser_plugin->render_view_routing_id(), request_id)); |
|
jam
2014/05/02 22:24:47
it's still here?
Fady Samuel
2014/05/03 00:16:59
Weird. Fixed.
| |
| 39 } | 39 } |
| 40 | 40 |
| 41 bool BrowserPluginManagerImpl::Send(IPC::Message* msg) { | 41 bool BrowserPluginManagerImpl::Send(IPC::Message* msg) { |
| 42 return RenderThread::Get()->Send(msg); | 42 return RenderThread::Get()->Send(msg); |
| 43 } | 43 } |
| 44 | 44 |
| 45 bool BrowserPluginManagerImpl::OnMessageReceived( | 45 bool BrowserPluginManagerImpl::OnMessageReceived( |
| 46 const IPC::Message& message) { | 46 const IPC::Message& message) { |
| 47 if (BrowserPlugin::ShouldForwardToBrowserPlugin(message)) { | 47 if (BrowserPlugin::ShouldForwardToBrowserPlugin(message)) { |
| 48 int guest_instance_id = browser_plugin::kInstanceIDNone; | 48 int guest_instance_id = browser_plugin::kInstanceIDNone; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 83 return; | 83 return; |
| 84 | 84 |
| 85 const base::WeakPtr<BrowserPlugin> plugin(it->second); | 85 const base::WeakPtr<BrowserPlugin> plugin(it->second); |
| 86 if (!plugin) | 86 if (!plugin) |
| 87 return; | 87 return; |
| 88 pending_allocate_guest_instance_id_requests_.erase(request_id); | 88 pending_allocate_guest_instance_id_requests_.erase(request_id); |
| 89 plugin->OnInstanceIDAllocated(guest_instance_id); | 89 plugin->OnInstanceIDAllocated(guest_instance_id); |
| 90 } | 90 } |
| 91 | 91 |
| 92 } // namespace content | 92 } // namespace content |
| OLD | NEW |