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

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

Issue 235983020: Pepper: Move PnaclOptions outside trusted plugin. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: another build fix Created 6 years, 8 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 #ifndef NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PNACL_COORDINATOR_H_ 5 #ifndef NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PNACL_COORDINATOR_H_
6 #define NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PNACL_COORDINATOR_H_ 6 #define NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PNACL_COORDINATOR_H_
7 7
8 #include <set> 8 #include <set>
9 #include <map> 9 #include <map>
10 #include <vector> 10 #include <vector>
11 11
12 #include "native_client/src/include/nacl_macros.h" 12 #include "native_client/src/include/nacl_macros.h"
13 #include "native_client/src/include/nacl_string.h" 13 #include "native_client/src/include/nacl_string.h"
14 #include "native_client/src/shared/platform/nacl_sync_raii.h" 14 #include "native_client/src/shared/platform/nacl_sync_raii.h"
15 #include "native_client/src/shared/srpc/nacl_srpc.h" 15 #include "native_client/src/shared/srpc/nacl_srpc.h"
16 #include "native_client/src/trusted/desc/nacl_desc_wrapper.h" 16 #include "native_client/src/trusted/desc/nacl_desc_wrapper.h"
17 17
18 #include "ppapi/cpp/completion_callback.h" 18 #include "ppapi/cpp/completion_callback.h"
19 19
20 #include "ppapi/native_client/src/trusted/plugin/callback_source.h" 20 #include "ppapi/native_client/src/trusted/plugin/callback_source.h"
21 #include "ppapi/native_client/src/trusted/plugin/file_downloader.h" 21 #include "ppapi/native_client/src/trusted/plugin/file_downloader.h"
22 #include "ppapi/native_client/src/trusted/plugin/nacl_subprocess.h" 22 #include "ppapi/native_client/src/trusted/plugin/nacl_subprocess.h"
23 #include "ppapi/native_client/src/trusted/plugin/plugin_error.h" 23 #include "ppapi/native_client/src/trusted/plugin/plugin_error.h"
24 #include "ppapi/native_client/src/trusted/plugin/pnacl_options.h"
25 #include "ppapi/native_client/src/trusted/plugin/pnacl_resources.h" 24 #include "ppapi/native_client/src/trusted/plugin/pnacl_resources.h"
26 25
26 struct PP_PNaClOptions;
27 27
28 namespace plugin { 28 namespace plugin {
29 29
30 class Manifest; 30 class Manifest;
31 class Plugin; 31 class Plugin;
32 class PnaclCoordinator; 32 class PnaclCoordinator;
33 class PnaclTranslateThread; 33 class PnaclTranslateThread;
34 class TempFile; 34 class TempFile;
35 35
36 // A class invoked by Plugin to handle PNaCl client-side translation. 36 // A class invoked by Plugin to handle PNaCl client-side translation.
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 public: 79 public:
80 // Maximum number of object files passable to the translator. Cannot be 80 // Maximum number of object files passable to the translator. Cannot be
81 // changed without changing the RPC signatures. 81 // changed without changing the RPC signatures.
82 const static size_t kMaxTranslatorObjectFiles = 16; 82 const static size_t kMaxTranslatorObjectFiles = 16;
83 virtual ~PnaclCoordinator(); 83 virtual ~PnaclCoordinator();
84 84
85 // The factory method for translations. 85 // The factory method for translations.
86 static PnaclCoordinator* BitcodeToNative( 86 static PnaclCoordinator* BitcodeToNative(
87 Plugin* plugin, 87 Plugin* plugin,
88 const nacl::string& pexe_url, 88 const nacl::string& pexe_url,
89 const PnaclOptions& pnacl_options, 89 const PP_PNaClOptions& pnacl_options,
90 const pp::CompletionCallback& translate_notify_callback); 90 const pp::CompletionCallback& translate_notify_callback);
91 91
92 // Call this to take ownership of the FD of the translated nexe after 92 // Call this to take ownership of the FD of the translated nexe after
93 // BitcodeToNative has completed (and the finish_callback called). 93 // BitcodeToNative has completed (and the finish_callback called).
94 nacl::DescWrapper* ReleaseTranslatedFD(); 94 nacl::DescWrapper* ReleaseTranslatedFD();
95 95
96 // Run |translate_notify_callback_| with an error condition that is not 96 // Run |translate_notify_callback_| with an error condition that is not
97 // PPAPI specific. Also set ErrorInfo report. 97 // PPAPI specific. Also set ErrorInfo report.
98 void ReportNonPpapiError(PP_NaClError err, const nacl::string& message); 98 void ReportNonPpapiError(PP_NaClError err, const nacl::string& message);
99 // Run when faced with a PPAPI error condition. Bring control back to the 99 // Run when faced with a PPAPI error condition. Bring control back to the
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 expected_pexe_size_) < kProgressEventSlopPct; 137 expected_pexe_size_) < kProgressEventSlopPct;
138 } 138 }
139 139
140 private: 140 private:
141 NACL_DISALLOW_COPY_AND_ASSIGN(PnaclCoordinator); 141 NACL_DISALLOW_COPY_AND_ASSIGN(PnaclCoordinator);
142 142
143 // BitcodeToNative is the factory method for PnaclCoordinators. 143 // BitcodeToNative is the factory method for PnaclCoordinators.
144 // Therefore the constructor is private. 144 // Therefore the constructor is private.
145 PnaclCoordinator(Plugin* plugin, 145 PnaclCoordinator(Plugin* plugin,
146 const nacl::string& pexe_url, 146 const nacl::string& pexe_url,
147 const PnaclOptions& pnacl_options, 147 const PP_PNaClOptions& pnacl_options,
148 const pp::CompletionCallback& translate_notify_callback); 148 const pp::CompletionCallback& translate_notify_callback);
149 149
150 // Invoke to issue a GET request for bitcode. 150 // Invoke to issue a GET request for bitcode.
151 void OpenBitcodeStream(); 151 void OpenBitcodeStream();
152 // Invoked when we've started an URL fetch for the pexe to check for 152 // Invoked when we've started an URL fetch for the pexe to check for
153 // caching metadata. 153 // caching metadata.
154 void BitcodeStreamDidOpen(int32_t pp_error); 154 void BitcodeStreamDidOpen(int32_t pp_error);
155 155
156 // Callback for when the resource info JSON file has been read. 156 // Callback for when the resource info JSON file has been read.
157 void ResourceInfoWasRead(int32_t pp_error); 157 void ResourceInfoWasRead(int32_t pp_error);
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 204
205 // The manifest used by resource loading and ld + llc's reverse service 205 // The manifest used by resource loading and ld + llc's reverse service
206 // to look up objects and libraries. 206 // to look up objects and libraries.
207 nacl::scoped_ptr<const Manifest> manifest_; 207 nacl::scoped_ptr<const Manifest> manifest_;
208 // An auxiliary class that manages downloaded resources (llc and ld nexes). 208 // An auxiliary class that manages downloaded resources (llc and ld nexes).
209 nacl::scoped_ptr<PnaclResources> resources_; 209 nacl::scoped_ptr<PnaclResources> resources_;
210 210
211 // The URL for the pexe file. 211 // The URL for the pexe file.
212 nacl::string pexe_url_; 212 nacl::string pexe_url_;
213 // Options for translation. 213 // Options for translation.
214 PnaclOptions pnacl_options_; 214 PP_PNaClOptions pnacl_options_;
215 215
216 // Object file, produced by the translator and consumed by the linker. 216 // Object file, produced by the translator and consumed by the linker.
217 std::vector<TempFile*> obj_files_; 217 std::vector<TempFile*> obj_files_;
218 nacl::scoped_ptr<nacl::DescWrapper> invalid_desc_wrapper_; 218 nacl::scoped_ptr<nacl::DescWrapper> invalid_desc_wrapper_;
219 // Number of split modules (threads) for llc 219 // Number of split modules (threads) for llc
220 int split_module_count_; 220 int split_module_count_;
221 int num_object_files_opened_; 221 int num_object_files_opened_;
222 222
223 // Translated nexe file, produced by the linker. 223 // Translated nexe file, produced by the linker.
224 nacl::scoped_ptr<TempFile> temp_nexe_file_; 224 nacl::scoped_ptr<TempFile> temp_nexe_file_;
(...skipping 20 matching lines...) Expand all
245 // The helper thread used to do translations via SRPC. 245 // The helper thread used to do translations via SRPC.
246 // It accesses fields of PnaclCoordinator so it must have a 246 // It accesses fields of PnaclCoordinator so it must have a
247 // shorter lifetime. 247 // shorter lifetime.
248 nacl::scoped_ptr<PnaclTranslateThread> translate_thread_; 248 nacl::scoped_ptr<PnaclTranslateThread> translate_thread_;
249 }; 249 };
250 250
251 //---------------------------------------------------------------------- 251 //----------------------------------------------------------------------
252 252
253 } // namespace plugin; 253 } // namespace plugin;
254 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PNACL_COORDINATOR_H_ 254 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PNACL_COORDINATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698