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

Unified Diff: content/public/common/manifest.cc

Issue 1246953002: content: make theme_color more resilient to casting issues (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address avi@'s comment Created 5 years, 4 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 | « no previous file | content/renderer/manifest/manifest_parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/common/manifest.cc
diff --git a/content/public/common/manifest.cc b/content/public/common/manifest.cc
index ed19c470073b435008580c28e83da985666b65bb..dc663cfaceb13bbb8241c14e5e54167dfd5c33b6 100644
--- a/content/public/common/manifest.cc
+++ b/content/public/common/manifest.cc
@@ -7,7 +7,12 @@
namespace content {
const double Manifest::Icon::kDefaultDensity = 1;
-const int64_t Manifest::kInvalidOrMissingThemeColor = -1;
+// We need to provide a value here which is out of the range of a 32-bit integer
+// since otherwise we would not be able to check whether a theme color was valid
+// or not. The simplest way to do this is to simply add one to the maximum
+// possible 32-bit integer.
+const int64_t Manifest::kInvalidOrMissingThemeColor =
+ static_cast<int64_t>(std::numeric_limits<int32_t>::max()) + 1;
const size_t Manifest::kMaxIPCStringLength = 4 * 1024;
Manifest::Icon::Icon()
« no previous file with comments | « no previous file | content/renderer/manifest/manifest_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698