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

Side by Side Diff: content/ppapi_plugin/ppapi_thread.cc

Issue 9447084: Refactor Pickle Read methods to use higher performance PickleIterator. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: compile (racing with incoming CLs) Created 8 years, 9 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
« no previous file with comments | « content/common/ssl_status_serialization.cc ('k') | content/public/common/common_param_traits.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) 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/ppapi_plugin/ppapi_thread.h" 5 #include "content/ppapi_plugin/ppapi_thread.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/process_util.h" 10 #include "base/process_util.h"
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 if (!get_plugin_interface_) 249 if (!get_plugin_interface_)
250 return; 250 return;
251 const PPP_NetworkState_Dev* ns = static_cast<const PPP_NetworkState_Dev*>( 251 const PPP_NetworkState_Dev* ns = static_cast<const PPP_NetworkState_Dev*>(
252 get_plugin_interface_(PPP_NETWORK_STATE_DEV_INTERFACE)); 252 get_plugin_interface_(PPP_NETWORK_STATE_DEV_INTERFACE));
253 if (ns) 253 if (ns)
254 ns->SetOnLine(PP_FromBool(online)); 254 ns->SetOnLine(PP_FromBool(online));
255 } 255 }
256 256
257 void PpapiThread::OnPluginDispatcherMessageReceived(const IPC::Message& msg) { 257 void PpapiThread::OnPluginDispatcherMessageReceived(const IPC::Message& msg) {
258 // The first parameter should be a plugin dispatcher ID. 258 // The first parameter should be a plugin dispatcher ID.
259 void* iter = NULL; 259 PickleIterator iter(msg);
260 uint32 id = 0; 260 uint32 id = 0;
261 if (!msg.ReadUInt32(&iter, &id)) { 261 if (!msg.ReadUInt32(&iter, &id)) {
262 NOTREACHED(); 262 NOTREACHED();
263 return; 263 return;
264 } 264 }
265 std::map<uint32, ppapi::proxy::PluginDispatcher*>::iterator dispatcher = 265 std::map<uint32, ppapi::proxy::PluginDispatcher*>::iterator dispatcher =
266 plugin_dispatchers_.find(id); 266 plugin_dispatchers_.find(id);
267 if (dispatcher != plugin_dispatchers_.end()) 267 if (dispatcher != plugin_dispatchers_.end())
268 dispatcher->second->OnMessageReceived(msg); 268 dispatcher->second->OnMessageReceived(msg);
269 } 269 }
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 313
314 // From here, the dispatcher will manage its own lifetime according to the 314 // From here, the dispatcher will manage its own lifetime according to the
315 // lifetime of the attached channel. 315 // lifetime of the attached channel.
316 return true; 316 return true;
317 } 317 }
318 318
319 void PpapiThread::SavePluginName(const FilePath& path) { 319 void PpapiThread::SavePluginName(const FilePath& path) {
320 ppapi::proxy::PluginGlobals::Get()->set_plugin_name( 320 ppapi::proxy::PluginGlobals::Get()->set_plugin_name(
321 path.BaseName().AsUTF8Unsafe()); 321 path.BaseName().AsUTF8Unsafe());
322 } 322 }
OLDNEW
« no previous file with comments | « content/common/ssl_status_serialization.cc ('k') | content/public/common/common_param_traits.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698