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

Unified Diff: ppapi/proxy/plugin_globals.cc

Issue 199933002: Revert of Replace --ppapi-keep-alive-throttle command line switch with IPC parameter. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 d361ae1191950b56cf9844ab0aa0983536199bf8..d34adf1e634798427f4c641da7c9a861c27a9f64 100644
--- a/ppapi/proxy/plugin_globals.cc
+++ b/ppapi/proxy/plugin_globals.cc
@@ -13,9 +13,14 @@
#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 {
@@ -59,7 +64,7 @@
new ResourceReplyThreadRegistrar(GetMainThreadMessageLoop())),
plugin_recently_active_(false),
keepalive_throttle_interval_milliseconds_(
- ppapi::kKeepaliveThrottleIntervalDefaultMilliseconds),
+ kKeepaliveThrottleIntervalDefault),
weak_factory_(this) {
DCHECK(!plugin_globals_);
plugin_globals_ = this;
@@ -80,7 +85,7 @@
new ResourceReplyThreadRegistrar(GetMainThreadMessageLoop())),
plugin_recently_active_(false),
keepalive_throttle_interval_milliseconds_(
- kKeepaliveThrottleIntervalDefaultMilliseconds),
+ kKeepaliveThrottleIntervalDefault),
weak_factory_(this) {
DCHECK(!plugin_globals_);
}
@@ -181,13 +186,12 @@
if (!GetBrowserSender() || !base::MessageLoop::current())
return;
GetBrowserSender()->Send(new PpapiHostMsg_Keepalive());
- DCHECK(keepalive_throttle_interval_milliseconds_);
- GetMainThreadMessageLoop()->PostDelayedTask(
- FROM_HERE,
+
+ GetMainThreadMessageLoop()->PostDelayedTask(FROM_HERE,
RunWhileLocked(base::Bind(&PluginGlobals::OnReleaseKeepaliveThrottle,
weak_factory_.GetWeakPtr())),
base::TimeDelta::FromMilliseconds(
- keepalive_throttle_interval_milliseconds_));
+ keepalive_throttle_interval_milliseconds()));
}
}
@@ -221,7 +225,11 @@
return loop_for_main_thread_.get();
}
-void PluginGlobals::set_keepalive_throttle_interval_milliseconds(unsigned i) {
+int PluginGlobals::keepalive_throttle_interval_milliseconds() const {
+ return keepalive_throttle_interval_milliseconds_;
+}
+
+void PluginGlobals::set_keepalive_throttle_interval_milliseconds(int 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