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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <limits> | 9 #include <limits> |
10 | 10 |
(...skipping 18 matching lines...) Expand all Loading... |
29 #include "content/child/child_process.h" | 29 #include "content/child/child_process.h" |
30 #include "content/common/child_process_messages.h" | 30 #include "content/common/child_process_messages.h" |
31 #include "content/common/sandbox_util.h" | 31 #include "content/common/sandbox_util.h" |
32 #include "content/ppapi_plugin/broker_process_dispatcher.h" | 32 #include "content/ppapi_plugin/broker_process_dispatcher.h" |
33 #include "content/ppapi_plugin/plugin_process_dispatcher.h" | 33 #include "content/ppapi_plugin/plugin_process_dispatcher.h" |
34 #include "content/ppapi_plugin/ppapi_blink_platform_impl.h" | 34 #include "content/ppapi_plugin/ppapi_blink_platform_impl.h" |
35 #include "content/public/common/content_client.h" | 35 #include "content/public/common/content_client.h" |
36 #include "content/public/common/content_switches.h" | 36 #include "content/public/common/content_switches.h" |
37 #include "content/public/common/pepper_plugin_info.h" | 37 #include "content/public/common/pepper_plugin_info.h" |
38 #include "content/public/common/sandbox_init.h" | 38 #include "content/public/common/sandbox_init.h" |
39 #include "content/public/plugin/content_plugin_client.h" | |
40 #include "ipc/ipc_channel_handle.h" | 39 #include "ipc/ipc_channel_handle.h" |
41 #include "ipc/ipc_platform_file.h" | 40 #include "ipc/ipc_platform_file.h" |
42 #include "ipc/ipc_sync_channel.h" | 41 #include "ipc/ipc_sync_channel.h" |
43 #include "ipc/ipc_sync_message_filter.h" | 42 #include "ipc/ipc_sync_message_filter.h" |
44 #include "ppapi/c/dev/ppp_network_state_dev.h" | 43 #include "ppapi/c/dev/ppp_network_state_dev.h" |
45 #include "ppapi/c/pp_errors.h" | 44 #include "ppapi/c/pp_errors.h" |
46 #include "ppapi/c/ppp.h" | 45 #include "ppapi/c/ppp.h" |
47 #include "ppapi/proxy/interface_list.h" | 46 #include "ppapi/proxy/interface_list.h" |
48 #include "ppapi/proxy/plugin_globals.h" | 47 #include "ppapi/proxy/plugin_globals.h" |
49 #include "ppapi/proxy/plugin_message_filter.h" | 48 #include "ppapi/proxy/plugin_message_filter.h" |
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
543 #endif | 542 #endif |
544 | 543 |
545 // From here, the dispatcher will manage its own lifetime according to the | 544 // From here, the dispatcher will manage its own lifetime according to the |
546 // lifetime of the attached channel. | 545 // lifetime of the attached channel. |
547 return true; | 546 return true; |
548 } | 547 } |
549 | 548 |
550 void PpapiThread::SavePluginName(const base::FilePath& path) { | 549 void PpapiThread::SavePluginName(const base::FilePath& path) { |
551 ppapi::proxy::PluginGlobals::Get()->set_plugin_name( | 550 ppapi::proxy::PluginGlobals::Get()->set_plugin_name( |
552 path.BaseName().AsUTF8Unsafe()); | 551 path.BaseName().AsUTF8Unsafe()); |
553 | |
554 // plugin() is NULL when in-process, which is fine, because this is | |
555 // just a hook for setting the process name. | |
556 if (GetContentClient()->plugin()) { | |
557 GetContentClient()->plugin()->PluginProcessStarted( | |
558 path.BaseName().RemoveExtension().LossyDisplayName()); | |
559 } | |
560 } | 552 } |
561 | 553 |
562 static std::string GetHistogramName(bool is_broker, | 554 static std::string GetHistogramName(bool is_broker, |
563 const std::string& metric_name, | 555 const std::string& metric_name, |
564 const base::FilePath& path) { | 556 const base::FilePath& path) { |
565 return std::string("Plugin.Ppapi") + (is_broker ? "Broker" : "Plugin") + | 557 return std::string("Plugin.Ppapi") + (is_broker ? "Broker" : "Plugin") + |
566 metric_name + "_" + path.BaseName().MaybeAsASCII(); | 558 metric_name + "_" + path.BaseName().MaybeAsASCII(); |
567 } | 559 } |
568 | 560 |
569 void PpapiThread::ReportLoadResult(const base::FilePath& path, | 561 void PpapiThread::ReportLoadResult(const base::FilePath& path, |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
603 GetHistogramName(is_broker_, "LoadTime", path), | 595 GetHistogramName(is_broker_, "LoadTime", path), |
604 base::TimeDelta::FromMilliseconds(1), | 596 base::TimeDelta::FromMilliseconds(1), |
605 base::TimeDelta::FromSeconds(10), | 597 base::TimeDelta::FromSeconds(10), |
606 50, | 598 50, |
607 base::HistogramBase::kUmaTargetedHistogramFlag); | 599 base::HistogramBase::kUmaTargetedHistogramFlag); |
608 | 600 |
609 histogram->AddTime(load_time); | 601 histogram->AddTime(load_time); |
610 } | 602 } |
611 | 603 |
612 } // namespace content | 604 } // namespace content |
OLD | NEW |