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

Unified Diff: ppapi/native_client/src/trusted/plugin/service_runtime.h

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/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);

Powered by Google App Engine
This is Rietveld 408576698