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 "ppapi/native_client/src/trusted/plugin/pnacl_resources.h" | 5 #include "ppapi/native_client/src/trusted/plugin/pnacl_resources.h" |
6 | 6 |
7 #include "native_client/src/include/portability_io.h" | 7 #include "native_client/src/include/portability_io.h" |
8 #include "native_client/src/shared/platform/nacl_check.h" | 8 #include "native_client/src/shared/platform/nacl_check.h" |
9 #include "native_client/src/trusted/desc/nacl_desc_wrapper.h" | 9 #include "native_client/src/trusted/desc/nacl_desc_wrapper.h" |
10 #include "ppapi/c/pp_errors.h" | 10 #include "ppapi/c/pp_errors.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 CloseFileHandle(llc_file_info_.handle); | 35 CloseFileHandle(llc_file_info_.handle); |
36 if (ld_file_info_.handle != PP_kInvalidFileHandle) | 36 if (ld_file_info_.handle != PP_kInvalidFileHandle) |
37 CloseFileHandle(ld_file_info_.handle); | 37 CloseFileHandle(ld_file_info_.handle); |
38 } | 38 } |
39 | 39 |
40 bool PnaclResources::ReadResourceInfo() { | 40 bool PnaclResources::ReadResourceInfo() { |
41 PP_Var pp_llc_tool_name_var; | 41 PP_Var pp_llc_tool_name_var; |
42 PP_Var pp_ld_tool_name_var; | 42 PP_Var pp_ld_tool_name_var; |
43 if (!plugin_->nacl_interface()->GetPnaclResourceInfo( | 43 if (!plugin_->nacl_interface()->GetPnaclResourceInfo( |
44 plugin_->pp_instance(), | 44 plugin_->pp_instance(), |
45 "chrome://pnacl-translator/pnacl.json", | |
46 &pp_llc_tool_name_var, | 45 &pp_llc_tool_name_var, |
47 &pp_ld_tool_name_var)) { | 46 &pp_ld_tool_name_var)) { |
48 return false; | 47 return false; |
49 } | 48 } |
50 pp::Var llc_tool_name(pp::PASS_REF, pp_llc_tool_name_var); | 49 pp::Var llc_tool_name(pp::PASS_REF, pp_llc_tool_name_var); |
51 pp::Var ld_tool_name(pp::PASS_REF, pp_ld_tool_name_var); | 50 pp::Var ld_tool_name(pp::PASS_REF, pp_ld_tool_name_var); |
52 llc_tool_name_ = GetFullUrl(llc_tool_name.AsString()); | 51 llc_tool_name_ = GetFullUrl(llc_tool_name.AsString()); |
53 ld_tool_name_ = GetFullUrl(ld_tool_name.AsString()); | 52 ld_tool_name_ = GetFullUrl(ld_tool_name.AsString()); |
54 return true; | 53 return true; |
55 } | 54 } |
(...skipping 16 matching lines...) Expand all Loading... |
72 // Do a blocking load of each of the resources. | 71 // Do a blocking load of each of the resources. |
73 plugin_->nacl_interface()->GetReadExecPnaclFd(llc_tool_name_.c_str(), | 72 plugin_->nacl_interface()->GetReadExecPnaclFd(llc_tool_name_.c_str(), |
74 &llc_file_info_); | 73 &llc_file_info_); |
75 plugin_->nacl_interface()->GetReadExecPnaclFd(ld_tool_name_.c_str(), | 74 plugin_->nacl_interface()->GetReadExecPnaclFd(ld_tool_name_.c_str(), |
76 &ld_file_info_); | 75 &ld_file_info_); |
77 return (llc_file_info_.handle != PP_kInvalidFileHandle && | 76 return (llc_file_info_.handle != PP_kInvalidFileHandle && |
78 ld_file_info_.handle != PP_kInvalidFileHandle); | 77 ld_file_info_.handle != PP_kInvalidFileHandle); |
79 } | 78 } |
80 | 79 |
81 } // namespace plugin | 80 } // namespace plugin |
OLD | NEW |