OLD | NEW |
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 "native_client/src/trusted/plugin/pnacl_coordinator.h" | 5 #include "native_client/src/trusted/plugin/pnacl_coordinator.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "native_client/src/include/checked_cast.h" | 10 #include "native_client/src/include/checked_cast.h" |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 return coordinator; | 256 return coordinator; |
257 } | 257 } |
258 | 258 |
259 int32_t PnaclCoordinator::GetLoadedFileDesc(int32_t pp_error, | 259 int32_t PnaclCoordinator::GetLoadedFileDesc(int32_t pp_error, |
260 const nacl::string& url, | 260 const nacl::string& url, |
261 const nacl::string& component) { | 261 const nacl::string& component) { |
262 PLUGIN_PRINTF(("PnaclCoordinator::GetLoadedFileDesc (pp_error=%" | 262 PLUGIN_PRINTF(("PnaclCoordinator::GetLoadedFileDesc (pp_error=%" |
263 NACL_PRId32", url=%s, component=%s)\n", pp_error, | 263 NACL_PRId32", url=%s, component=%s)\n", pp_error, |
264 url.c_str(), component.c_str())); | 264 url.c_str(), component.c_str())); |
265 ErrorInfo error_info; | 265 ErrorInfo error_info; |
266 int32_t file_desc_ok_to_close = plugin_->GetPOSIXFileDesc(url); | 266 struct NaClFileInfo info = plugin_->GetFileInfo(url); |
267 if (pp_error != PP_OK || file_desc_ok_to_close == NACL_NO_FILE_DESC) { | 267 if (pp_error != PP_OK || info.desc == NACL_NO_FILE_DESC) { |
268 if (pp_error == PP_ERROR_ABORTED) { | 268 if (pp_error == PP_ERROR_ABORTED) { |
269 plugin_->ReportLoadAbort(); | 269 plugin_->ReportLoadAbort(); |
270 } else { | 270 } else { |
271 ReportPpapiError(ERROR_PNACL_RESOURCE_FETCH, | 271 ReportPpapiError(ERROR_PNACL_RESOURCE_FETCH, |
272 pp_error, | 272 pp_error, |
273 component + " load failed."); | 273 component + " load failed."); |
274 } | 274 } |
275 return NACL_NO_FILE_DESC; | 275 return NACL_NO_FILE_DESC; |
276 } | 276 } |
277 return file_desc_ok_to_close; | 277 return info.desc; |
278 } | 278 } |
279 | 279 |
280 PnaclCoordinator::PnaclCoordinator( | 280 PnaclCoordinator::PnaclCoordinator( |
281 Plugin* plugin, | 281 Plugin* plugin, |
282 const nacl::string& pexe_url, | 282 const nacl::string& pexe_url, |
283 const PnaclOptions& pnacl_options, | 283 const PnaclOptions& pnacl_options, |
284 const pp::CompletionCallback& translate_notify_callback) | 284 const pp::CompletionCallback& translate_notify_callback) |
285 : translate_finish_error_(PP_OK), | 285 : translate_finish_error_(PP_OK), |
286 plugin_(plugin), | 286 plugin_(plugin), |
287 translate_notify_callback_(translate_notify_callback), | 287 translate_notify_callback_(translate_notify_callback), |
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
937 obj_file_.get(), | 937 obj_file_.get(), |
938 temp_nexe_file_.get(), | 938 temp_nexe_file_.get(), |
939 &error_info_, | 939 &error_info_, |
940 resources_.get(), | 940 resources_.get(), |
941 &pnacl_options_, | 941 &pnacl_options_, |
942 this, | 942 this, |
943 plugin_); | 943 plugin_); |
944 } | 944 } |
945 | 945 |
946 } // namespace plugin | 946 } // namespace plugin |
OLD | NEW |