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

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

Issue 149403005: Pepper: Make StartSelLdr asynchronous. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: CompletionCallback cleanup in service_runtime Created 6 years, 10 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 30200b85d5a9ba31f13638738a110abbabc1e768..8186e5b54e5c4720d7b2da08b85254530f96396d 100644
--- a/ppapi/native_client/src/trusted/plugin/service_runtime.h
+++ b/ppapi/native_client/src/trusted/plugin/service_runtime.h
@@ -24,8 +24,8 @@
#include "native_client/src/trusted/weak_ref/weak_ref.h"
#include "ppapi/cpp/completion_callback.h"
-
#include "ppapi/native_client/src/trusted/plugin/utility.h"
+#include "ppapi/utility/completion_callback_factory.h"
struct NaClFileInfo;
@@ -229,10 +229,9 @@ class ServiceRuntime {
// The destructor terminates the sel_ldr process.
~ServiceRuntime();
- // Spawn the sel_ldr instance. On success, returns true.
- // On failure, returns false and |error_string| is set to something
- // describing the error.
- bool StartSelLdr(const SelLdrStartParams& params);
+ // Spawn the sel_ldr instance.
+ void StartSelLdr(const SelLdrStartParams& params,
+ pp::CompletionCallback callback);
// If starting sel_ldr from a background thread, wait for sel_ldr to
// actually start.
@@ -274,6 +273,8 @@ class ServiceRuntime {
bool LoadModule(nacl::DescWrapper* shm, ErrorInfo* error_info);
bool InitReverseService(ErrorInfo* error_info);
bool StartModule(ErrorInfo* error_info);
+ void StartSelLdrContinuation(int32_t pp_error,
+ pp::CompletionCallback callback);
NaClSrpcChannel command_channel_;
Plugin* plugin_;
@@ -292,6 +293,9 @@ class ServiceRuntime {
NaClCondVar cond_;
int exit_status_;
bool start_sel_ldr_done_;
+
+ PP_Var start_sel_ldr_error_message_;
+ pp::CompletionCallbackFactory<ServiceRuntime> callback_factory_;
};
} // namespace plugin

Powered by Google App Engine
This is Rietveld 408576698