Commit c68ce170 authored by thakis@chromium.org's avatar thakis@chromium.org

Remove 4 static initializers.

Most of them caused by gcc 4.4 being not sufficiently smart.

BUG=94925
TEST=none
TBR=akalin

Review URL: http://codereview.chromium.org/8690005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111560 0039d316-1c4b-4281-b951-d872f2087c98
parent 173ca873
...@@ -794,6 +794,15 @@ class BookmarksQuotaLimitFactory { ...@@ -794,6 +794,15 @@ class BookmarksQuotaLimitFactory {
private: private:
static void BuildWithMappers(QuotaLimitHeuristics* heuristics, static void BuildWithMappers(QuotaLimitHeuristics* heuristics,
BucketMapper* short_mapper, BucketMapper* long_mapper) { BucketMapper* short_mapper, BucketMapper* long_mapper) {
const Config kShortLimitConfig = {
2, // 2 tokens per interval.
TimeDelta::FromMinutes(1) // 1 minute long refill interval.
};
const Config kLongLimitConfig = {
100, // 100 tokens per interval.
TimeDelta::FromHours(1) // 1 hour long refill interval.
};
TimedLimit* timed = new TimedLimit(kLongLimitConfig, long_mapper); TimedLimit* timed = new TimedLimit(kLongLimitConfig, long_mapper);
// A max of two operations per minute, sustained over 10 minutes. // A max of two operations per minute, sustained over 10 minutes.
SustainedLimit* sustained = new SustainedLimit(TimeDelta::FromMinutes(10), SustainedLimit* sustained = new SustainedLimit(TimeDelta::FromMinutes(10),
...@@ -802,23 +811,9 @@ class BookmarksQuotaLimitFactory { ...@@ -802,23 +811,9 @@ class BookmarksQuotaLimitFactory {
heuristics->push_back(sustained); heuristics->push_back(sustained);
} }
// The quota configurations used for all BookmarkFunctions.
static const Config kShortLimitConfig;
static const Config kLongLimitConfig;
DISALLOW_IMPLICIT_CONSTRUCTORS(BookmarksQuotaLimitFactory); DISALLOW_IMPLICIT_CONSTRUCTORS(BookmarksQuotaLimitFactory);
}; };
const Config BookmarksQuotaLimitFactory::kShortLimitConfig = {
2, // 2 tokens per interval.
TimeDelta::FromMinutes(1) // 1 minute long refill interval.
};
const Config BookmarksQuotaLimitFactory::kLongLimitConfig = {
100, // 100 tokens per interval.
TimeDelta::FromHours(1) // 1 hour long refill interval.
};
// And finally, building the individual heuristics for each function. // And finally, building the individual heuristics for each function.
void RemoveBookmarkFunction::GetQuotaLimitHeuristics( void RemoveBookmarkFunction::GetQuotaLimitHeuristics(
QuotaLimitHeuristics* heuristics) const { QuotaLimitHeuristics* heuristics) const {
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
// is calling SaveChanges. In the worst case scenario, the user can put his // is calling SaveChanges. In the worst case scenario, the user can put his
// laptop to sleep during db contention, and wake up the laptop days later, so // laptop to sleep during db contention, and wake up the laptop days later, so
// infinity seems like the best choice here. // infinity seems like the best choice here.
const int kDirectoryBackingStoreBusyTimeoutMs = std::numeric_limits<int>::max(); const int kDirectoryBackingStoreBusyTimeoutMs = INT_MAX;
using std::string; using std::string;
......
...@@ -19,7 +19,7 @@ namespace { ...@@ -19,7 +19,7 @@ namespace {
// Spin for up to a second waiting for the lock to clear when setting // Spin for up to a second waiting for the lock to clear when setting
// up the database. // up the database.
// TODO(shess): Better story on this. http://crbug.com/56559 // TODO(shess): Better story on this. http://crbug.com/56559
const base::TimeDelta kBusyTimeout = base::TimeDelta::FromSeconds(1); const int kBusyTimeoutSeconds = 1;
class ScopedBusyTimeout { class ScopedBusyTimeout {
public: public:
...@@ -373,6 +373,9 @@ bool Connection::OpenInternal(const std::string& file_name) { ...@@ -373,6 +373,9 @@ bool Connection::OpenInternal(const std::string& file_name) {
NOTREACHED() << "Could not set locking mode: " << GetErrorMessage(); NOTREACHED() << "Could not set locking mode: " << GetErrorMessage();
} }
const base::TimeDelta kBusyTimeout =
base::TimeDelta::FromSeconds(kBusyTimeoutSeconds);
if (page_size_ != 0) { if (page_size_ != 0) {
// Enforce SQLite restrictions on |page_size_|. // Enforce SQLite restrictions on |page_size_|.
DCHECK(!(page_size_ & (page_size_ - 1))) DCHECK(!(page_size_ & (page_size_ - 1)))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment