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 64a24b9f979a557db2ea113a7a677b7be934522c..f85a51f3aaec899cc43635f2d2f458553c597f59 100644 |
--- a/components/nacl/renderer/ppb_nacl_private_impl.cc |
+++ b/components/nacl/renderer/ppb_nacl_private_impl.cc |
@@ -439,21 +439,11 @@ void LaunchSelLdr(PP_Instance instance, |
} |
} |
-// Forward declaration. |
-void ReportLoadError(PP_Instance instance, |
- PP_NaClError error, |
- const char* error_message, |
- const char* console_message); |
- |
PP_Bool StartPpapiProxy(PP_Instance instance) { |
- InstanceInfoMap& map = g_instance_info.Get(); |
- InstanceInfoMap::iterator it = map.find(instance); |
- if (it == map.end()) { |
- DLOG(ERROR) << "Could not find instance ID"; |
+ NexeLoadManager* load_manager = GetNexeLoadManager(instance); |
+ DCHECK(load_manager); |
+ if (!load_manager) |
return PP_FALSE; |
- } |
- InstanceInfo instance_info = it->second; |
- map.erase(it); |
content::PepperPluginInstance* plugin_instance = |
content::PepperPluginInstance::Get(instance); |
@@ -462,6 +452,15 @@ PP_Bool StartPpapiProxy(PP_Instance instance) { |
return PP_FALSE; |
} |
+ InstanceInfoMap& map = g_instance_info.Get(); |
+ InstanceInfoMap::iterator it = map.find(instance); |
+ if (it == map.end()) { |
+ DLOG(ERROR) << "Could not find instance ID"; |
+ return PP_FALSE; |
+ } |
+ InstanceInfo instance_info = it->second; |
+ map.erase(it); |
+ |
PP_ExternalPluginResult result = plugin_instance->SwitchToOutOfProcessProxy( |
base::FilePath().AppendASCII(instance_info.url.spec()), |
instance_info.permissions, |
@@ -473,20 +472,14 @@ PP_Bool StartPpapiProxy(PP_Instance instance) { |
// Log the amound of time that has passed between the trusted plugin being |
dmichael (off chromium)
2014/06/05 19:06:54
unrelated nit: amound->amount
|
// initialized and the untrusted plugin being initialized. This is |
// (roughly) the cost of using NaCl, in terms of startup time. |
- NexeLoadManager* load_manager = GetNexeLoadManager(instance); |
- if (load_manager) |
- load_manager->ReportStartupOverhead(); |
+ load_manager->ReportStartupOverhead(); |
return PP_TRUE; |
} else if (result == PP_EXTERNAL_PLUGIN_ERROR_MODULE) { |
- ReportLoadError(instance, |
- PP_NACL_ERROR_START_PROXY_MODULE, |
- "could not initialize module.", |
- "could not initialize module."); |
+ load_manager->ReportLoadError(PP_NACL_ERROR_START_PROXY_MODULE, |
+ "could not initialize module."); |
} else if (result == PP_EXTERNAL_PLUGIN_ERROR_INSTANCE) { |
- ReportLoadError(instance, |
- PP_NACL_ERROR_START_PROXY_MODULE, |
- "could not create instance.", |
- "could not create instance."); |
+ load_manager->ReportLoadError(PP_NACL_ERROR_START_PROXY_MODULE, |
+ "could not create instance."); |
} |
return PP_FALSE; |
} |
@@ -725,11 +718,10 @@ void ReportLoadSuccess(PP_Instance instance, |
void ReportLoadError(PP_Instance instance, |
PP_NaClError error, |
- const char* error_message, |
- const char* console_message) { |
+ const char* error_message) { |
NexeLoadManager* load_manager = GetNexeLoadManager(instance); |
if (load_manager) |
- load_manager->ReportLoadError(error, error_message, console_message); |
+ load_manager->ReportLoadError(error, error_message); |
} |
void ReportLoadAbort(PP_Instance instance) { |