Index: ppapi/native_client/src/trusted/plugin/service_runtime.cc |
diff --git a/ppapi/native_client/src/trusted/plugin/service_runtime.cc b/ppapi/native_client/src/trusted/plugin/service_runtime.cc |
index 3ea07ee48ac183fb331a44d3fd51c2867684e153..9ea98167e40c2d57c55a5e4181dc04c11e421b3c 100644 |
--- a/ppapi/native_client/src/trusted/plugin/service_runtime.cc |
+++ b/ppapi/native_client/src/trusted/plugin/service_runtime.cc |
@@ -44,6 +44,7 @@ |
#include "native_client/src/trusted/plugin/plugin.h" |
#include "native_client/src/trusted/plugin/plugin_error.h" |
#include "native_client/src/trusted/plugin/pnacl_coordinator.h" |
+#include "native_client/src/trusted/plugin/pnacl_resources.h" |
#include "native_client/src/trusted/plugin/sel_ldr_launcher_chrome.h" |
#include "native_client/src/trusted/plugin/srpc_client.h" |
#include "native_client/src/trusted/plugin/utility.h" |
@@ -280,21 +281,45 @@ void PluginReverseInterface::OpenManifestEntry_MainThreadContinuation( |
this, |
&PluginReverseInterface::StreamAsFile_MainThreadContinuation, |
open_cont); |
- if (!plugin_->StreamAsFile(mapped_url, |
- stream_cc.pp_completion_callback())) { |
+ // |
+ if (!PnaclUrls::IsPnaclComponent(mapped_url)) { |
+ if (!plugin_->StreamAsFile(mapped_url, |
+ stream_cc.pp_completion_callback())) { |
+ NaClLog(4, |
+ "OpenManifestEntry_MainThreadContinuation: " |
+ "StreamAsFile failed\n"); |
+ nacl::MutexLocker take(&mu_); |
+ *p->op_complete_ptr = true; // done... |
+ *p->out_desc = -1; // but failed. |
+ p->error_info->SetReport(ERROR_MANIFEST_OPEN, |
+ "ServiceRuntime: StreamAsFile failed"); |
+ NaClXCondVarBroadcast(&cv_); |
robertm
2012/08/08 21:51:11
add comment for what is being woken up here
jvoung - send to chromium...
2012/08/08 22:47:04
There's a bunch of these Broadcasts all over the f
|
+ return; |
+ } |
NaClLog(4, |
- "OpenManifestEntry_MainThreadContinuation: " |
- "StreamAsFile failed\n"); |
+ "OpenManifestEntry_MainThreadContinuation: StreamAsFile okay\n"); |
+ } else { |
+ int32_t fd = PnaclResources::GetPnaclFD( |
+ plugin_, |
+ PnaclUrls::StripPnaclComponentPrefix(mapped_url).c_str()); |
+ if (fd < 0) { |
+ // We should check earlier if the pnacl component wasn't installed |
+ // yet. At this point, we can't do much anymore, so just continue |
+ // with an invalid fd. |
+ NaClLog(4, |
+ "OpenManifestEntry_MainThreadContinuation: " |
+ "GetReadonlyPnaclFd failed\n"); |
+ // TODO(jvoung): Separate the error codes? |
+ p->error_info->SetReport(ERROR_MANIFEST_OPEN, |
+ "ServiceRuntime: GetPnaclFd failed"); |
+ } |
nacl::MutexLocker take(&mu_); |
- *p->op_complete_ptr = true; // done... |
- *p->out_desc = -1; // but failed. |
- p->error_info->SetReport(ERROR_MANIFEST_OPEN, |
- "ServiceRuntime: StreamAsFile failed"); |
+ *p->op_complete_ptr = true; // done! |
+ *p->out_desc = fd; |
NaClXCondVarBroadcast(&cv_); |
robertm
2012/08/08 21:51:11
dito
jvoung - send to chromium...
2012/08/08 22:47:04
Done.
|
- return; |
+ NaClLog(4, |
+ "OpenManifestEntry_MainThreadContinuation: GetPnaclFd okay\n"); |
} |
- NaClLog(4, |
- "OpenManifestEntry_MainThreadContinuation: StreamAsFile okay\n"); |
} else { |
NaClLog(4, |
"OpenManifestEntry_MainThreadContinuation: " |