| OLD | NEW |
| 1 // -*- c++ -*- | 1 // -*- c++ -*- |
| 2 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 // Copyright (c) 2011 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 15 matching lines...) Expand all Loading... |
| 26 #include "native_client/src/trusted/plugin/pnacl_coordinator.h" | 26 #include "native_client/src/trusted/plugin/pnacl_coordinator.h" |
| 27 #include "native_client/src/trusted/plugin/service_runtime.h" | 27 #include "native_client/src/trusted/plugin/service_runtime.h" |
| 28 #include "native_client/src/trusted/plugin/utility.h" | 28 #include "native_client/src/trusted/plugin/utility.h" |
| 29 | 29 |
| 30 #include "ppapi/cpp/private/var_private.h" | 30 #include "ppapi/cpp/private/var_private.h" |
| 31 // for pp::VarPrivate | 31 // for pp::VarPrivate |
| 32 #include "ppapi/cpp/private/instance_private.h" | 32 #include "ppapi/cpp/private/instance_private.h" |
| 33 #include "ppapi/cpp/rect.h" | 33 #include "ppapi/cpp/rect.h" |
| 34 #include "ppapi/cpp/url_loader.h" | 34 #include "ppapi/cpp/url_loader.h" |
| 35 #include "ppapi/cpp/var.h" | 35 #include "ppapi/cpp/var.h" |
| 36 #include "ppapi/cpp/view.h" |
| 36 | 37 |
| 37 struct NaClSrpcChannel; | 38 struct NaClSrpcChannel; |
| 38 | 39 |
| 39 namespace nacl { | 40 namespace nacl { |
| 40 class DescWrapper; | 41 class DescWrapper; |
| 41 class DescWrapperFactory; | 42 class DescWrapperFactory; |
| 42 } // namespace nacl | 43 } // namespace nacl |
| 43 | 44 |
| 44 namespace pp { | 45 namespace pp { |
| 45 class Find_Dev; | 46 class Find_Dev; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 static Plugin* New(PP_Instance instance); | 78 static Plugin* New(PP_Instance instance); |
| 78 | 79 |
| 79 // ----- Methods inherited from pp::Instance: | 80 // ----- Methods inherited from pp::Instance: |
| 80 | 81 |
| 81 // Initializes this plugin with <embed/object ...> tag attribute count |argc|, | 82 // Initializes this plugin with <embed/object ...> tag attribute count |argc|, |
| 82 // names |argn| and values |argn|. Returns false on failure. | 83 // names |argn| and values |argn|. Returns false on failure. |
| 83 // Gets called by the browser right after New(). | 84 // Gets called by the browser right after New(). |
| 84 virtual bool Init(uint32_t argc, const char* argn[], const char* argv[]); | 85 virtual bool Init(uint32_t argc, const char* argn[], const char* argv[]); |
| 85 | 86 |
| 86 // Handles view changes from the browser. | 87 // Handles view changes from the browser. |
| 87 virtual void DidChangeView(const pp::Rect& position, const pp::Rect& clip); | 88 virtual void DidChangeView(const pp::View& view); |
| 88 | 89 |
| 89 // Handles gaining or losing focus. | 90 // Handles gaining or losing focus. |
| 90 virtual void DidChangeFocus(bool has_focus); | 91 virtual void DidChangeFocus(bool has_focus); |
| 91 | 92 |
| 92 // Handles input events delivered from the browser to this plugin element. | 93 // Handles input events delivered from the browser to this plugin element. |
| 93 virtual bool HandleInputEvent(const pp::InputEvent& event); | 94 virtual bool HandleInputEvent(const pp::InputEvent& event); |
| 94 | 95 |
| 95 // Handles gaining or losing focus. | 96 // Handles gaining or losing focus. |
| 96 virtual bool HandleDocumentLoad(const pp::URLLoader& url_loader); | 97 virtual bool HandleDocumentLoad(const pp::URLLoader& url_loader); |
| 97 | 98 |
| (...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 512 // A pointer to the browser end of a proxy pattern connecting the | 513 // A pointer to the browser end of a proxy pattern connecting the |
| 513 // NaCl plugin to the PPAPI .nexe's PPP interface | 514 // NaCl plugin to the PPAPI .nexe's PPP interface |
| 514 // (InitializeModule, Shutdown, and GetInterface). | 515 // (InitializeModule, Shutdown, and GetInterface). |
| 515 // TODO(sehr): this should be a scoped_ptr for shutdown. | 516 // TODO(sehr): this should be a scoped_ptr for shutdown. |
| 516 ppapi_proxy::BrowserPpp* ppapi_proxy_; | 517 ppapi_proxy::BrowserPpp* ppapi_proxy_; |
| 517 | 518 |
| 518 // PPAPI Dev interfaces are disabled by default. | 519 // PPAPI Dev interfaces are disabled by default. |
| 519 bool enable_dev_interfaces_; | 520 bool enable_dev_interfaces_; |
| 520 | 521 |
| 521 // If we get a DidChangeView event before the nexe is loaded, we store it and | 522 // If we get a DidChangeView event before the nexe is loaded, we store it and |
| 522 // replay it to nexe after it's loaded. | 523 // replay it to nexe after it's loaded. We need to replay when this View |
| 523 bool replayDidChangeView; | 524 // resource is non-is_null(). |
| 524 pp::Rect replayDidChangeViewPosition; | 525 pp::View view_to_replay_; |
| 525 pp::Rect replayDidChangeViewClip; | |
| 526 | 526 |
| 527 // If we get a HandleDocumentLoad event before the nexe is loaded, we store | 527 // If we get a HandleDocumentLoad event before the nexe is loaded, we store |
| 528 // it and replay it to nexe after it's loaded. | 528 // it and replay it to nexe after it's loaded. We need to replay when this |
| 529 bool replayHandleDocumentLoad; | 529 // URLLoader resource is non-is_null(). |
| 530 pp::URLLoader replayHandleDocumentLoadURLLoader; | 530 pp::URLLoader document_load_to_replay_; |
| 531 | 531 |
| 532 nacl::string mime_type_; | 532 nacl::string mime_type_; |
| 533 | 533 |
| 534 // Keep track of the FileDownloaders created to fetch urls. | 534 // Keep track of the FileDownloaders created to fetch urls. |
| 535 std::set<FileDownloader*> url_downloaders_; | 535 std::set<FileDownloader*> url_downloaders_; |
| 536 // Keep track of file descriptors opened by StreamAsFile(). | 536 // Keep track of file descriptors opened by StreamAsFile(). |
| 537 // These are owned by the browser. | 537 // These are owned by the browser. |
| 538 std::map<nacl::string, int32_t> url_fd_map_; | 538 std::map<nacl::string, int32_t> url_fd_map_; |
| 539 | 539 |
| 540 // Pending progress events. | 540 // Pending progress events. |
| (...skipping 28 matching lines...) Expand all Loading... |
| 569 // in UpdateDownloadProgress to map a url loader back to the URL being | 569 // in UpdateDownloadProgress to map a url loader back to the URL being |
| 570 // downloaded. | 570 // downloaded. |
| 571 const FileDownloader* FindFileDownloader(PP_Resource url_loader) const; | 571 const FileDownloader* FindFileDownloader(PP_Resource url_loader) const; |
| 572 | 572 |
| 573 int64_t time_of_last_progress_event_; | 573 int64_t time_of_last_progress_event_; |
| 574 }; | 574 }; |
| 575 | 575 |
| 576 } // namespace plugin | 576 } // namespace plugin |
| 577 | 577 |
| 578 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PLUGIN_H_ | 578 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PLUGIN_H_ |
| OLD | NEW |