summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormseaborn <mseaborn@chromium.org>2015-01-22 20:39:15 -0800
committerCommit bot <commit-bot@chromium.org>2015-01-23 04:40:13 +0000
commit6e975773c4da56f725dca330494fcb684c14469f (patch)
tree89d559c65c346226d485d9a57fa5baf455c9ab60
parent4e45f41babddb10985c8c0afb9b0b6b9e8356094 (diff)
downloadchromium_src-6e975773c4da56f725dca330494fcb684c14469f.zip
chromium_src-6e975773c4da56f725dca330494fcb684c14469f.tar.gz
chromium_src-6e975773c4da56f725dca330494fcb684c14469f.tar.bz2
NaCl: Remove now-unused callback plumbing for handling "init_done" SRPC call
StartupInitializationComplete()/init_done no longer needs to call any callbacks, since these have all become no-ops. BUG=428030 TEST=NaCl*Core Review URL: https://codereview.chromium.org/870753002 Cr-Commit-Position: refs/heads/master@{#312771}
-rw-r--r--ppapi/native_client/src/trusted/plugin/plugin.cc21
-rw-r--r--ppapi/native_client/src/trusted/plugin/plugin.h3
-rw-r--r--ppapi/native_client/src/trusted/plugin/service_runtime.cc24
-rw-r--r--ppapi/native_client/src/trusted/plugin/service_runtime.h8
4 files changed, 15 insertions, 41 deletions
diff --git a/ppapi/native_client/src/trusted/plugin/plugin.cc b/ppapi/native_client/src/trusted/plugin/plugin.cc
index 4248c19..d4d373b 100644
--- a/ppapi/native_client/src/trusted/plugin/plugin.cc
+++ b/ppapi/native_client/src/trusted/plugin/plugin.cc
@@ -65,8 +65,7 @@ bool Plugin::LoadHelperNaClModuleInternal(NaClSubprocess* subprocess,
new ServiceRuntime(this,
pp_instance(),
false, // No main_service_runtime.
- false, // No non-SFI mode (i.e. in SFI-mode).
- pp::BlockUntilComplete());
+ false); // No non-SFI mode (i.e. in SFI-mode).
// Now start the SelLdr instance. This must be created on the main thread.
bool service_runtime_started = false;
@@ -133,8 +132,7 @@ void Plugin::SignalStartSelLdrDone(int32_t pp_error,
void Plugin::LoadNaClModule(PP_NaClFileInfo file_info,
bool uses_nonsfi_mode,
- PP_NaClAppProcessType process_type,
- const pp::CompletionCallback& init_done_cb) {
+ PP_NaClAppProcessType process_type) {
CHECK(pp::Module::Get()->core()->IsMainThread());
// Before forking a new sel_ldr process, ensure that we do not leak
// the ServiceRuntime object for an existing subprocess, and that any
@@ -150,7 +148,7 @@ void Plugin::LoadNaClModule(PP_NaClFileInfo file_info,
process_type);
ErrorInfo error_info;
ServiceRuntime* service_runtime = new ServiceRuntime(
- this, pp_instance(), true, uses_nonsfi_mode, init_done_cb);
+ this, pp_instance(), true, uses_nonsfi_mode);
main_subprocess_.set_service_runtime(service_runtime);
if (NULL == service_runtime) {
error_info.SetReport(
@@ -199,9 +197,8 @@ NaClSubprocess* Plugin::LoadHelperNaClModule(const std::string& helper_url,
if (!LoadHelperNaClModuleInternal(nacl_subprocess.get(), params))
return NULL;
- // We need not wait for the init_done callback. We can block
- // here in StartSrpcServices, since helper NaCl modules
- // are spawned from a private thread.
+ // We can block here in StartSrpcServices, since helper NaCl
+ // modules are spawned from a private thread.
//
// TODO(bsy): if helper module crashes, we should abort.
// crash_cb is not used here, so we are relying on crashes
@@ -309,9 +306,7 @@ void Plugin::NexeFileDidOpen(int32_t pp_error) {
LoadNaClModule(
nexe_file_info_,
uses_nonsfi_mode_,
- PP_NATIVE_NACL_PROCESS_TYPE,
- // No-op callback.
- pp::CompletionCallback());
+ PP_NATIVE_NACL_PROCESS_TYPE);
}
void Plugin::BitcodeDidTranslate(int32_t pp_error) {
@@ -332,9 +327,7 @@ void Plugin::BitcodeDidTranslate(int32_t pp_error) {
LoadNaClModule(
info,
false, /* uses_nonsfi_mode */
- PP_PNACL_PROCESS_TYPE,
- // No-op callback.
- pp::CompletionCallback());
+ PP_PNACL_PROCESS_TYPE);
}
void Plugin::NaClManifestFileDidOpen(int32_t pp_error) {
diff --git a/ppapi/native_client/src/trusted/plugin/plugin.h b/ppapi/native_client/src/trusted/plugin/plugin.h
index 0cd21e1..634a111 100644
--- a/ppapi/native_client/src/trusted/plugin/plugin.h
+++ b/ppapi/native_client/src/trusted/plugin/plugin.h
@@ -85,8 +85,7 @@ class Plugin : public pp::Instance {
// mechanism(s) take over.
void LoadNaClModule(PP_NaClFileInfo file_info,
bool uses_nonsfi_mode,
- PP_NaClAppProcessType process_type,
- const pp::CompletionCallback& init_done_cb);
+ PP_NaClAppProcessType process_type);
// Load support.
// A helper SRPC NaCl module can be loaded given a PP_NaClFileInfo.
diff --git a/ppapi/native_client/src/trusted/plugin/service_runtime.cc b/ppapi/native_client/src/trusted/plugin/service_runtime.cc
index dfbf825..6b549bb 100644
--- a/ppapi/native_client/src/trusted/plugin/service_runtime.cc
+++ b/ppapi/native_client/src/trusted/plugin/service_runtime.cc
@@ -49,13 +49,11 @@ OpenManifestEntryResource::~OpenManifestEntryResource() {
PluginReverseInterface::PluginReverseInterface(
nacl::WeakRefAnchor* anchor,
PP_Instance pp_instance,
- ServiceRuntime* service_runtime,
- pp::CompletionCallback init_done_cb)
+ ServiceRuntime* service_runtime)
: anchor_(anchor),
pp_instance_(pp_instance),
service_runtime_(service_runtime),
- shutting_down_(false),
- init_done_cb_(init_done_cb) {
+ shutting_down_(false) {
NaClXMutexCtor(&mu_);
NaClXCondVarCtor(&cv_);
}
@@ -79,17 +77,7 @@ void PluginReverseInterface::DoPostMessage(std::string message) {
}
void PluginReverseInterface::StartupInitializationComplete() {
- NaClLog(4, "PluginReverseInterface::StartupInitializationComplete\n");
- if (init_done_cb_.pp_completion_callback().func != NULL) {
- NaClLog(4,
- "PluginReverseInterface::StartupInitializationComplete:"
- " invoking CB\n");
- pp::Module::Get()->core()->CallOnMainThread(0, init_done_cb_, PP_OK);
- } else {
- NaClLog(1,
- "PluginReverseInterface::StartupInitializationComplete:"
- " init_done_cb_ not valid, skipping.\n");
- }
+ // This is no longer used.
}
// TODO(bsy): OpenManifestEntry should use the manifest to ResolveKey
@@ -238,16 +226,14 @@ int64_t PluginReverseInterface::RequestQuotaForWrite(
ServiceRuntime::ServiceRuntime(Plugin* plugin,
PP_Instance pp_instance,
bool main_service_runtime,
- bool uses_nonsfi_mode,
- pp::CompletionCallback init_done_cb)
+ bool uses_nonsfi_mode)
: plugin_(plugin),
pp_instance_(pp_instance),
main_service_runtime_(main_service_runtime),
uses_nonsfi_mode_(uses_nonsfi_mode),
reverse_service_(NULL),
anchor_(new nacl::WeakRefAnchor()),
- rev_interface_(new PluginReverseInterface(anchor_, pp_instance, this,
- init_done_cb)),
+ rev_interface_(new PluginReverseInterface(anchor_, pp_instance, this)),
start_sel_ldr_done_(false),
sel_ldr_wait_timed_out_(false),
start_nexe_done_(false),
diff --git a/ppapi/native_client/src/trusted/plugin/service_runtime.h b/ppapi/native_client/src/trusted/plugin/service_runtime.h
index b720bd2..44fbcc6 100644
--- a/ppapi/native_client/src/trusted/plugin/service_runtime.h
+++ b/ppapi/native_client/src/trusted/plugin/service_runtime.h
@@ -73,8 +73,7 @@ class PluginReverseInterface: public nacl::ReverseInterface {
public:
PluginReverseInterface(nacl::WeakRefAnchor* anchor,
PP_Instance pp_instance,
- ServiceRuntime* service_runtime,
- pp::CompletionCallback init_done_cb);
+ ServiceRuntime* service_runtime);
virtual ~PluginReverseInterface();
@@ -114,8 +113,6 @@ class PluginReverseInterface: public nacl::ReverseInterface {
NaClMutex mu_;
NaClCondVar cv_;
bool shutting_down_;
-
- pp::CompletionCallback init_done_cb_;
};
// ServiceRuntime abstracts a NativeClient sel_ldr instance.
@@ -124,8 +121,7 @@ class ServiceRuntime {
ServiceRuntime(Plugin* plugin,
PP_Instance pp_instance,
bool main_service_runtime,
- bool uses_nonsfi_mode,
- pp::CompletionCallback init_done_cb);
+ bool uses_nonsfi_mode);
// The destructor terminates the sel_ldr process.
~ServiceRuntime();