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/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 Loading... |
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 Loading... |
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 } |
OLD | NEW |