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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | content/renderer/manifest/manifest_parser.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/public/common/manifest.h" 5 #include "content/public/common/manifest.h"
6 6
7 namespace content { 7 namespace content {
8 8
9 const double Manifest::Icon::kDefaultDensity = 1; 9 const double Manifest::Icon::kDefaultDensity = 1;
10 const int64_t Manifest::kInvalidOrMissingThemeColor = -1; 10 // We need to provide a value here which is out of the range of a 32-bit integer
11 // since otherwise we would not be able to check whether a theme color was valid
12 // or not. The simplest way to do this is to simply add one to the maximum
13 // possible 32-bit integer.
14 const int64_t Manifest::kInvalidOrMissingThemeColor =
15 static_cast<int64_t>(std::numeric_limits<int32_t>::max()) + 1;
11 const size_t Manifest::kMaxIPCStringLength = 4 * 1024; 16 const size_t Manifest::kMaxIPCStringLength = 4 * 1024;
12 17
13 Manifest::Icon::Icon() 18 Manifest::Icon::Icon()
14 : density(kDefaultDensity) { 19 : density(kDefaultDensity) {
15 } 20 }
16 21
17 Manifest::Icon::~Icon() { 22 Manifest::Icon::~Icon() {
18 } 23 }
19 24
20 Manifest::RelatedApplication::RelatedApplication() { 25 Manifest::RelatedApplication::RelatedApplication() {
(...skipping 19 matching lines...) Expand all
40 display == DISPLAY_MODE_UNSPECIFIED && 45 display == DISPLAY_MODE_UNSPECIFIED &&
41 orientation == blink::WebScreenOrientationLockDefault && 46 orientation == blink::WebScreenOrientationLockDefault &&
42 icons.empty() && 47 icons.empty() &&
43 related_applications.empty() && 48 related_applications.empty() &&
44 !prefer_related_applications && 49 !prefer_related_applications &&
45 theme_color == Manifest::kInvalidOrMissingThemeColor && 50 theme_color == Manifest::kInvalidOrMissingThemeColor &&
46 gcm_sender_id.is_null(); 51 gcm_sender_id.is_null();
47 } 52 }
48 53
49 } // namespace content 54 } // namespace content
OLDNEW
« 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