summaryrefslogtreecommitdiffstats
path: root/storage
diff options
context:
space:
mode:
authorbrucedawson <brucedawson@chromium.org>2015-10-13 14:14:05 -0700
committerCommit bot <commit-bot@chromium.org>2015-10-13 21:14:56 +0000
commit34cabd0b4c0f68e275c49ca89b59f469ddf3852d (patch)
treec7d8153367e455ffd1d4ebc91c4f9b39913a58d9 /storage
parent349a38559b21297396e686a851454e2891151d90 (diff)
downloadchromium_src-34cabd0b4c0f68e275c49ca89b59f469ddf3852d.zip
chromium_src-34cabd0b4c0f68e275c49ca89b59f469ddf3852d.tar.gz
chromium_src-34cabd0b4c0f68e275c49ca89b59f469ddf3852d.tar.bz2
Use INT64_MAX to avoid global object constructors
Using std::numeric_limits<int64>::max(); to initialize a global variable can easily lead to initialization code running at startup, which is bad. Doing this on a const variable declared in a header file has the potential to trigger *many* constructors because the const (implicitly static) variables may be created in many translation units. Using "= INT64_MAX;" ensures that all is done at compile time and the integral constants will not be allocated storage. See this discussion for details: https://groups.google.com/a/chromium.org/forum/#!msg/chromium-dev/Bvd9QU5pY9Q/m-VVOSKiKwAJ R=tzik@chromium.org Review URL: https://codereview.chromium.org/1398803004 Cr-Commit-Position: refs/heads/master@{#353854}
Diffstat (limited to 'storage')
-rw-r--r--storage/browser/fileapi/file_system_backend.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/storage/browser/fileapi/file_system_backend.h b/storage/browser/fileapi/file_system_backend.h
index 58333b3..ad3a8f3 100644
--- a/storage/browser/fileapi/file_system_backend.h
+++ b/storage/browser/fileapi/file_system_backend.h
@@ -40,7 +40,7 @@ typedef base::Callback<void(const GURL& url)> URLCallback;
// Maximum numer of bytes to be read by FileStreamReader classes. Used in
// FileSystemBackend::CreateFileStreamReader(), when it's not known how many
// bytes will be fetched in total.
-const int64 kMaximumLength = std::numeric_limits<int64>::max();
+const int64 kMaximumLength = INT64_MAX;
// An interface for defining a file system backend.
//