Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(151)

Side by Side Diff: ppapi/proxy/plugin_globals.h

Issue 197693003: Replace --ppapi-keep-alive-throttle command line switch with IPC parameter. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move literal to .h to avoid static initializer Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ppapi/ppapi_shared.gypi ('k') | ppapi/proxy/plugin_globals.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « ppapi/ppapi_shared.gypi ('k') | ppapi/proxy/plugin_globals.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698