| 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 |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/files/file.h" | 13 #include "base/files/file.h" |
| 14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 16 #include "base/time/time.h" |
| 16 #include "components/nacl/renderer/plugin/nacl_subprocess.h" | 17 #include "components/nacl/renderer/plugin/nacl_subprocess.h" |
| 17 #include "components/nacl/renderer/plugin/plugin_error.h" | 18 #include "components/nacl/renderer/plugin/plugin_error.h" |
| 18 #include "components/nacl/renderer/plugin/pnacl_resources.h" | 19 #include "components/nacl/renderer/plugin/pnacl_resources.h" |
| 19 #include "ppapi/cpp/completion_callback.h" | 20 #include "ppapi/cpp/completion_callback.h" |
| 20 #include "ppapi/utility/completion_callback_factory.h" | 21 #include "ppapi/utility/completion_callback_factory.h" |
| 21 | 22 |
| 22 struct PP_PNaClOptions; | 23 struct PP_PNaClOptions; |
| 23 | 24 |
| 24 namespace plugin { | 25 namespace plugin { |
| 25 | 26 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 | 97 |
| 97 // Invoke to issue a GET request for bitcode. | 98 // Invoke to issue a GET request for bitcode. |
| 98 void OpenBitcodeStream(); | 99 void OpenBitcodeStream(); |
| 99 | 100 |
| 100 // Invoked when a pexe data chunk is compiled. | 101 // Invoked when a pexe data chunk is compiled. |
| 101 void BitcodeGotCompiled(int32_t pp_error, int64_t bytes_compiled); | 102 void BitcodeGotCompiled(int32_t pp_error, int64_t bytes_compiled); |
| 102 // Once llc and ld nexes have been loaded and the two temporary files have | 103 // Once llc and ld nexes have been loaded and the two temporary files have |
| 103 // been created, this starts the translation. Translation starts two | 104 // been created, this starts the translation. Translation starts two |
| 104 // subprocesses, one for llc and one for ld. | 105 // subprocesses, one for llc and one for ld. |
| 105 void LoadCompiler(); | 106 void LoadCompiler(); |
| 106 void RunCompile(int32_t pp_error, int64_t compile_load_start_time); | 107 void RunCompile(int32_t pp_error, base::TimeTicks compile_load_start_time); |
| 107 void LoadLinker(int32_t pp_error); | 108 void LoadLinker(int32_t pp_error); |
| 108 void RunLink(int32_t pp_error, int64_t ld_load_start_time); | 109 void RunLink(int32_t pp_error, base::TimeTicks ld_load_start_time); |
| 109 | 110 |
| 110 // Invoked when translation is finished. | 111 // Invoked when translation is finished. |
| 111 void TranslateFinished(int32_t pp_error); | 112 void TranslateFinished(int32_t pp_error); |
| 112 | 113 |
| 113 // Invoked when the read descriptor for nexe_file_ is created. | 114 // Invoked when the read descriptor for nexe_file_ is created. |
| 114 void NexeReadDidOpen(); | 115 void NexeReadDidOpen(); |
| 115 | 116 |
| 116 // Bring control back to the plugin by invoking the | 117 // Bring control back to the plugin by invoking the |
| 117 // |translate_notify_callback_|. This does not set the ErrorInfo report, | 118 // |translate_notify_callback_|. This does not set the ErrorInfo report, |
| 118 // it is assumed that it was already set. | 119 // it is assumed that it was already set. |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 // shorter lifetime. | 181 // shorter lifetime. |
| 181 scoped_ptr<PnaclTranslateThread> translate_thread_; | 182 scoped_ptr<PnaclTranslateThread> translate_thread_; |
| 182 | 183 |
| 183 DISALLOW_COPY_AND_ASSIGN(PnaclCoordinator); | 184 DISALLOW_COPY_AND_ASSIGN(PnaclCoordinator); |
| 184 }; | 185 }; |
| 185 | 186 |
| 186 //---------------------------------------------------------------------- | 187 //---------------------------------------------------------------------- |
| 187 | 188 |
| 188 } // namespace plugin; | 189 } // namespace plugin; |
| 189 #endif // COMPONENTS_NACL_RENDERER_PLUGIN_PNACL_COORDINATOR_H_ | 190 #endif // COMPONENTS_NACL_RENDERER_PLUGIN_PNACL_COORDINATOR_H_ |
| OLD | NEW |