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

Unified Diff: components/nacl/renderer/pnacl_translation_resource_host.cc

Issue 307173002: Remove PlatformFile from components/nacl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update NexeFdCallback definition Created 6 years, 7 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 | « components/nacl/renderer/nexe_load_manager.cc ('k') | components/nacl/renderer/ppb_nacl_private_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/nacl/renderer/pnacl_translation_resource_host.cc
diff --git a/components/nacl/renderer/pnacl_translation_resource_host.cc b/components/nacl/renderer/pnacl_translation_resource_host.cc
index 223bcc6a231bcf3011fee45d88ce75c5bbeba204..087c8048ebbe170bef60396eeb51c684d27cb83f 100644
--- a/components/nacl/renderer/pnacl_translation_resource_host.cc
+++ b/components/nacl/renderer/pnacl_translation_resource_host.cc
@@ -129,14 +129,14 @@ void PnaclTranslationResourceHost::OnNexeTempFileReply(
bool is_hit,
IPC::PlatformFileForTransit file) {
DCHECK(io_message_loop_->BelongsToCurrentThread());
+ base::File base_file = IPC::PlatformFileForTransitToFile(file);
CacheRequestInfoMap::iterator it = pending_cache_requests_.find(instance);
int32_t status = PP_ERROR_FAILED;
// Handle the expected successful case first.
- if (it != pending_cache_requests_.end() &&
- !(file == IPC::InvalidPlatformFileForTransit()) &&
+ if (it != pending_cache_requests_.end() && base_file.IsValid() &&
TrackedCallback::IsPending(it->second.callback)) {
*it->second.is_hit = PP_FromBool(is_hit);
- *it->second.file_handle = IPC::PlatformFileForTransitToPlatformFile(file);
+ *it->second.file_handle = base_file.TakePlatformFile();
status = PP_OK;
}
if (it == pending_cache_requests_.end()) {
@@ -147,10 +147,8 @@ void PnaclTranslationResourceHost::OnNexeTempFileReply(
base::Bind(&TrackedCallback::Run, it->second.callback, status));
pending_cache_requests_.erase(it);
}
- if (file == IPC::InvalidPlatformFileForTransit()) {
+ if (!base_file.IsValid()) {
DLOG(ERROR) << "Got invalid platformfilefortransit";
- } else if (status != PP_OK) {
- base::ClosePlatformFile(IPC::PlatformFileForTransitToPlatformFile(file));
}
}
« no previous file with comments | « components/nacl/renderer/nexe_load_manager.cc ('k') | components/nacl/renderer/ppb_nacl_private_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698