| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_BROWSER_PPP_H_ | 5 #ifndef NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_BROWSER_PPP_H_ |
| 6 #define NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_BROWSER_PPP_H_ | 6 #define NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_BROWSER_PPP_H_ |
| 7 | 7 |
| 8 #include <stdarg.h> | 8 #include <stdarg.h> |
| 9 | 9 |
| 10 #include "native_client/src/include/nacl_macros.h" | 10 #include "native_client/src/include/nacl_macros.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 class Plugin; | 23 class Plugin; |
| 24 } | 24 } |
| 25 | 25 |
| 26 namespace ppapi_proxy { | 26 namespace ppapi_proxy { |
| 27 | 27 |
| 28 class BrowserPpp { | 28 class BrowserPpp { |
| 29 public: | 29 public: |
| 30 BrowserPpp(NaClSrpcChannel* main_channel, plugin::Plugin* plugin) | 30 BrowserPpp(NaClSrpcChannel* main_channel, plugin::Plugin* plugin) |
| 31 : main_channel_(main_channel), | 31 : main_channel_(main_channel), |
| 32 is_nexe_alive_(true), | 32 is_nexe_alive_(true), |
| 33 plugin_pid_(0), | |
| 34 plugin_(plugin), | 33 plugin_(plugin), |
| 35 ppp_instance_interface_(NULL), | 34 ppp_instance_interface_(NULL), |
| 36 ppp_messaging_interface_(NULL), | 35 ppp_messaging_interface_(NULL), |
| 37 ppp_input_event_interface_(NULL) { | 36 ppp_input_event_interface_(NULL) { |
| 38 CHECK(main_channel_ != NULL); | 37 CHECK(main_channel_ != NULL); |
| 39 upcall_thread_.tid = 0; | 38 upcall_thread_.tid = 0; |
| 40 } | 39 } |
| 41 | 40 |
| 42 ~BrowserPpp() {} | 41 ~BrowserPpp() {} |
| 43 | 42 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 65 const PPP_InputEvent* ppp_input_event_interface() const { | 64 const PPP_InputEvent* ppp_input_event_interface() const { |
| 66 return ppp_input_event_interface_; | 65 return ppp_input_event_interface_; |
| 67 } | 66 } |
| 68 | 67 |
| 69 bool is_valid() const { return is_nexe_alive_; } | 68 bool is_valid() const { return is_nexe_alive_; } |
| 70 static bool is_valid(BrowserPpp* proxy) { | 69 static bool is_valid(BrowserPpp* proxy) { |
| 71 return (proxy != NULL && proxy->is_valid()); | 70 return (proxy != NULL && proxy->is_valid()); |
| 72 } | 71 } |
| 73 | 72 |
| 74 NaClSrpcChannel* main_channel() const { return main_channel_; } | 73 NaClSrpcChannel* main_channel() const { return main_channel_; } |
| 75 int plugin_pid() const { return plugin_pid_; } | |
| 76 plugin::Plugin* plugin() { return plugin_; } | 74 plugin::Plugin* plugin() { return plugin_; } |
| 77 | 75 |
| 78 void ReportDeadNexe() { is_nexe_alive_ = false; } | 76 void ReportDeadNexe() { is_nexe_alive_ = false; } |
| 79 | 77 |
| 80 private: | 78 private: |
| 81 // The "main" SRPC channel used to communicate with the plugin. | 79 // The "main" SRPC channel used to communicate with the plugin. |
| 82 // NULL if proxy has been shut down. | 80 // NULL if proxy has been shut down. |
| 83 NaClSrpcChannel* main_channel_; | 81 NaClSrpcChannel* main_channel_; |
| 84 bool is_nexe_alive_; | 82 bool is_nexe_alive_; |
| 85 // The PID of the plugin. | |
| 86 int plugin_pid_; | |
| 87 // Plugin that owns this proxy. | 83 // Plugin that owns this proxy. |
| 88 plugin::Plugin* plugin_; | 84 plugin::Plugin* plugin_; |
| 89 | 85 |
| 90 // Set on module initialization. | 86 // Set on module initialization. |
| 91 const PPP_Instance* ppp_instance_interface_; | 87 const PPP_Instance* ppp_instance_interface_; |
| 92 const PPP_Messaging* ppp_messaging_interface_; | 88 const PPP_Messaging* ppp_messaging_interface_; |
| 93 const PPP_InputEvent* ppp_input_event_interface_; | 89 const PPP_InputEvent* ppp_input_event_interface_; |
| 94 | 90 |
| 95 // The thread used to handle calls on other than the main thread. | 91 // The thread used to handle calls on other than the main thread. |
| 96 struct NaClThread upcall_thread_; | 92 struct NaClThread upcall_thread_; |
| 97 NACL_DISALLOW_COPY_AND_ASSIGN(BrowserPpp); | 93 NACL_DISALLOW_COPY_AND_ASSIGN(BrowserPpp); |
| 98 }; | 94 }; |
| 99 | 95 |
| 100 } // namespace ppapi_proxy | 96 } // namespace ppapi_proxy |
| 101 | 97 |
| 102 #endif // NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_BROWSER_PPP_H_ | 98 #endif // NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_BROWSER_PPP_H_ |
| OLD | NEW |