summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorxhwang <xhwang@chromium.org>2015-07-15 15:18:42 -0700
committerCommit bot <commit-bot@chromium.org>2015-07-15 22:19:37 +0000
commit7a3607a7b77bb841b9013f2a553770e2e2d00f66 (patch)
treec58367dfc00638c7e4a1569caf49c0671533c790
parent75540a59248efeb382e515971b762c17592a6ada (diff)
downloadchromium_src-7a3607a7b77bb841b9013f2a553770e2e2d00f66.zip
chromium_src-7a3607a7b77bb841b9013f2a553770e2e2d00f66.tar.gz
chromium_src-7a3607a7b77bb841b9013f2a553770e2e2d00f66.tar.bz2
media: Add trace event for pepper plugin (CDM) loading time.
BUG=510234 TEST=Maually tested. R=ddorwin@chromium.org Review URL: https://codereview.chromium.org/1228733003 Cr-Commit-Position: refs/heads/master@{#338924}
-rw-r--r--content/ppapi_plugin/ppapi_thread.cc7
-rw-r--r--content/renderer/media/crypto/ppapi_decryptor.cc10
2 files changed, 14 insertions, 3 deletions
diff --git a/content/ppapi_plugin/ppapi_thread.cc b/content/ppapi_plugin/ppapi_thread.cc
index c5b2338..3b88a8e 100644
--- a/content/ppapi_plugin/ppapi_thread.cc
+++ b/content/ppapi_plugin/ppapi_thread.cc
@@ -19,6 +19,7 @@
#include "base/strings/utf_string_conversions.h"
#include "base/threading/platform_thread.h"
#include "base/time/time.h"
+#include "base/trace_event/trace_event.h"
#include "content/child/browser_font_resource_trusted.h"
#include "content/child/child_discardable_shared_memory_manager.h"
#include "content/child/child_process.h"
@@ -307,7 +308,11 @@ void PpapiThread::OnLoadPlugin(const base::FilePath& path,
if (plugin_entry_points_.initialize_module == NULL) {
// Load the plugin from the specified library.
base::NativeLibraryLoadError error;
- library.Reset(base::LoadNativeLibrary(path, &error));
+ {
+ TRACE_EVENT1("ppapi", "PpapiThread::LoadPlugin", "path",
+ path.MaybeAsASCII());
+ library.Reset(base::LoadNativeLibrary(path, &error));
+ }
if (!library.is_valid()) {
LOG(ERROR) << "Failed to load Pepper module from " << path.value()
<< " (error: " << error.ToString() << ")";
diff --git a/content/renderer/media/crypto/ppapi_decryptor.cc b/content/renderer/media/crypto/ppapi_decryptor.cc
index 099c7ae..4b35c99 100644
--- a/content/renderer/media/crypto/ppapi_decryptor.cc
+++ b/content/renderer/media/crypto/ppapi_decryptor.cc
@@ -11,6 +11,7 @@
#include "base/logging.h"
#include "base/single_thread_task_runner.h"
#include "base/thread_task_runner_handle.h"
+#include "base/trace_event/trace_event.h"
#include "content/renderer/pepper/content_decryptor_delegate.h"
#include "content/renderer/pepper/pepper_plugin_instance_impl.h"
#include "media/base/audio_decoder_config.h"
@@ -38,8 +39,13 @@ void PpapiDecryptor::Create(
const media::CdmCreatedCB& cdm_created_cb) {
std::string plugin_type = media::GetPepperType(key_system);
DCHECK(!plugin_type.empty());
- scoped_ptr<PepperCdmWrapper> pepper_cdm_wrapper =
- create_pepper_cdm_cb.Run(plugin_type, security_origin);
+
+ scoped_ptr<PepperCdmWrapper> pepper_cdm_wrapper;
+ {
+ TRACE_EVENT0("media", "PpapiDecryptor::CreatePepperCDM");
+ pepper_cdm_wrapper = create_pepper_cdm_cb.Run(plugin_type, security_origin);
+ }
+
if (!pepper_cdm_wrapper) {
std::string message =
"Unable to create the CDM for the key system " + key_system + ".";