OLD | NEW |
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 "base/metrics/histogram.h" |
5 #include "chrome/plugin/chrome_content_plugin_client.h" | 6 #include "chrome/plugin/chrome_content_plugin_client.h" |
| 7 #include "third_party/widevine/cdm/widevine_cdm_common.h" |
6 | 8 |
7 #if defined(ENABLE_REMOTING) | 9 #if defined(ENABLE_REMOTING) |
8 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
9 #include "base/path_service.h" | 11 #include "base/path_service.h" |
10 #include "content/public/common/content_paths.h" | 12 #include "content/public/common/content_paths.h" |
11 #include "media/base/media.h" | 13 #include "media/base/media.h" |
12 #if defined(OS_WIN) | 14 #if defined(OS_WIN) |
13 #include "base/logging.h" | 15 #include "base/logging.h" |
14 #include "base/native_library.h" | 16 #include "base/native_library.h" |
15 #elif defined(OS_POSIX) && !defined(OS_MACOSX) && defined(USE_NSS) | 17 #elif defined(OS_POSIX) && !defined(OS_MACOSX) && defined(USE_NSS) |
16 #include "crypto/nss_util.h" | 18 #include "crypto/nss_util.h" |
17 #endif | 19 #endif // defined(OS_WIN) |
18 #endif | 20 #endif // defined(ENABLE_REMOTING) |
19 | 21 |
20 #if defined(OS_MACOSX) | 22 #if defined(OS_MACOSX) |
21 #include "base/mac/mac_util.h" | 23 #include "base/mac/mac_util.h" |
22 #include "base/mac/scoped_cftyperef.h" | 24 #include "base/mac/scoped_cftyperef.h" |
23 #include "base/strings/sys_string_conversions.h" | 25 #include "base/strings/sys_string_conversions.h" |
24 #include "grit/chromium_strings.h" | 26 #include "grit/chromium_strings.h" |
25 #include "ui/base/l10n/l10n_util.h" | 27 #include "ui/base/l10n/l10n_util.h" |
26 #endif | 28 #endif // defined(OS_MACOSX) |
27 | 29 |
28 namespace chrome { | 30 namespace chrome { |
29 | 31 |
30 void ChromeContentPluginClient::PreSandboxInitialization() { | 32 void ChromeContentPluginClient::PreSandboxInitialization() { |
31 #if defined(ENABLE_REMOTING) | 33 #if defined(ENABLE_REMOTING) |
32 | 34 |
33 // Load crypto libraries for the Chromoting client plugin. | 35 // Load crypto libraries for the Chromoting client plugin. |
34 #if defined(OS_POSIX) && !defined(OS_MACOSX) && defined(USE_NSS) | 36 #if defined(OS_POSIX) && !defined(OS_MACOSX) && defined(USE_NSS) |
35 // On platforms where we use system NSS libraries, the .so's must be loaded | 37 // On platforms where we use system NSS libraries, the .so's must be loaded |
36 // before the sandbox is initialized. | 38 // before the sandbox is initialized. |
(...skipping 23 matching lines...) Expand all Loading... |
60 base::mac::ScopedCFTypeRef<CFStringRef> app_name( | 62 base::mac::ScopedCFTypeRef<CFStringRef> app_name( |
61 base::SysUTF16ToCFStringRef( | 63 base::SysUTF16ToCFStringRef( |
62 l10n_util::GetStringUTF16(IDS_SHORT_PLUGIN_APP_NAME))); | 64 l10n_util::GetStringUTF16(IDS_SHORT_PLUGIN_APP_NAME))); |
63 base::mac::ScopedCFTypeRef<CFStringRef> process_name( | 65 base::mac::ScopedCFTypeRef<CFStringRef> process_name( |
64 CFStringCreateWithFormat(kCFAllocatorDefault, NULL, CFSTR("%@ (%@)"), | 66 CFStringCreateWithFormat(kCFAllocatorDefault, NULL, CFSTR("%@ (%@)"), |
65 cf_plugin_name.get(), app_name.get())); | 67 cf_plugin_name.get(), app_name.get())); |
66 base::mac::SetProcessName(process_name); | 68 base::mac::SetProcessName(process_name); |
67 #endif | 69 #endif |
68 } | 70 } |
69 | 71 |
| 72 void ChromeContentPluginClient::PluginLoaded(const base::FilePath& plugin_path, |
| 73 PluginLoadStatus status) { |
| 74 base::FilePath::StringType plugin_name = plugin_path.BaseName().value(); |
| 75 // TODO(xhwang): Add UMA reporting for more ppapi plugins. |
| 76 if (plugin_name == kWidevineCdmPluginFileName) { |
| 77 UMA_HISTOGRAM_ENUMERATION("Plugin.LoadStatus.Widevine", status, |
| 78 ContentPluginClient::LOAD_STATUS_MAX); |
| 79 } |
| 80 } |
| 81 |
70 } // namespace chrome | 82 } // namespace chrome |
OLD | NEW |