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

Side by Side Diff: ppapi/proxy/plugin_message_filter.cc

Issue 563073002: Pepper UDP socket: buffer received packets in the plugin process to improve performance. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | « ppapi/host/resource_message_filter.h ('k') | ppapi/proxy/ppapi_messages.h » ('j') | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "ppapi/proxy/plugin_message_filter.h" 5 #include "ppapi/proxy/plugin_message_filter.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "ipc/ipc_channel.h" 9 #include "ipc/ipc_channel.h"
10 #include "ppapi/proxy/ppapi_messages.h" 10 #include "ppapi/proxy/ppapi_messages.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 // This instance ID is new so we can return that it's usable and mark it as 76 // This instance ID is new so we can return that it's usable and mark it as
77 // used for future reference. 77 // used for future reference.
78 seen_instance_ids_->insert(instance); 78 seen_instance_ids_->insert(instance);
79 *usable = true; 79 *usable = true;
80 } 80 }
81 81
82 void PluginMessageFilter::OnMsgResourceReply( 82 void PluginMessageFilter::OnMsgResourceReply(
83 const ResourceMessageReplyParams& reply_params, 83 const ResourceMessageReplyParams& reply_params,
84 const IPC::Message& nested_msg) { 84 const IPC::Message& nested_msg) {
85 scoped_refptr<base::MessageLoopProxy> target = 85 scoped_refptr<base::MessageLoopProxy> target =
86 resource_reply_thread_registrar_->GetTargetThreadAndUnregister( 86 resource_reply_thread_registrar_->GetTargetThread(reply_params,
87 reply_params.pp_resource(), reply_params.sequence()); 87 nested_msg);
88 88
89 target->PostTask( 89 if (!target.get()) {
90 FROM_HERE, 90 DispatchResourceReply(reply_params, nested_msg);
91 base::Bind(&DispatchResourceReply, reply_params, nested_msg)); 91 } else {
92 target->PostTask(
93 FROM_HERE,
94 base::Bind(&DispatchResourceReply, reply_params, nested_msg));
95 }
92 } 96 }
93 97
94 // static 98 // static
95 void PluginMessageFilter::DispatchResourceReply( 99 void PluginMessageFilter::DispatchResourceReply(
96 const ResourceMessageReplyParams& reply_params, 100 const ResourceMessageReplyParams& reply_params,
97 const IPC::Message& nested_msg) { 101 const IPC::Message& nested_msg) {
98 ProxyAutoLock lock; 102 ProxyAutoLock lock;
99 Resource* resource = PpapiGlobals::Get()->GetResourceTracker()->GetResource( 103 Resource* resource = PpapiGlobals::Get()->GetResourceTracker()->GetResource(
100 reply_params.pp_resource()); 104 reply_params.pp_resource());
101 if (!resource) { 105 if (!resource) {
102 DVLOG_IF(1, reply_params.sequence() != 0) 106 DVLOG_IF(1, reply_params.sequence() != 0)
103 << "Pepper resource reply message received but the resource doesn't " 107 << "Pepper resource reply message received but the resource doesn't "
104 "exist (probably has been destroyed)."; 108 "exist (probably has been destroyed).";
105 return; 109 return;
106 } 110 }
107 resource->OnReplyReceived(reply_params, nested_msg); 111 resource->OnReplyReceived(reply_params, nested_msg);
108 } 112 }
109 113
110 } // namespace proxy 114 } // namespace proxy
111 } // namespace ppapi 115 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/host/resource_message_filter.h ('k') | ppapi/proxy/ppapi_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698