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

Side by Side Diff: ppapi/native_client/src/trusted/plugin/pnacl_translate_thread.cc

Issue 176813010: Avoid blocking the PNaCl translator processes when chrome NaCl GDB flag is on. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: clean up comment Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ppapi/native_client/src/trusted/plugin/pnacl_translate_thread.h" 5 #include "ppapi/native_client/src/trusted/plugin/pnacl_translate_thread.h"
6 6
7 #include <iterator> 7 #include <iterator>
8 8
9 #include "native_client/src/trusted/desc/nacl_desc_wrapper.h" 9 #include "native_client/src/trusted/desc/nacl_desc_wrapper.h"
10 #include "ppapi/native_client/src/trusted/plugin/plugin.h" 10 #include "ppapi/native_client/src/trusted/plugin/plugin.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 bytes->resize(buffer_size); 108 bytes->resize(buffer_size);
109 } 109 }
110 110
111 NaClSubprocess* PnaclTranslateThread::StartSubprocess( 111 NaClSubprocess* PnaclTranslateThread::StartSubprocess(
112 const nacl::string& url_for_nexe, 112 const nacl::string& url_for_nexe,
113 const Manifest* manifest, 113 const Manifest* manifest,
114 ErrorInfo* error_info) { 114 ErrorInfo* error_info) {
115 PLUGIN_PRINTF(("PnaclTranslateThread::StartSubprocess (url_for_nexe=%s)\n", 115 PLUGIN_PRINTF(("PnaclTranslateThread::StartSubprocess (url_for_nexe=%s)\n",
116 url_for_nexe.c_str())); 116 url_for_nexe.c_str()));
117 nacl::DescWrapper* wrapper = resources_->WrapperForUrl(url_for_nexe); 117 nacl::DescWrapper* wrapper = resources_->WrapperForUrl(url_for_nexe);
118 // Supply a fake URL for the translator components so that NaCl GDB
teravest 2014/02/25 18:51:29 How is the url fake?
jvoung (off chromium) 2014/02/25 23:52:31 Perhaps taking the word "fake" out will be less co
119 // can filter processes (and not debug the translator itself if desired).
120 // Must have the full URL otherwise it gets silently dropped.
121 nacl::string full_url = resources_->GetFullUrl(url_for_nexe);
118 nacl::scoped_ptr<NaClSubprocess> subprocess( 122 nacl::scoped_ptr<NaClSubprocess> subprocess(
119 plugin_->LoadHelperNaClModule(wrapper, manifest, error_info)); 123 plugin_->LoadHelperNaClModule(full_url, wrapper, manifest, error_info));
120 if (subprocess.get() == NULL) { 124 if (subprocess.get() == NULL) {
121 PLUGIN_PRINTF(( 125 PLUGIN_PRINTF((
122 "PnaclTranslateThread::StartSubprocess: subprocess creation failed\n")); 126 "PnaclTranslateThread::StartSubprocess: subprocess creation failed\n"));
123 return NULL; 127 return NULL;
124 } 128 }
125 return subprocess.release(); 129 return subprocess.release();
126 } 130 }
127 131
128 void WINAPI PnaclTranslateThread::DoTranslateThread(void* arg) { 132 void WINAPI PnaclTranslateThread::DoTranslateThread(void* arg) {
129 PnaclTranslateThread* translator = 133 PnaclTranslateThread* translator =
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 AbortSubprocesses(); 457 AbortSubprocesses();
454 if (translate_thread_ != NULL) 458 if (translate_thread_ != NULL)
455 NaClThreadJoin(translate_thread_.get()); 459 NaClThreadJoin(translate_thread_.get());
456 PLUGIN_PRINTF(("~PnaclTranslateThread joined\n")); 460 PLUGIN_PRINTF(("~PnaclTranslateThread joined\n"));
457 NaClCondVarDtor(&buffer_cond_); 461 NaClCondVarDtor(&buffer_cond_);
458 NaClMutexDtor(&cond_mu_); 462 NaClMutexDtor(&cond_mu_);
459 NaClMutexDtor(&subprocess_mu_); 463 NaClMutexDtor(&subprocess_mu_);
460 } 464 }
461 465
462 } // namespace plugin 466 } // namespace plugin
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698