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

Side by Side Diff: ppapi/native_client/src/trusted/plugin/pnacl_coordinator.cc

Issue 14750007: NaCl: enable meta-based validation for shared libraries. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
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 "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 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 return coordinator; 320 return coordinator;
321 } 321 }
322 322
323 int32_t PnaclCoordinator::GetLoadedFileDesc(int32_t pp_error, 323 int32_t PnaclCoordinator::GetLoadedFileDesc(int32_t pp_error,
324 const nacl::string& url, 324 const nacl::string& url,
325 const nacl::string& component) { 325 const nacl::string& component) {
326 PLUGIN_PRINTF(("PnaclCoordinator::GetLoadedFileDesc (pp_error=%" 326 PLUGIN_PRINTF(("PnaclCoordinator::GetLoadedFileDesc (pp_error=%"
327 NACL_PRId32", url=%s, component=%s)\n", pp_error, 327 NACL_PRId32", url=%s, component=%s)\n", pp_error,
328 url.c_str(), component.c_str())); 328 url.c_str(), component.c_str()));
329 ErrorInfo error_info; 329 ErrorInfo error_info;
330 int32_t file_desc_ok_to_close = plugin_->GetPOSIXFileDesc(url); 330 struct NaClFileInfo info = plugin_->GetFileInfo(url);
331 if (pp_error != PP_OK || file_desc_ok_to_close == NACL_NO_FILE_DESC) { 331 if (pp_error != PP_OK || info.desc == NACL_NO_FILE_DESC) {
332 if (pp_error == PP_ERROR_ABORTED) { 332 if (pp_error == PP_ERROR_ABORTED) {
333 plugin_->ReportLoadAbort(); 333 plugin_->ReportLoadAbort();
334 } else { 334 } else {
335 ReportPpapiError(ERROR_PNACL_RESOURCE_FETCH, 335 ReportPpapiError(ERROR_PNACL_RESOURCE_FETCH,
336 pp_error, 336 pp_error,
337 component + " load failed."); 337 component + " load failed.");
338 } 338 }
339 return NACL_NO_FILE_DESC; 339 return NACL_NO_FILE_DESC;
340 } 340 }
341 return file_desc_ok_to_close; 341 return info.desc;
342 } 342 }
343 343
344 PnaclCoordinator::PnaclCoordinator( 344 PnaclCoordinator::PnaclCoordinator(
345 Plugin* plugin, 345 Plugin* plugin,
346 const nacl::string& pexe_url, 346 const nacl::string& pexe_url,
347 const PnaclOptions& pnacl_options, 347 const PnaclOptions& pnacl_options,
348 const pp::CompletionCallback& translate_notify_callback) 348 const pp::CompletionCallback& translate_notify_callback)
349 : translate_finish_error_(PP_OK), 349 : translate_finish_error_(PP_OK),
350 plugin_(plugin), 350 plugin_(plugin),
351 translate_notify_callback_(translate_notify_callback), 351 translate_notify_callback_(translate_notify_callback),
(...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after
985 obj_file_.get(), 985 obj_file_.get(),
986 temp_nexe_file_.get(), 986 temp_nexe_file_.get(),
987 &error_info_, 987 &error_info_,
988 resources_.get(), 988 resources_.get(),
989 &pnacl_options_, 989 &pnacl_options_,
990 this, 990 this,
991 plugin_); 991 plugin_);
992 } 992 }
993 993
994 } // namespace plugin 994 } // namespace plugin
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698