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" |
11 #include "base/rand_util.h" | 11 #include "base/rand_util.h" |
12 #include "base/stringprintf.h" | 12 #include "base/stringprintf.h" |
13 #include "base/utf_string_conversions.h" | 13 #include "base/utf_string_conversions.h" |
14 #include "content/common/child_process.h" | 14 #include "content/common/child_process.h" |
15 #include "content/common/child_process_messages.h" | 15 #include "content/common/child_process_messages.h" |
16 #include "content/ppapi_plugin/broker_process_dispatcher.h" | 16 #include "content/ppapi_plugin/broker_process_dispatcher.h" |
17 #include "content/ppapi_plugin/plugin_process_dispatcher.h" | 17 #include "content/ppapi_plugin/plugin_process_dispatcher.h" |
18 #include "content/ppapi_plugin/ppapi_webkitplatformsupport_impl.h" | 18 #include "content/ppapi_plugin/ppapi_webkitplatformsupport_impl.h" |
19 #include "content/public/common/sandbox_init.h" | 19 #include "content/public/common/sandbox_init.h" |
| 20 #include "content/public/plugin/content_plugin_client.h" |
20 #include "ipc/ipc_channel_handle.h" | 21 #include "ipc/ipc_channel_handle.h" |
21 #include "ipc/ipc_platform_file.h" | 22 #include "ipc/ipc_platform_file.h" |
22 #include "ipc/ipc_sync_channel.h" | 23 #include "ipc/ipc_sync_channel.h" |
23 #include "ipc/ipc_sync_message_filter.h" | 24 #include "ipc/ipc_sync_message_filter.h" |
24 #include "ppapi/c/dev/ppp_network_state_dev.h" | 25 #include "ppapi/c/dev/ppp_network_state_dev.h" |
25 #include "ppapi/c/pp_errors.h" | 26 #include "ppapi/c/pp_errors.h" |
26 #include "ppapi/c/ppp.h" | 27 #include "ppapi/c/ppp.h" |
27 #include "ppapi/proxy/plugin_globals.h" | 28 #include "ppapi/proxy/plugin_globals.h" |
28 #include "ppapi/proxy/ppapi_messages.h" | 29 #include "ppapi/proxy/ppapi_messages.h" |
29 #include "ppapi/proxy/interface_list.h" | 30 #include "ppapi/proxy/interface_list.h" |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 #endif | 361 #endif |
361 | 362 |
362 // From here, the dispatcher will manage its own lifetime according to the | 363 // From here, the dispatcher will manage its own lifetime according to the |
363 // lifetime of the attached channel. | 364 // lifetime of the attached channel. |
364 return true; | 365 return true; |
365 } | 366 } |
366 | 367 |
367 void PpapiThread::SavePluginName(const FilePath& path) { | 368 void PpapiThread::SavePluginName(const FilePath& path) { |
368 ppapi::proxy::PluginGlobals::Get()->set_plugin_name( | 369 ppapi::proxy::PluginGlobals::Get()->set_plugin_name( |
369 path.BaseName().AsUTF8Unsafe()); | 370 path.BaseName().AsUTF8Unsafe()); |
| 371 |
| 372 // plugin() is NULL when in-process. Which is fine, because this is |
| 373 // just a hook for setting the process name. |
| 374 if (content::GetContentClient()->plugin()) { |
| 375 content::GetContentClient()->plugin()->PluginProcessStarted( |
| 376 path.BaseName().RemoveExtension().LossyDisplayName()); |
| 377 } |
370 } | 378 } |
OLD | NEW |