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

Unified Diff: components/nacl/browser/nacl_process_host.cc

Issue 56833003: Use base::PostTaskAndReplyWithResults() in more places. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase, fix clang error Created 7 years, 1 month 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 | « components/nacl/browser/nacl_process_host.h ('k') | content/browser/browser_thread_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/nacl/browser/nacl_process_host.cc
diff --git a/components/nacl/browser/nacl_process_host.cc b/components/nacl/browser/nacl_process_host.cc
index 9ffda7c23d4a2690273a364ba086833fda77355e..466be54484ce83e3f76e943f66c9074ea4b053a5 100644
--- a/components/nacl/browser/nacl_process_host.cc
+++ b/components/nacl/browser/nacl_process_host.cc
@@ -272,7 +272,7 @@ NaClProcessHost::~NaClProcessHost() {
base::StringPrintf("NaCl process exited with status %i (0x%x)",
exit_code, exit_code);
if (exit_code == 0) {
- LOG(INFO) << message;
+ VLOG(1) << message;
} else {
LOG(ERROR) << message;
}
@@ -875,12 +875,12 @@ void NaClProcessHost::OnSetKnownToValidate(const std::string& signature) {
}
void NaClProcessHost::FileResolved(
- base::PlatformFile* file,
const base::FilePath& file_path,
- IPC::Message* reply_msg) {
- if (*file != base::kInvalidPlatformFileValue) {
+ IPC::Message* reply_msg,
+ const base::PlatformFile& file) {
+ if (file != base::kInvalidPlatformFileValue) {
IPC::PlatformFileForTransit handle = IPC::GetFileHandleForProcess(
- *file,
+ file,
process_->GetData().handle,
true /* close_source */);
NaClProcessMsg_ResolveFileToken::WriteReplyParams(
@@ -891,7 +891,7 @@ void NaClProcessHost::FileResolved(
NaClProcessMsg_ResolveFileToken::WriteReplyParams(
reply_msg,
IPC::InvalidPlatformFileForTransit(),
- base::FilePath(FILE_PATH_LITERAL("")));
+ base::FilePath());
}
Send(reply_msg);
}
@@ -928,28 +928,24 @@ void NaClProcessHost::OnResolveFileToken(uint64 file_token_lo,
NaClProcessMsg_ResolveFileToken::WriteReplyParams(
reply_msg,
IPC::InvalidPlatformFileForTransit(),
- base::FilePath(FILE_PATH_LITERAL("")));
+ base::FilePath());
Send(reply_msg);
return;
}
- // Scratch space to share between the callbacks.
- base::PlatformFile* data = new base::PlatformFile();
-
// Open the file.
- if (!content::BrowserThread::PostBlockingPoolTaskAndReply(
+ if (!base::PostTaskAndReplyWithResult(
+ content::BrowserThread::GetBlockingPool(),
FROM_HERE,
- base::Bind(OpenNaClExecutableImpl,
- file_path, data),
+ base::Bind(OpenNaClExecutableImpl, file_path),
base::Bind(&NaClProcessHost::FileResolved,
weak_factory_.GetWeakPtr(),
- base::Owned(data),
file_path,
reply_msg))) {
NaClProcessMsg_ResolveFileToken::WriteReplyParams(
reply_msg,
IPC::InvalidPlatformFileForTransit(),
- base::FilePath(FILE_PATH_LITERAL("")));
+ base::FilePath());
Send(reply_msg);
}
}
« no previous file with comments | « components/nacl/browser/nacl_process_host.h ('k') | content/browser/browser_thread_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698