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

Unified Diff: chrome/browser/nacl_host/nacl_process_host.cc

Issue 11967002: Instrument early NaCl load failiures on Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Indent. Created 7 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/nacl_host/nacl_process_host.cc
diff --git a/chrome/browser/nacl_host/nacl_process_host.cc b/chrome/browser/nacl_host/nacl_process_host.cc
index ec8b3dd4caf2f299d6d2209503e4ea7b8fc2103f..4b529ac461822837acc1c5ce4e96647dfc3e5129 100644
--- a/chrome/browser/nacl_host/nacl_process_host.cc
+++ b/chrome/browser/nacl_host/nacl_process_host.cc
@@ -102,7 +102,7 @@ bool ShareHandleToSelLdr(
0, // Unused given DUPLICATE_SAME_ACCESS.
FALSE,
flags)) {
- DLOG(ERROR) << "DuplicateHandle() failed";
+ LOG(ERROR) << "DuplicateHandle() failed";
return false;
}
handles_for_sel_ldr->push_back(
@@ -270,7 +270,8 @@ void NaClProcessHost::Launch(
NaClBrowser* nacl_browser = NaClBrowser::GetInstance();
nacl_browser->EnsureAllResourcesAvailable();
if (!nacl_browser->IsOk()) {
- DLOG(ERROR) << "Cannot launch NaCl process";
+ LOG(ERROR) << "NaCl process launch failed: could not find all the "
+ "resources needed to launch the process";
delete this;
return;
}
@@ -287,6 +288,7 @@ void NaClProcessHost::Launch(
nacl::Handle pair[2];
// Create a connected socket
if (nacl::SocketPair(pair) == -1) {
+ LOG(ERROR) << "NaCl process launch failed: could not create a socket pair";
delete this;
return;
}
@@ -321,7 +323,7 @@ void NaClProcessHost::OnChannelConnected(int32 peer_pid) {
return;
}
} else {
- DLOG(ERROR) << "Failed to get process handle";
+ LOG(ERROR) << "Failed to get process handle";
}
}
}
@@ -490,8 +492,10 @@ FilePath NaClProcessHost::GetManifestPath() {
bool NaClProcessHost::LaunchSelLdr() {
std::string channel_id = process_->GetHost()->CreateChannel();
- if (channel_id.empty())
+ if (channel_id.empty()) {
+ LOG(ERROR) << "NaCl process launch failed: could not create channel";
return false;
+ }
CommandLine::StringType nacl_loader_prefix;
#if defined(OS_POSIX)
@@ -524,8 +528,10 @@ bool NaClProcessHost::LaunchSelLdr() {
// On Windows 64-bit NaCl loader is called nacl64.exe instead of chrome.exe
if (RunningOnWOW64()) {
FilePath module_path;
- if (!PathService::Get(base::FILE_MODULE, &module_path))
+ if (!PathService::Get(base::FILE_MODULE, &module_path)) {
+ LOG(ERROR) << "NaCl process launch failed: could not resolve module";
return false;
+ }
exe_path = module_path.DirName().Append(chrome::kNaClAppName);
}
#endif
@@ -566,8 +572,12 @@ bool NaClProcessHost::LaunchSelLdr() {
// On Windows we might need to start the broker process to launch a new loader
#if defined(OS_WIN)
if (RunningOnWOW64()) {
- return NaClBrokerService::GetInstance()->LaunchLoader(
- weak_factory_.GetWeakPtr(), channel_id);
+ if (!NaClBrokerService::GetInstance()->LaunchLoader(
+ weak_factory_.GetWeakPtr(), channel_id)) {
+ LOG(ERROR) << "NaCl process launch failed: broker service did not launch "
+ "process";
+ return false;
+ }
} else {
process_->Launch(FilePath(), cmd_line.release());
}
@@ -606,8 +616,11 @@ void NaClProcessHost::OnProcessLaunched() {
// Called when the NaClBrowser singleton has been fully initialized.
void NaClProcessHost::OnResourcesReady() {
NaClBrowser* nacl_browser = NaClBrowser::GetInstance();
- if (!nacl_browser->IsReady() || !SendStart()) {
- DLOG(ERROR) << "Cannot launch NaCl process";
+ if (!nacl_browser->IsReady()) {
+ LOG(ERROR) << "NaCl process launch failed: could not acquire shared "
+ "resources needed by NaCl";
+ delete this;
+ } else if (!SendStart()) {
delete this;
}
}
@@ -626,7 +639,7 @@ bool NaClProcessHost::ReplyToRenderer(
0, // Unused given DUPLICATE_SAME_ACCESS.
FALSE,
DUPLICATE_CLOSE_SOURCE | DUPLICATE_SAME_ACCESS)) {
- DLOG(ERROR) << "DuplicateHandle() failed";
+ LOG(ERROR) << "DuplicateHandle() failed";
return false;
}
handle_for_renderer = reinterpret_cast<nacl::FileDescriptor>(
@@ -648,7 +661,7 @@ bool NaClProcessHost::ReplyToRenderer(
// BrokerDuplicateHandle().
if (RunningOnWOW64()) {
if (!content::BrokerAddTargetPeer(process_->GetData().handle)) {
- DLOG(ERROR) << "Failed to add NaCl process PID";
+ LOG(ERROR) << "Failed to add NaCl process PID";
return false;
}
}
@@ -852,6 +865,8 @@ bool NaClProcessHost::StartWithLaunchedProcess() {
weak_factory_.GetWeakPtr()));
return true;
} else {
+ LOG(ERROR) << "NaCl process failed to launch: previously failed to acquire "
+ "shared resources";
return false;
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698