Skip to content

Commit

Permalink
Remove 4 static initializers.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
thakis@chromium.org committed Nov 24, 2011
1 parent 173ca87 commit c68ce17
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 16 deletions.
23 changes: 9 additions & 14 deletions chrome/browser/bookmarks/bookmark_extension_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -794,6 +794,15 @@ class BookmarksQuotaLimitFactory {
private:
static void BuildWithMappers(QuotaLimitHeuristics* heuristics,
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);
// A max of two operations per minute, sustained over 10 minutes.
SustainedLimit* sustained = new SustainedLimit(TimeDelta::FromMinutes(10),
Expand All @@ -802,23 +811,9 @@ class BookmarksQuotaLimitFactory {
heuristics->push_back(sustained);
}

// The quota configurations used for all BookmarkFunctions.
static const Config kShortLimitConfig;
static const Config kLongLimitConfig;

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.
void RemoveBookmarkFunction::GetQuotaLimitHeuristics(
QuotaLimitHeuristics* heuristics) const {
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/sync/syncable/directory_backing_store.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
// 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
// infinity seems like the best choice here.
const int kDirectoryBackingStoreBusyTimeoutMs = std::numeric_limits<int>::max();
const int kDirectoryBackingStoreBusyTimeoutMs = INT_MAX;

using std::string;

Expand Down
5 changes: 4 additions & 1 deletion sql/connection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace {
// Spin for up to a second waiting for the lock to clear when setting
// up the database.
// TODO(shess): Better story on this. http://crbug.com/56559
const base::TimeDelta kBusyTimeout = base::TimeDelta::FromSeconds(1);
const int kBusyTimeoutSeconds = 1;

class ScopedBusyTimeout {
public:
Expand Down Expand Up @@ -373,6 +373,9 @@ bool Connection::OpenInternal(const std::string& file_name) {
NOTREACHED() << "Could not set locking mode: " << GetErrorMessage();
}

const base::TimeDelta kBusyTimeout =
base::TimeDelta::FromSeconds(kBusyTimeoutSeconds);

if (page_size_ != 0) {
// Enforce SQLite restrictions on |page_size_|.
DCHECK(!(page_size_ & (page_size_ - 1)))
Expand Down

0 comments on commit c68ce17

Please sign in to comment.