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 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
505 // A pointer to the browser end of a proxy pattern connecting the | 506 // A pointer to the browser end of a proxy pattern connecting the |
506 // NaCl plugin to the PPAPI .nexe's PPP interface | 507 // NaCl plugin to the PPAPI .nexe's PPP interface |
507 // (InitializeModule, Shutdown, and GetInterface). | 508 // (InitializeModule, Shutdown, and GetInterface). |
508 // TODO(sehr): this should be a scoped_ptr for shutdown. | 509 // TODO(sehr): this should be a scoped_ptr for shutdown. |
509 ppapi_proxy::BrowserPpp* ppapi_proxy_; | 510 ppapi_proxy::BrowserPpp* ppapi_proxy_; |
510 | 511 |
511 // PPAPI Dev interfaces are disabled by default. | 512 // PPAPI Dev interfaces are disabled by default. |
512 bool enable_dev_interfaces_; | 513 bool enable_dev_interfaces_; |
513 | 514 |
514 // If we get a DidChangeView event before the nexe is loaded, we store it and | 515 // If we get a DidChangeView event before the nexe is loaded, we store it and |
515 // replay it to nexe after it's loaded. | 516 // replay it to nexe after it's loaded. We need to replay when this View |
516 bool replayDidChangeView; | 517 // resource is non-is_null(). |
517 pp::Rect replayDidChangeViewPosition; | 518 pp::View view_to_replay_; |
518 pp::Rect replayDidChangeViewClip; | |
519 | 519 |
520 // If we get a HandleDocumentLoad event before the nexe is loaded, we store | 520 // If we get a HandleDocumentLoad event before the nexe is loaded, we store |
521 // it and replay it to nexe after it's loaded. | 521 // it and replay it to nexe after it's loaded. We need to replay when this |
522 bool replayHandleDocumentLoad; | 522 // URLLoader resource is non-is_null(). |
523 pp::URLLoader replayHandleDocumentLoadURLLoader; | 523 pp::URLLoader document_load_to_replay_; |
524 | 524 |
525 nacl::string mime_type_; | 525 nacl::string mime_type_; |
526 | 526 |
527 // Keep track of the FileDownloaders created to fetch urls. | 527 // Keep track of the FileDownloaders created to fetch urls. |
528 std::set<FileDownloader*> url_downloaders_; | 528 std::set<FileDownloader*> url_downloaders_; |
529 // Keep track of file descriptors opened by StreamAsFile(). | 529 // Keep track of file descriptors opened by StreamAsFile(). |
530 // These are owned by the browser. | 530 // These are owned by the browser. |
531 std::map<nacl::string, int32_t> url_fd_map_; | 531 std::map<nacl::string, int32_t> url_fd_map_; |
532 | 532 |
533 // Pending progress events. | 533 // Pending progress events. |
(...skipping 28 matching lines...) Expand all Loading... |
562 // in UpdateDownloadProgress to map a url loader back to the URL being | 562 // in UpdateDownloadProgress to map a url loader back to the URL being |
563 // downloaded. | 563 // downloaded. |
564 const FileDownloader* FindFileDownloader(PP_Resource url_loader) const; | 564 const FileDownloader* FindFileDownloader(PP_Resource url_loader) const; |
565 | 565 |
566 int64_t time_of_last_progress_event_; | 566 int64_t time_of_last_progress_event_; |
567 }; | 567 }; |
568 | 568 |
569 } // namespace plugin | 569 } // namespace plugin |
570 | 570 |
571 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PLUGIN_H_ | 571 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PLUGIN_H_ |
OLD | NEW |