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; |
} |