OLD | NEW |
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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 void ReportLoadAbort(); | 139 void ReportLoadAbort(); |
140 | 140 |
141 // Write a text string on the JavaScript console. | 141 // Write a text string on the JavaScript console. |
142 void AddToConsole(const nacl::string& text); | 142 void AddToConsole(const nacl::string& text); |
143 | 143 |
144 // Dispatch a JavaScript event to indicate a key step in loading. | 144 // Dispatch a JavaScript event to indicate a key step in loading. |
145 // |event_type| is a character string indicating which type of progress | 145 // |event_type| is a character string indicating which type of progress |
146 // event (loadstart, progress, error, abort, load, loadend). Events are | 146 // event (loadstart, progress, error, abort, load, loadend). Events are |
147 // enqueued on the JavaScript event loop, which then calls back through | 147 // enqueued on the JavaScript event loop, which then calls back through |
148 // DispatchProgressEvent. | 148 // DispatchProgressEvent. |
149 void EnqueueProgressEvent(const char* event_type); | 149 void EnqueueProgressEvent(PP_NaClEventType event_type); |
150 void EnqueueProgressEvent(const char* event_type, | 150 void EnqueueProgressEvent(PP_NaClEventType event_type, |
151 const nacl::string& url, | 151 const nacl::string& url, |
152 LengthComputable length_computable, | 152 LengthComputable length_computable, |
153 uint64_t loaded_bytes, | 153 uint64_t loaded_bytes, |
154 uint64_t total_bytes); | 154 uint64_t total_bytes); |
155 | 155 |
156 // Progress event types. | |
157 static const char* const kProgressEventLoadStart; | |
158 static const char* const kProgressEventProgress; | |
159 static const char* const kProgressEventError; | |
160 static const char* const kProgressEventAbort; | |
161 static const char* const kProgressEventLoad; | |
162 static const char* const kProgressEventLoadEnd; | |
163 static const char* const kProgressEventCrash; | |
164 | |
165 // Report the error code that sel_ldr produces when starting a nexe. | 156 // Report the error code that sel_ldr produces when starting a nexe. |
166 void ReportSelLdrLoadStatus(int status); | 157 void ReportSelLdrLoadStatus(int status); |
167 | 158 |
168 // Report nexe death after load to JS and shut down the proxy. | 159 // Report nexe death after load to JS and shut down the proxy. |
169 void ReportDeadNexe(); | 160 void ReportDeadNexe(); |
170 | 161 |
171 // URL resolution support. | 162 // URL resolution support. |
172 // plugin_base_url is the URL used for resolving relative URLs used in | 163 // plugin_base_url is the URL used for resolving relative URLs used in |
173 // src="...". | 164 // src="...". |
174 nacl::string plugin_base_url() const { return plugin_base_url_; } | 165 nacl::string plugin_base_url() const { return plugin_base_url_; } |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 const FileDownloader* FindFileDownloader(PP_Resource url_loader) const; | 482 const FileDownloader* FindFileDownloader(PP_Resource url_loader) const; |
492 | 483 |
493 int64_t time_of_last_progress_event_; | 484 int64_t time_of_last_progress_event_; |
494 | 485 |
495 const PPB_NaCl_Private* nacl_interface_; | 486 const PPB_NaCl_Private* nacl_interface_; |
496 }; | 487 }; |
497 | 488 |
498 } // namespace plugin | 489 } // namespace plugin |
499 | 490 |
500 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PLUGIN_H_ | 491 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PLUGIN_H_ |
OLD | NEW |