diff options
author | kbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-18 17:58:07 +0000 |
---|---|---|
committer | kbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-18 17:58:07 +0000 |
commit | a6939ca46f65f58425ef5966028013ed65535e8f (patch) | |
tree | eced484a857552f2510c119c1d203ee69732f21e /webkit/glue/webkit_constants.h | |
parent | 92c699d5a6b73316cb9fd7f44ef9753038b02846 (diff) | |
download | chromium_src-a6939ca46f65f58425ef5966028013ed65535e8f.zip chromium_src-a6939ca46f65f58425ef5966028013ed65535e8f.tar.gz chromium_src-a6939ca46f65f58425ef5966028013ed65535e8f.tar.bz2 |
Set the minimum timer interval on a per-page basis, and adjust it when
tabs are brought to the foreground and sent to the background.
This CL does not actually increase the background timer interval. That
will be done separately, so that it can easily be reverted without
removing all of the associated code.
BUG=66078
TEST=none (tested manually with minimal test case)
Review URL: http://codereview.chromium.org/6532012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75404 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/webkit_constants.h')
-rw-r--r-- | webkit/glue/webkit_constants.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/webkit/glue/webkit_constants.h b/webkit/glue/webkit_constants.h new file mode 100644 index 0000000..54e7e00 --- /dev/null +++ b/webkit/glue/webkit_constants.h @@ -0,0 +1,22 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef WEBKIT_GLUE_WEBKIT_CONSTANTS_H_ +#define WEBKIT_GLUE_WEBKIT_CONSTANTS_H_ + +namespace webkit_glue { + +// Chromium sets the minimum interval timeout to 4ms, overriding the +// default of 10ms. We'd like to go lower, however there are poorly +// coded websites out there which do create CPU-spinning loops. Using +// 4ms prevents the CPU from spinning too busily and provides a balance +// between CPU spinning and the smallest possible interval timer. +const double kForegroundTabTimerInterval = 0.004; + +// Provides control over the minimum timer interval for background tabs. +const double kBackgroundTabTimerInterval = 0.004; + +} // namespace webkit_glue + +#endif // WEBKIT_GLUE_WEBKIT_CONSTANTS_H_ |