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

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

Issue 131413009: Prototype: Use Chromium IPC for plugin LOAD_MODULE. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased, some FIXMEs cleaned up Created 6 years, 10 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 // -*- c++ -*- 1 // -*- c++ -*-
2 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be 3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file. 4 // found in the LICENSE file.
5 5
6 // The portable representation of an instance and root scriptable object. 6 // The portable representation of an instance and root scriptable object.
7 // The PPAPI version of the plugin instantiates a subclass of this class. 7 // The PPAPI version of the plugin instantiates a subclass of this class.
8 8
9 #ifndef NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PLUGIN_H_ 9 #ifndef NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PLUGIN_H_
10 #define NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PLUGIN_H_ 10 #define NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PLUGIN_H_
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 // mechanism(s) take over. 94 // mechanism(s) take over.
95 // 95 //
96 // Updates nacl_module_origin() and nacl_module_url(). 96 // Updates nacl_module_origin() and nacl_module_url().
97 void LoadNaClModule(nacl::DescWrapper* wrapper, 97 void LoadNaClModule(nacl::DescWrapper* wrapper,
98 bool enable_dyncode_syscalls, 98 bool enable_dyncode_syscalls,
99 bool enable_exception_handling, 99 bool enable_exception_handling,
100 bool enable_crash_throttling, 100 bool enable_crash_throttling,
101 const pp::CompletionCallback& init_done_cb, 101 const pp::CompletionCallback& init_done_cb,
102 const pp::CompletionCallback& crash_cb); 102 const pp::CompletionCallback& crash_cb);
103 103
104 void LoadNexeOnMainThread(int32_t pp_error,
105 ServiceRuntime* service_runtime,
106 nacl::DescWrapper* wrapper,
107 const pp::CompletionCallback& crash_cb);
108
104 // Finish hooking interfaces up, after low-level initialization is 109 // Finish hooking interfaces up, after low-level initialization is
105 // complete. 110 // complete.
106 bool LoadNaClModuleContinuationIntern(ErrorInfo* error_info); 111 bool LoadNaClModuleContinuationIntern(ErrorInfo* error_info);
107 112
108 // Continuation for starting SRPC/JSProxy services as appropriate. 113 // Continuation for starting SRPC/JSProxy services as appropriate.
109 // This is invoked as a callback when the NaCl module makes the 114 // This is invoked as a callback when the NaCl module makes the
110 // init_done reverse RPC to tell us that low-level initialization 115 // init_done reverse RPC to tell us that low-level initialization
111 // such as ld.so processing is done. That initialization requires 116 // such as ld.so processing is done. That initialization requires
112 // that the main thread be free in order to do Pepper 117 // that the main thread be free in order to do Pepper
113 // main-thread-only operations such as file processing. 118 // main-thread-only operations such as file processing.
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 void HistogramEnumerateOsArch(const std::string& sandbox_isa); 298 void HistogramEnumerateOsArch(const std::string& sandbox_isa);
294 void HistogramEnumerateLoadStatus(PluginErrorCode error_code, 299 void HistogramEnumerateLoadStatus(PluginErrorCode error_code,
295 bool is_installed); 300 bool is_installed);
296 void HistogramEnumerateSelLdrLoadStatus(NaClErrorCode error_code, 301 void HistogramEnumerateSelLdrLoadStatus(NaClErrorCode error_code,
297 bool is_installed); 302 bool is_installed);
298 void HistogramEnumerateManifestIsDataURI(bool is_data_uri); 303 void HistogramEnumerateManifestIsDataURI(bool is_data_uri);
299 void HistogramHTTPStatusCode(const std::string& name, int status); 304 void HistogramHTTPStatusCode(const std::string& name, int status);
300 305
301 // Help load a nacl module, from the file specified in wrapper. 306 // Help load a nacl module, from the file specified in wrapper.
302 // This will fully initialize the |subprocess| if the load was successful. 307 // This will fully initialize the |subprocess| if the load was successful.
303 bool LoadNaClModuleCommon(nacl::DescWrapper* wrapper, 308 bool LoadNaClModuleFromBackgroundThread(
304 NaClSubprocess* subprocess, 309 nacl::DescWrapper* wrapper,
305 const Manifest* manifest, 310 NaClSubprocess* subprocess,
306 bool should_report_uma, 311 const Manifest* manifest,
307 const SelLdrStartParams& params, 312 const SelLdrStartParams& params);
308 const pp::CompletionCallback& init_done_cb,
309 const pp::CompletionCallback& crash_cb);
310 313
311 // Start sel_ldr from the main thread, given the start params. 314 // Start sel_ldr from the main thread, given the start params.
312 // Sets |success| to true on success. 315 // Sets |success| to true on success.
313 // |pp_error| is set by CallOnMainThread (should be PP_OK). 316 // |pp_error| is set by CallOnMainThread (should be PP_OK).
314 void StartSelLdrOnMainThread(int32_t pp_error, 317 void StartSelLdrOnMainThread(int32_t pp_error,
315 ServiceRuntime* service_runtime, 318 ServiceRuntime* service_runtime,
316 const SelLdrStartParams& params, 319 const SelLdrStartParams& params,
317 bool* success); 320 PP_CompletionCallback callback);
321
322 void SignalStartSelLdrDone(int32_t pp_error, ServiceRuntime* service_runtime);
318 323
319 // Callback used when getting the URL for the .nexe file. If the URL loading 324 // Callback used when getting the URL for the .nexe file. If the URL loading
320 // is successful, the file descriptor is opened and can be passed to sel_ldr 325 // is successful, the file descriptor is opened and can be passed to sel_ldr
321 // with the sandbox on. 326 // with the sandbox on.
322 void NexeFileDidOpen(int32_t pp_error); 327 void NexeFileDidOpen(int32_t pp_error);
323 void NexeFileDidOpenContinuation(int32_t pp_error); 328 void NexeFileDidOpenContinuation(int32_t pp_error);
324 329
325 // Callback used when the reverse channel closes. This is an 330 // Callback used when the reverse channel closes. This is an
326 // asynchronous event that might turn into a JavaScript error or 331 // asynchronous event that might turn into a JavaScript error or
327 // crash event -- this is controlled by the two state variables 332 // crash event -- this is controlled by the two state variables
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 char** argv_; 404 char** argv_;
400 405
401 // Keep track of the NaCl module subprocess that was spun up in the plugin. 406 // Keep track of the NaCl module subprocess that was spun up in the plugin.
402 NaClSubprocess main_subprocess_; 407 NaClSubprocess main_subprocess_;
403 408
404 nacl::string plugin_base_url_; 409 nacl::string plugin_base_url_;
405 nacl::string manifest_base_url_; 410 nacl::string manifest_base_url_;
406 nacl::string manifest_url_; 411 nacl::string manifest_url_;
407 ReadyState nacl_ready_state_; 412 ReadyState nacl_ready_state_;
408 bool nexe_error_reported_; // error or crash reported 413 bool nexe_error_reported_; // error or crash reported
414 bool start_sel_ldr_success_;
409 415
410 nacl::DescWrapperFactory* wrapper_factory_; 416 nacl::DescWrapperFactory* wrapper_factory_;
411 417
412 // File download support. |nexe_downloader_| can be opened with a specific 418 // File download support. |nexe_downloader_| can be opened with a specific
413 // callback to run when the file has been downloaded and is opened for 419 // callback to run when the file has been downloaded and is opened for
414 // reading. We use one downloader for all URL downloads to prevent issuing 420 // reading. We use one downloader for all URL downloads to prevent issuing
415 // multiple GETs that might arrive out of order. For example, this will 421 // multiple GETs that might arrive out of order. For example, this will
416 // prevent a GET of a NaCl manifest while a .nexe GET is pending. Note that 422 // prevent a GET of a NaCl manifest while a .nexe GET is pending. Note that
417 // this will also prevent simultaneous handling of multiple .nexes on a page. 423 // this will also prevent simultaneous handling of multiple .nexes on a page.
418 FileDownloader nexe_downloader_; 424 FileDownloader nexe_downloader_;
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 int64_t time_of_last_progress_event_; 490 int64_t time_of_last_progress_event_;
485 int exit_status_; 491 int exit_status_;
486 492
487 const PPB_NaCl_Private* nacl_interface_; 493 const PPB_NaCl_Private* nacl_interface_;
488 pp::UMAPrivate uma_interface_; 494 pp::UMAPrivate uma_interface_;
489 }; 495 };
490 496
491 } // namespace plugin 497 } // namespace plugin
492 498
493 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PLUGIN_H_ 499 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PLUGIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698