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

Unified Diff: ppapi/nacl_irt/manifest_service.cc

Issue 418423002: Pepper: Stop using SRPC for irt_open_resource(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixes for dmichael Created 6 years, 4 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
Index: ppapi/nacl_irt/manifest_service.cc
diff --git a/ppapi/nacl_irt/manifest_service.cc b/ppapi/nacl_irt/manifest_service.cc
index 441c401e92381ff529b53325452992a50709fef4..c2b0e39c6997b7324e5005c10008246ba2df7790 100644
--- a/ppapi/nacl_irt/manifest_service.cc
+++ b/ppapi/nacl_irt/manifest_service.cc
@@ -84,14 +84,16 @@ bool ManifestService::OpenResource(const char* file, int* fd) {
// Specifically, PNaCl doesn't support open resource.
ppapi::proxy::SerializedHandle ipc_fd;
if (!filter_->Send(new PpapiHostMsg_OpenResource(
- std::string(kFilePrefix) + file, &ipc_fd)) ||
- !ipc_fd.is_file()) {
Mark Seaborn 2014/08/07 04:46:23 Is this change required to fix something? Maybe c
teravest 2014/08/07 18:47:02 Removing this condition is required as part of thi
+ std::string(kFilePrefix) + file, &ipc_fd))) {
LOG(ERROR) << "ManifestService::OpenResource failed:" << file;
*fd = -1;
return false;
}
- *fd = ipc_fd.descriptor().fd;
+ if (ipc_fd.is_file())
+ *fd = ipc_fd.descriptor().fd;
Mark Seaborn 2014/08/07 04:46:23 Nit: I think multi-line ifs are meant to use {}s
teravest 2014/08/07 18:47:02 The rule is that the if and else clauses must agre
+ else
+ *fd = -1;
return true;
}
@@ -105,7 +107,6 @@ int IrtOpenResource(const char* file, int* fd) {
!manifest_service->OpenResource(file, fd)) {
return NACL_ABI_EIO;
}
-
return (*fd == -1) ? NACL_ABI_ENOENT : 0;
}

Powered by Google App Engine
This is Rietveld 408576698