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

Unified Diff: ppapi/native_client/src/trusted/plugin/plugin.cc

Issue 10665036: Cache Nacl Plugin private interface instead of calling GetnaclInterface on every process launch (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review comments Created 8 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 | « ppapi/native_client/src/trusted/plugin/plugin.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/native_client/src/trusted/plugin/plugin.cc
diff --git a/ppapi/native_client/src/trusted/plugin/plugin.cc b/ppapi/native_client/src/trusted/plugin/plugin.cc
index 856b31de7c94fd528465f0949b8153ee1274b1f9..8a88489b0517fedc99ba8b57fdc05b4ca07e83bb 100644
--- a/ppapi/native_client/src/trusted/plugin/plugin.cc
+++ b/ppapi/native_client/src/trusted/plugin/plugin.cc
@@ -122,7 +122,7 @@ const int64_t kSizeKBMin = 1;
const int64_t kSizeKBMax = 512*1024; // very large .nexe
const uint32_t kSizeKBBuckets = 100;
-const PPB_NaCl_Private* GetNaclInterface() {
+const PPB_NaCl_Private* GetNaClInterface() {
jvoung (off chromium) 2012/06/25 22:42:29 Is there really a reason to still have this helper
Derek Schuff 2012/06/25 22:49:07 I don't know if it's the preferred way, exactly. C
pp::Module *module = pp::Module::Get();
CHECK(module);
return static_cast<const PPB_NaCl_Private*>(
@@ -622,8 +622,7 @@ bool Plugin::LoadNaClModuleCommon(nacl::DescWrapper* wrapper,
}
// Try to start the Chrome IPC-based proxy.
- const PPB_NaCl_Private* ppb_nacl = GetNaclInterface();
- if (ppb_nacl->StartPpapiProxy(pp_instance())) {
+ if (nacl_interface_->StartPpapiProxy(pp_instance())) {
using_ipc_proxy_ = true;
// We need to explicitly schedule this here. It is normally called in
// response to starting the SRPC proxy.
@@ -890,11 +889,14 @@ Plugin::Plugin(PP_Instance pp_instance)
ready_time_(0),
nexe_size_(0),
time_of_last_progress_event_(0),
- using_ipc_proxy_(false) {
+ using_ipc_proxy_(false),
+ nacl_interface_(NULL) {
PLUGIN_PRINTF(("Plugin::Plugin (this=%p, pp_instance=%"
NACL_PRId32")\n", static_cast<void*>(this), pp_instance));
callback_factory_.Initialize(this);
nexe_downloader_.Initialize(this);
+ nacl_interface_ = GetNaClInterface();
+ CHECK(nacl_interface_ != NULL);
dmichael (off chromium) 2012/06/25 22:42:34 nit: In chromium, I'm used to just seeing/writing
Derek Schuff 2012/06/25 22:49:07 all the CHECKs in this particular file seem to use
}
« no previous file with comments | « ppapi/native_client/src/trusted/plugin/plugin.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698