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

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: Rebase 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..ca1276472296afc346d0ab71fed61ffa835e2887 100644
--- a/ppapi/native_client/src/trusted/plugin/service_runtime.h
+++ b/ppapi/native_client/src/trusted/plugin/service_runtime.h
@@ -41,6 +41,7 @@ namespace plugin {
class ErrorInfo;
class Manifest;
+class OpenManifestEntryAsyncCallback;
class Plugin;
class SrpcClient;
class ServiceRuntime;
@@ -87,13 +88,19 @@ 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 +177,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
+ // a sync function and must be called on a non-main thread,
+ // OpenManifestEntryAsync must be 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