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
|
} |