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

Side by Side Diff: components/nacl/browser/nacl_process_host.cc

Issue 1125043002: NaCl: Stop sending resource FDs with NaClProcessMsg_Start (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 5 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 unified diff | Download patch
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 "components/nacl/browser/nacl_process_host.h" 5 #include "components/nacl/browser/nacl_process_host.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after
867 if (!crash_info_shmem_.ShareToProcess(process_->GetData().handle, 867 if (!crash_info_shmem_.ShareToProcess(process_->GetData().handle,
868 &params.crash_info_shmem_handle)) { 868 &params.crash_info_shmem_handle)) {
869 DLOG(ERROR) << "Failed to ShareToProcess() a shared memory buffer"; 869 DLOG(ERROR) << "Failed to ShareToProcess() a shared memory buffer";
870 return false; 870 return false;
871 } 871 }
872 872
873 // Pass the pre-opened resource files to the loader. We do not have to reopen 873 // Pass the pre-opened resource files to the loader. We do not have to reopen
874 // resource files here even for SFI mode because the descriptors are not from 874 // resource files here even for SFI mode because the descriptors are not from
875 // a renderer. 875 // a renderer.
876 for (size_t i = 0; i < prefetched_resource_files_.size(); ++i) { 876 for (size_t i = 0; i < prefetched_resource_files_.size(); ++i) {
877 params.prefetched_resource_files.push_back( 877 process_->Send(new NaClProcessMsg_AddPrefetchedResource(
878 NaClResourcePrefetchResult( 878 NaClResourcePrefetchResult(
879 prefetched_resource_files_[i].file, 879 prefetched_resource_files_[i].file,
880 // For the same reason as the comment below, always use an empty 880 // For the same reason as the comment below, always use an empty
881 // base::FilePath for non-SFI mode. 881 // base::FilePath for non-SFI mode.
882 (uses_nonsfi_mode_ ? base::FilePath() : 882 (uses_nonsfi_mode_ ? base::FilePath() :
883 prefetched_resource_files_[i].file_path_metadata), 883 prefetched_resource_files_[i].file_path_metadata),
884 prefetched_resource_files_[i].file_key)); 884 prefetched_resource_files_[i].file_key)));
885 } 885 }
886 prefetched_resource_files_.clear(); 886 prefetched_resource_files_.clear();
887 887
888 base::FilePath file_path; 888 base::FilePath file_path;
889 if (uses_nonsfi_mode_) { 889 if (uses_nonsfi_mode_) {
890 // Don't retrieve the file path when using nonsfi mode; there's no 890 // Don't retrieve the file path when using nonsfi mode; there's no
891 // validation caching in that case, so it's unnecessary work, and would 891 // validation caching in that case, so it's unnecessary work, and would
892 // expose the file path to the plugin. 892 // expose the file path to the plugin.
893 } else { 893 } else {
894 if (NaClBrowser::GetInstance()->GetFilePath(nexe_token_.lo, 894 if (NaClBrowser::GetInstance()->GetFilePath(nexe_token_.lo,
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
1182 process.Pass(), info, 1182 process.Pass(), info,
1183 base::MessageLoopProxy::current(), 1183 base::MessageLoopProxy::current(),
1184 base::Bind(&NaClProcessHost::OnDebugExceptionHandlerLaunchedByBroker, 1184 base::Bind(&NaClProcessHost::OnDebugExceptionHandlerLaunchedByBroker,
1185 weak_factory_.GetWeakPtr())); 1185 weak_factory_.GetWeakPtr()));
1186 return true; 1186 return true;
1187 } 1187 }
1188 } 1188 }
1189 #endif 1189 #endif
1190 1190
1191 } // namespace nacl 1191 } // namespace nacl
OLDNEW
« no previous file with comments | « components/nacl/browser/nacl_host_message_filter.cc ('k') | components/nacl/common/nacl_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698