Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(931)

Unified Diff: components/nacl/renderer/ppb_nacl_private_impl.cc

Issue 356923002: Pepper: Move Pnacl init time out of trusted plugin. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/nacl/renderer/nexe_load_manager.h ('k') | ppapi/api/private/ppb_nacl_private.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/nacl/renderer/ppb_nacl_private_impl.cc
diff --git a/components/nacl/renderer/ppb_nacl_private_impl.cc b/components/nacl/renderer/ppb_nacl_private_impl.cc
index 9d7ebbcf8c2631bfecd749dbcac720598c633db0..5c52e63701f14d877f324a3cdf73aa387da7d497 100644
--- a/components/nacl/renderer/ppb_nacl_private_impl.cc
+++ b/components/nacl/renderer/ppb_nacl_private_impl.cc
@@ -659,8 +659,7 @@ void ReportTranslationFinished(PP_Instance instance,
PP_Bool success,
int32_t opt_level,
int64_t pexe_size,
- int64_t compile_time_us,
- int64_t total_time_us) {
+ int64_t compile_time_us) {
if (success == PP_TRUE) {
static const int32_t kUnknownOptLevel = 4;
if (opt_level < 0 || opt_level > 3)
@@ -673,11 +672,16 @@ void ReportTranslationFinished(PP_Instance instance,
compile_time_us);
HistogramSizeKB("NaCl.Perf.Size.Pexe", pexe_size / 1024);
- HistogramTimeTranslation("NaCl.Perf.PNaClLoadTime.TotalUncachedTime",
- total_time_us / 1000);
- HistogramKBPerSec("NaCl.Perf.PNaClLoadTime.TotalUncachedKBPerSec",
- pexe_size / 1024,
- total_time_us);
+ NexeLoadManager* load_manager = GetNexeLoadManager(instance);
+ if (load_manager) {
+ base::TimeDelta total_time = base::Time::Now() -
+ load_manager->pnacl_start_time();
+ HistogramTimeTranslation("NaCl.Perf.PNaClLoadTime.TotalUncachedTime",
+ total_time.InMilliseconds());
+ HistogramKBPerSec("NaCl.Perf.PNaClLoadTime.TotalUncachedKBPerSec",
+ pexe_size / 1024,
+ total_time.InMicroseconds());
+ }
}
// If the resource host isn't initialized, don't try to do that here.
@@ -1585,6 +1589,12 @@ void OpenManifestEntry(PP_Instance instance,
base::Bind(&DidOpenManifestEntry, out_file_info, callback));
}
+void SetPNaClStartTime(PP_Instance instance) {
+ NexeLoadManager* load_manager = GetNexeLoadManager(instance);
+ if (load_manager)
+ load_manager->set_pnacl_start_time(base::Time::Now());
+}
+
const PPB_NaCl_Private nacl_interface = {
&LaunchSelLdr,
&StartPpapiProxy,
@@ -1624,7 +1634,8 @@ const PPB_NaCl_Private nacl_interface = {
&DownloadNexe,
&ReportSelLdrStatus,
&LogTranslateTime,
- &OpenManifestEntry
+ &OpenManifestEntry,
+ &SetPNaClStartTime
};
} // namespace
« no previous file with comments | « components/nacl/renderer/nexe_load_manager.h ('k') | ppapi/api/private/ppb_nacl_private.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698