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 PPAPI_PROXY_PLUGIN_GLOBALS_H_ | 5 #ifndef PPAPI_PROXY_PLUGIN_GLOBALS_H_ |
6 #define PPAPI_PROXY_PLUGIN_GLOBALS_H_ | 6 #define PPAPI_PROXY_PLUGIN_GLOBALS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 // The embedder should call this function when the command line is known. | 130 // The embedder should call this function when the command line is known. |
131 void set_command_line(const std::string& c) { command_line_ = c; } | 131 void set_command_line(const std::string& c) { command_line_ = c; } |
132 | 132 |
133 ResourceReplyThreadRegistrar* resource_reply_thread_registrar() { | 133 ResourceReplyThreadRegistrar* resource_reply_thread_registrar() { |
134 return resource_reply_thread_registrar_.get(); | 134 return resource_reply_thread_registrar_.get(); |
135 } | 135 } |
136 | 136 |
137 // Interval to limit how many IPC messages are sent indicating that the plugin | 137 // Interval to limit how many IPC messages are sent indicating that the plugin |
138 // is active and should be kept alive. The value must be smaller than any | 138 // is active and should be kept alive. The value must be smaller than any |
139 // threshold used to kill inactive plugins by the embedder host. | 139 // threshold used to kill inactive plugins by the embedder host. |
140 int keepalive_throttle_interval_milliseconds() const; | 140 void set_keepalive_throttle_interval_milliseconds(unsigned i); |
141 void set_keepalive_throttle_interval_milliseconds(int i); | |
142 | 141 |
143 private: | 142 private: |
144 class BrowserSender; | 143 class BrowserSender; |
145 | 144 |
146 // PpapiGlobals overrides. | 145 // PpapiGlobals overrides. |
147 virtual bool IsPluginGlobals() const OVERRIDE; | 146 virtual bool IsPluginGlobals() const OVERRIDE; |
148 | 147 |
149 // Locks the proxy lock and releases the throttle on keepalive IPC messages. | 148 // Locks the proxy lock and releases the throttle on keepalive IPC messages. |
150 void OnReleaseKeepaliveThrottle(); | 149 void OnReleaseKeepaliveThrottle(); |
151 | 150 |
(...skipping 24 matching lines...) Expand all Loading... |
176 scoped_ptr<base::Thread> file_thread_; | 175 scoped_ptr<base::Thread> file_thread_; |
177 | 176 |
178 scoped_refptr<ResourceReplyThreadRegistrar> resource_reply_thread_registrar_; | 177 scoped_refptr<ResourceReplyThreadRegistrar> resource_reply_thread_registrar_; |
179 | 178 |
180 // Indicates activity by the plugin. Used to monitor when a plugin can be | 179 // Indicates activity by the plugin. Used to monitor when a plugin can be |
181 // shutdown due to idleness. Current needs do not require differentiating | 180 // shutdown due to idleness. Current needs do not require differentiating |
182 // between idle state between multiple instances, if any are active they are | 181 // between idle state between multiple instances, if any are active they are |
183 // all considered active. | 182 // all considered active. |
184 bool plugin_recently_active_; | 183 bool plugin_recently_active_; |
185 | 184 |
186 int keepalive_throttle_interval_milliseconds_; | 185 unsigned keepalive_throttle_interval_milliseconds_; |
187 | 186 |
188 // Member variables should appear before the WeakPtrFactory, see weak_ptr.h. | 187 // Member variables should appear before the WeakPtrFactory, see weak_ptr.h. |
189 base::WeakPtrFactory<PluginGlobals> weak_factory_; | 188 base::WeakPtrFactory<PluginGlobals> weak_factory_; |
190 | 189 |
191 DISALLOW_COPY_AND_ASSIGN(PluginGlobals); | 190 DISALLOW_COPY_AND_ASSIGN(PluginGlobals); |
192 }; | 191 }; |
193 | 192 |
194 } // namespace proxy | 193 } // namespace proxy |
195 } // namespace ppapi | 194 } // namespace ppapi |
196 | 195 |
197 #endif // PPAPI_PROXY_PLUGIN_GLOBALS_H_ | 196 #endif // PPAPI_PROXY_PLUGIN_GLOBALS_H_ |
OLD | NEW |