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

Unified Diff: ppapi/nacl_irt/manifest_service.cc

Issue 249183004: Implement open_resource in non-SFI mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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 ed7c4ebf969ffe9d337780ad426831abfcb3f4a0..379fcd8a15580f320ca14f7d9357b99a9851b7c0 100644
--- a/ppapi/nacl_irt/manifest_service.cc
+++ b/ppapi/nacl_irt/manifest_service.cc
@@ -12,6 +12,8 @@
namespace ppapi {
+const char kFilePrefix[] = "files/";
+
ManifestService::ManifestService(
const IPC::ChannelHandle& handle,
scoped_refptr<base::MessageLoopProxy> io_message_loop,
@@ -19,7 +21,7 @@ ManifestService::ManifestService(
filter_ = new IPC::SyncMessageFilter(shutdown_event);
channel_.reset(new IPC::ChannelProxy(handle,
IPC::Channel::MODE_SERVER,
- NULL, // Listener
+ NULL, // Listener
io_message_loop));
channel_->AddFilter(filter_.get());
}
@@ -31,4 +33,17 @@ void ManifestService::StartupInitializationComplete() {
filter_->Send(new PpapiHostMsg_StartupInitializationComplete);
}
+bool ManifestService::OpenResource(const char* file, int* fd) {
+ ppapi::proxy::SerializedHandle ipc_fd;
+ if (!filter_->Send(new PpapiHostMsg_OpenResource(
+ std::string(kFilePrefix) + file, &ipc_fd))) {
+ LOG(ERROR) << "ManifestService::OpenResource failed:" << file;
+ *fd = -1;
+ return false;
+ }
+
+ *fd = IPC::PlatformFileForTransitToPlatformFile(ipc_fd.descriptor());
Mark Seaborn 2014/04/30 21:20:58 This can just be "ipc_fd.descriptor().fd", I think
hidehiko 2014/05/01 05:20:31 Done.
+ return true;
+}
+
} // namespace ppapi

Powered by Google App Engine
This is Rietveld 408576698