Chromium Code Reviews| Index: ppapi/native_client/src/trusted/plugin/service_runtime.h |
| diff --git a/ppapi/native_client/src/trusted/plugin/service_runtime.h b/ppapi/native_client/src/trusted/plugin/service_runtime.h |
| index 07850d4216848429ee7d2284eba0336ccc8aa4dd..c0c52e4b42a21e856e2b99ec5a0c3588ae0d27c4 100644 |
| --- a/ppapi/native_client/src/trusted/plugin/service_runtime.h |
| +++ b/ppapi/native_client/src/trusted/plugin/service_runtime.h |
| @@ -83,17 +83,25 @@ struct PostMessageResource { |
| std::string message; |
| }; |
| +class OpenManifestEntryAsyncCallback; |
|
Mark Seaborn
2014/04/30 21:20:58
Shouldn't forward decls be grouped together near t
hidehiko
2014/05/01 05:20:31
Done.
|
| + |
| struct OpenManifestEntryResource { |
| public: |
| OpenManifestEntryResource(const std::string& target_url, |
| struct NaClFileInfo* finfo, |
| - bool* op_complete) |
| + bool* op_complete, |
| + OpenManifestEntryAsyncCallback* callback) |
| : url(target_url), |
| file_info(finfo), |
| - op_complete_ptr(op_complete) {} |
| + op_complete_ptr(op_complete), |
| + callback(callback) {} |
| + ~OpenManifestEntryResource(); |
| + void MaybeRunCallback(int32_t pp_error); |
| + |
| std::string url; |
| struct NaClFileInfo* file_info; |
| bool* op_complete_ptr; |
| + OpenManifestEntryAsyncCallback* callback; |
| }; |
| struct CloseManifestEntryResource { |
| @@ -170,6 +178,15 @@ class PluginReverseInterface: public nacl::ReverseInterface { |
| const pp::FileIO& file_io); |
| void AddTempQuotaManagedFile(const nacl::string& file_id); |
| + // This is a sibling of OpenManifestEntry. While OpenManifestEntry is |
| + // sync function and must be called on a non-main thread, this must be |
|
Mark Seaborn
2014/04/30 21:20:58
Nit: "a sync function"? "this" -> "OpenManifestEn
hidehiko
2014/05/01 05:20:31
Done.
|
| + // called on the main thread. Upon completion (even on error), callback will |
| + // be invoked. The caller has responsibility to keep the memory passed to |
| + // info until callback is invoked. |
| + void OpenManifestEntryAsync(const nacl::string& key, |
| + struct NaClFileInfo* info, |
| + OpenManifestEntryAsyncCallback* callback); |
| + |
| protected: |
| virtual void PostMessage_MainThreadContinuation(PostMessageResource* p, |
| int32_t err); |