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

Unified Diff: ppapi/native_client/src/trusted/plugin/pnacl_translate_thread.cc

Issue 10800084: Remove non-streaming translation code from pnacl coordinator (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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/pnacl_translate_thread.cc
diff --git a/ppapi/native_client/src/trusted/plugin/pnacl_translate_thread.cc b/ppapi/native_client/src/trusted/plugin/pnacl_translate_thread.cc
index 8aa00dfe03dcda06d25c68b8b50706188cccee93..13a99ba600b92375b78f61a62e7a00e3bd1ff260 100644
--- a/ppapi/native_client/src/trusted/plugin/pnacl_translate_thread.cc
+++ b/ppapi/native_client/src/trusted/plugin/pnacl_translate_thread.cc
@@ -24,43 +24,6 @@ PnaclTranslateThread::PnaclTranslateThread() : subprocesses_should_die_(false),
NaClXMutexCtor(&subprocess_mu_);
}
-void PnaclTranslateThread::RunTranslate(
- const pp::CompletionCallback& finish_callback,
- const Manifest* manifest,
- const Manifest* ld_manifest,
- LocalTempFile* obj_file,
- LocalTempFile* nexe_file,
- nacl::DescWrapper* pexe_wrapper,
- ErrorInfo* error_info,
- PnaclResources* resources,
- Plugin* plugin) {
- PLUGIN_PRINTF(("PnaclTranslateThread::RunTranslate)\n"));
- manifest_ = manifest;
- ld_manifest_ = ld_manifest;
- obj_file_ = obj_file;
- nexe_file_ = nexe_file;
- pexe_wrapper_ = pexe_wrapper;
jvoung - send to chromium... 2012/07/23 21:22:11 Since the streamer doesn't use a pexe_desc, could
Derek Schuff 2012/07/23 21:51:57 Done.
- coordinator_error_info_ = error_info;
- resources_ = resources;
- plugin_ = plugin;
-
- // Invoke llc followed by ld off the main thread. This allows use of
- // blocking RPCs that would otherwise block the JavaScript main thread.
- report_translate_finished_ = finish_callback;
- translate_thread_.reset(new NaClThread);
- if (translate_thread_ == NULL) {
- TranslateFailed("could not allocate thread struct.");
- return;
- }
- const int32_t kArbitraryStackSize = 128 * 1024;
- if (!NaClThreadCreateJoinable(translate_thread_.get(),
- DoTranslateThread,
- this,
- kArbitraryStackSize)) {
- TranslateFailed("could not create thread.");
- }
-}
-
NaClSubprocess* PnaclTranslateThread::StartSubprocess(
const nacl::string& url_for_nexe,
const Manifest* manifest,
@@ -84,51 +47,6 @@ void WINAPI PnaclTranslateThread::DoTranslateThread(void* arg) {
translator->DoTranslate();
}
-void PnaclTranslateThread::DoTranslate() {
- ErrorInfo error_info;
- nacl::scoped_ptr<NaClSubprocess> llc_subprocess(
- StartSubprocess(PnaclUrls::GetLlcUrl(), manifest_, &error_info));
- if (llc_subprocess == NULL) {
- TranslateFailed("Compile process could not be created: " +
- error_info.message());
- return;
- }
- // Run LLC.
- SrpcParams params;
- nacl::DescWrapper* llc_out_file = obj_file_->write_wrapper();
- PluginReverseInterface* llc_reverse =
- llc_subprocess->service_runtime()->rev_interface();
- llc_reverse->AddQuotaManagedFile(obj_file_->identifier(),
- obj_file_->write_file_io());
- if (!llc_subprocess->InvokeSrpcMethod("RunWithDefaultCommandLine",
- "hh",
- &params,
- pexe_wrapper_->desc(),
- llc_out_file->desc())) {
- TranslateFailed("compile failed.");
- return;
- }
- // LLC returns values that are used to determine how linking is done.
- int is_shared_library = (params.outs()[0]->u.ival != 0);
- nacl::string soname = params.outs()[1]->arrays.str;
- nacl::string lib_dependencies = params.outs()[2]->arrays.str;
- PLUGIN_PRINTF(("PnaclCoordinator: compile (translator=%p) succeeded"
- " is_shared_library=%d, soname='%s', lib_dependencies='%s')\n",
- this, is_shared_library, soname.c_str(),
- lib_dependencies.c_str()));
- // Shut down the llc subprocess.
- llc_subprocess.reset(NULL);
- if (SubprocessesShouldDie()) {
- TranslateFailed("stopped by coordinator.");
- return;
- }
- if(!RunLdSubprocess(is_shared_library, soname, lib_dependencies)) {
- return;
- }
- pp::Core* core = pp::Module::Get()->core();
- core->CallOnMainThread(0, report_translate_finished_, PP_OK);
-}
-
bool PnaclTranslateThread::RunLdSubprocess(int is_shared_library,
const nacl::string& soname,
const nacl::string& lib_dependencies

Powered by Google App Engine
This is Rietveld 408576698