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

Side by Side Diff: content/renderer/pepper/pepper_in_process_router.cc

Issue 19704009: Pepper: Add routing ID information to Connection. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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 | Annotate | Revision Log
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/pepper/pepper_in_process_router.h" 5 #include "content/renderer/pepper/pepper_in_process_router.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "content/renderer/pepper/renderer_ppapi_host_impl.h" 9 #include "content/renderer/pepper/renderer_ppapi_host_impl.h"
10 #include "ipc/ipc_message.h" 10 #include "ipc/ipc_message.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 } 51 }
52 52
53 IPC::Sender* PepperInProcessRouter::GetPluginToRendererSender() { 53 IPC::Sender* PepperInProcessRouter::GetPluginToRendererSender() {
54 return plugin_to_host_router_.get(); 54 return plugin_to_host_router_.get();
55 } 55 }
56 56
57 IPC::Sender* PepperInProcessRouter::GetRendererToPluginSender() { 57 IPC::Sender* PepperInProcessRouter::GetRendererToPluginSender() {
58 return host_to_plugin_router_.get(); 58 return host_to_plugin_router_.get();
59 } 59 }
60 60
61 ppapi::proxy::Connection PepperInProcessRouter::GetPluginConnection() { 61 ppapi::proxy::Connection PepperInProcessRouter::GetPluginConnection(
62 PP_Instance instance) {
yzshen1 2013/07/23 17:44:01 GetRoutingIDForWidget() doesn't always return the
teravest 2013/07/23 17:59:51 Changed to get the routing ID from the render view
63 int routing_id = host_impl_->GetRoutingIDForWidget(instance);
62 return ppapi::proxy::Connection(dummy_browser_channel_.get(), 64 return ppapi::proxy::Connection(dummy_browser_channel_.get(),
63 plugin_to_host_router_.get()); 65 plugin_to_host_router_.get(),
66 routing_id);
64 } 67 }
65 68
66 bool PepperInProcessRouter::SendToHost(IPC::Message* msg) { 69 bool PepperInProcessRouter::SendToHost(IPC::Message* msg) {
67 scoped_ptr<IPC::Message> message(msg); 70 scoped_ptr<IPC::Message> message(msg);
68 71
69 if (!message->is_sync()) { 72 if (!message->is_sync()) {
70 bool result = host_impl_->GetPpapiHost()->OnMessageReceived(*message); 73 bool result = host_impl_->GetPpapiHost()->OnMessageReceived(*message);
71 DCHECK(result) << "The message was not handled by the host."; 74 DCHECK(result) << "The message was not handled by the host.";
72 return true; 75 return true;
73 } 76 }
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 reply_params.pp_resource()); 130 reply_params.pp_resource());
128 if (!resource) { 131 if (!resource) {
129 // The resource could have been destroyed while the async processing was 132 // The resource could have been destroyed while the async processing was
130 // pending. Just drop the message. 133 // pending. Just drop the message.
131 return; 134 return;
132 } 135 }
133 resource->OnReplyReceived(reply_params, nested_msg); 136 resource->OnReplyReceived(reply_params, nested_msg);
134 } 137 }
135 138
136 } // namespace content 139 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698