| 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 #ifndef COMPONENTS_NACL_RENDERER_PLUGIN_PNACL_COORDINATOR_H_ | 5 #ifndef COMPONENTS_NACL_RENDERER_PLUGIN_PNACL_COORDINATOR_H_ |
| 6 #define COMPONENTS_NACL_RENDERER_PLUGIN_PNACL_COORDINATOR_H_ | 6 #define COMPONENTS_NACL_RENDERER_PLUGIN_PNACL_COORDINATOR_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 // subprocesses, one for llc and one for ld. | 104 // subprocesses, one for llc and one for ld. |
| 105 void LoadCompiler(); | 105 void LoadCompiler(); |
| 106 void RunCompile(int32_t pp_error, int64_t compile_load_start_time); | 106 void RunCompile(int32_t pp_error, int64_t compile_load_start_time); |
| 107 void LoadLinker(int32_t pp_error); | 107 void LoadLinker(int32_t pp_error); |
| 108 void RunLink(int32_t pp_error, int64_t ld_load_start_time); | 108 void RunLink(int32_t pp_error, int64_t ld_load_start_time); |
| 109 | 109 |
| 110 // Invoked when translation is finished. | 110 // Invoked when translation is finished. |
| 111 void TranslateFinished(int32_t pp_error); | 111 void TranslateFinished(int32_t pp_error); |
| 112 | 112 |
| 113 // Invoked when the read descriptor for nexe_file_ is created. | 113 // Invoked when the read descriptor for nexe_file_ is created. |
| 114 void NexeReadDidOpen(int32_t pp_error); | 114 void NexeReadDidOpen(bool success); |
| 115 | 115 |
| 116 // Bring control back to the plugin by invoking the | 116 // Bring control back to the plugin by invoking the |
| 117 // |translate_notify_callback_|. This does not set the ErrorInfo report, | 117 // |translate_notify_callback_|. This does not set the ErrorInfo report, |
| 118 // it is assumed that it was already set. | 118 // it is assumed that it was already set. |
| 119 void ExitWithError(); | 119 void ExitWithError(); |
| 120 // Run |translate_notify_callback_| with an error condition that is not | 120 // Run |translate_notify_callback_| with an error condition that is not |
| 121 // PPAPI specific. Also set ErrorInfo report. | 121 // PPAPI specific. Also set ErrorInfo report. |
| 122 void ReportNonPpapiError(PP_NaClError err, const std::string& message); | 122 void ReportNonPpapiError(PP_NaClError err, const std::string& message); |
| 123 // Run when faced with a PPAPI error condition. Bring control back to the | |
| 124 // plugin by invoking the |translate_notify_callback_|. | |
| 125 // Also set ErrorInfo report. | |
| 126 void ReportPpapiError(PP_NaClError err, | |
| 127 int32_t pp_error, const std::string& message); | |
| 128 | |
| 129 | 123 |
| 130 // Keeps track of the pp_error upon entry to TranslateFinished, | 124 // Keeps track of the pp_error upon entry to TranslateFinished, |
| 131 // for inspection after cleanup. | 125 // for inspection after cleanup. |
| 132 int32_t translate_finish_error_; | 126 int32_t translate_finish_error_; |
| 133 | 127 |
| 134 // The plugin owning the nexe for which we are doing translation. | 128 // The plugin owning the nexe for which we are doing translation. |
| 135 Plugin* plugin_; | 129 Plugin* plugin_; |
| 136 | 130 |
| 137 pp::CompletionCallback translate_notify_callback_; | 131 pp::CompletionCallback translate_notify_callback_; |
| 138 // Set to true when the translation (if applicable) is finished and the nexe | 132 // Set to true when the translation (if applicable) is finished and the nexe |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 // shorter lifetime. | 180 // shorter lifetime. |
| 187 scoped_ptr<PnaclTranslateThread> translate_thread_; | 181 scoped_ptr<PnaclTranslateThread> translate_thread_; |
| 188 | 182 |
| 189 DISALLOW_COPY_AND_ASSIGN(PnaclCoordinator); | 183 DISALLOW_COPY_AND_ASSIGN(PnaclCoordinator); |
| 190 }; | 184 }; |
| 191 | 185 |
| 192 //---------------------------------------------------------------------- | 186 //---------------------------------------------------------------------- |
| 193 | 187 |
| 194 } // namespace plugin; | 188 } // namespace plugin; |
| 195 #endif // COMPONENTS_NACL_RENDERER_PLUGIN_PNACL_COORDINATOR_H_ | 189 #endif // COMPONENTS_NACL_RENDERER_PLUGIN_PNACL_COORDINATOR_H_ |
| OLD | NEW |