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

Unified Diff: ppapi/proxy/plugin_globals.cc

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/proxy/plugin_globals.h ('k') | ppapi/proxy/plugin_main_irt.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/plugin_globals.cc
diff --git a/ppapi/proxy/plugin_globals.cc b/ppapi/proxy/plugin_globals.cc
index d34adf1e634798427f4c641da7c9a861c27a9f64..d361ae1191950b56cf9844ab0aa0983536199bf8 100644
--- a/ppapi/proxy/plugin_globals.cc
+++ b/ppapi/proxy/plugin_globals.cc
@@ -13,15 +13,10 @@
#include "ppapi/proxy/ppapi_messages.h"
#include "ppapi/proxy/ppb_message_loop_proxy.h"
#include "ppapi/proxy/resource_reply_thread_registrar.h"
+#include "ppapi/shared_impl/ppapi_constants.h"
#include "ppapi/shared_impl/proxy_lock.h"
#include "ppapi/thunk/enter.h"
-namespace {
-
-const int kKeepaliveThrottleIntervalDefault = 5000;
-
-} // namespace
-
namespace ppapi {
namespace proxy {
@@ -64,7 +59,7 @@ PluginGlobals::PluginGlobals()
new ResourceReplyThreadRegistrar(GetMainThreadMessageLoop())),
plugin_recently_active_(false),
keepalive_throttle_interval_milliseconds_(
- kKeepaliveThrottleIntervalDefault),
+ ppapi::kKeepaliveThrottleIntervalDefaultMilliseconds),
weak_factory_(this) {
DCHECK(!plugin_globals_);
plugin_globals_ = this;
@@ -85,7 +80,7 @@ PluginGlobals::PluginGlobals(PerThreadForTest per_thread_for_test)
new ResourceReplyThreadRegistrar(GetMainThreadMessageLoop())),
plugin_recently_active_(false),
keepalive_throttle_interval_milliseconds_(
- kKeepaliveThrottleIntervalDefault),
+ kKeepaliveThrottleIntervalDefaultMilliseconds),
weak_factory_(this) {
DCHECK(!plugin_globals_);
}
@@ -186,12 +181,13 @@ void PluginGlobals::MarkPluginIsActive() {
if (!GetBrowserSender() || !base::MessageLoop::current())
return;
GetBrowserSender()->Send(new PpapiHostMsg_Keepalive());
-
- GetMainThreadMessageLoop()->PostDelayedTask(FROM_HERE,
+ DCHECK(keepalive_throttle_interval_milliseconds_);
+ GetMainThreadMessageLoop()->PostDelayedTask(
+ FROM_HERE,
RunWhileLocked(base::Bind(&PluginGlobals::OnReleaseKeepaliveThrottle,
weak_factory_.GetWeakPtr())),
base::TimeDelta::FromMilliseconds(
- keepalive_throttle_interval_milliseconds()));
+ keepalive_throttle_interval_milliseconds_));
}
}
@@ -225,11 +221,7 @@ MessageLoopResource* PluginGlobals::loop_for_main_thread() {
return loop_for_main_thread_.get();
}
-int PluginGlobals::keepalive_throttle_interval_milliseconds() const {
- return keepalive_throttle_interval_milliseconds_;
-}
-
-void PluginGlobals::set_keepalive_throttle_interval_milliseconds(int i) {
+void PluginGlobals::set_keepalive_throttle_interval_milliseconds(unsigned i) {
keepalive_throttle_interval_milliseconds_ = i;
}
« no previous file with comments | « ppapi/proxy/plugin_globals.h ('k') | ppapi/proxy/plugin_main_irt.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698