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 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 // Getter for PPAPI proxy interface. | 292 // Getter for PPAPI proxy interface. |
293 ppapi_proxy::BrowserPpp* ppapi_proxy() const { return ppapi_proxy_; } | 293 ppapi_proxy::BrowserPpp* ppapi_proxy() const { return ppapi_proxy_; } |
294 | 294 |
295 // Called back by CallOnMainThread. Dispatches the first enqueued progress | 295 // Called back by CallOnMainThread. Dispatches the first enqueued progress |
296 // event. | 296 // event. |
297 void DispatchProgressEvent(int32_t result); | 297 void DispatchProgressEvent(int32_t result); |
298 | 298 |
299 // Requests a URL asynchronously resulting in a call to pp_callback with | 299 // Requests a URL asynchronously resulting in a call to pp_callback with |
300 // a PP_Error indicating status. On success an open file descriptor | 300 // a PP_Error indicating status. On success an open file descriptor |
301 // corresponding to the url body is recorded for further lookup. | 301 // corresponding to the url body is recorded for further lookup. |
302 // permits_extension_urls determines whether a call to stream as file | |
303 // should be allowed to load URLs that are outside of the origin of the | |
304 // plugin. This is used by, e.g., the pnacl coordinator, which loads | |
305 // llc, ld, and various object files from a chrome extension URL. | |
306 bool StreamAsFile(const nacl::string& url, | 302 bool StreamAsFile(const nacl::string& url, |
307 bool permits_extension_urls, | |
308 PP_CompletionCallback pp_callback); | 303 PP_CompletionCallback pp_callback); |
309 // Returns an open POSIX file descriptor retrieved by StreamAsFile() | 304 // Returns an open POSIX file descriptor retrieved by StreamAsFile() |
310 // or NACL_NO_FILE_DESC. The caller must take ownership of the descriptor. | 305 // or NACL_NO_FILE_DESC. The caller must take ownership of the descriptor. |
311 int32_t GetPOSIXFileDesc(const nacl::string& url); | 306 int32_t GetPOSIXFileDesc(const nacl::string& url); |
312 | 307 |
313 // A helper function that gets the scheme type for |url|. Uses URLUtil_Dev | 308 // A helper function that gets the scheme type for |url|. Uses URLUtil_Dev |
314 // interface which this class has as a member. | 309 // interface which this class has as a member. |
315 UrlSchemeType GetUrlScheme(const std::string& url); | 310 UrlSchemeType GetUrlScheme(const std::string& url); |
316 | 311 |
317 // Get the text description of the last error reported by the plugin. | 312 // Get the text description of the last error reported by the plugin. |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
570 // in UpdateDownloadProgress to map a url loader back to the URL being | 565 // in UpdateDownloadProgress to map a url loader back to the URL being |
571 // downloaded. | 566 // downloaded. |
572 const FileDownloader* FindFileDownloader(PP_Resource url_loader) const; | 567 const FileDownloader* FindFileDownloader(PP_Resource url_loader) const; |
573 | 568 |
574 int64_t time_of_last_progress_event_; | 569 int64_t time_of_last_progress_event_; |
575 }; | 570 }; |
576 | 571 |
577 } // namespace plugin | 572 } // namespace plugin |
578 | 573 |
579 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PLUGIN_H_ | 574 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PLUGIN_H_ |
OLD | NEW |