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

Side by Side Diff: components/doodle/doodle_types.cc

Issue 2726883002: [Doodle] Replace the expiry_date in DoodleConfig by time_to_live (Closed)
Patch Set: Created 3 years, 9 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
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 "components/doodle/doodle_types.h" 5 #include "components/doodle/doodle_types.h"
6 6
7 namespace doodle { 7 namespace doodle {
8 8
9 bool DoodleImage::operator==(const DoodleImage& other) const { 9 bool DoodleImage::operator==(const DoodleImage& other) const {
10 return url == other.url && height == other.height && width == other.width && 10 return url == other.url && height == other.height && width == other.width &&
11 is_animated_gif == other.is_animated_gif && is_cta == other.is_cta; 11 is_animated_gif == other.is_animated_gif && is_cta == other.is_cta;
12 } 12 }
13 13
14 bool DoodleImage::operator!=(const DoodleImage& other) const { 14 bool DoodleImage::operator!=(const DoodleImage& other) const {
15 return !(*this == other); 15 return !(*this == other);
16 } 16 }
17 17
18 bool DoodleConfig::IsEquivalent(const DoodleConfig& other) const { 18 bool DoodleConfig::IsEquivalent(const DoodleConfig& other) const {
19 // Note: This compares all fields except for |expiry_date|. The reason is that 19 // Note: This compares all fields except for |time_to_live|, which by
20 // |expiry_date| gets computed as "now + time_to_live", so when an identical 20 // definition isn't constant over time, and shouldn't be here in the first
21 // config gets re-fetched, the expiry date will generally end up slightly 21 // place.
fhorschig 2017/03/01 15:40:52 What do you mean by "shouldn't be here in the firs
Marc Treib 2017/03/02 09:28:03 In the config. Made that clear in the comment.
22 // different.
23 return doodle_type == other.doodle_type && alt_text == other.alt_text && 22 return doodle_type == other.doodle_type && alt_text == other.alt_text &&
24 interactive_html == other.interactive_html && 23 interactive_html == other.interactive_html &&
25 search_url == other.search_url && target_url == other.target_url && 24 search_url == other.search_url && target_url == other.target_url &&
26 fullpage_interactive_url == other.fullpage_interactive_url && 25 fullpage_interactive_url == other.fullpage_interactive_url &&
27 large_image == other.large_image && 26 large_image == other.large_image &&
28 large_cta_image == other.large_cta_image && 27 large_cta_image == other.large_cta_image &&
29 transparent_large_image == other.transparent_large_image; 28 transparent_large_image == other.transparent_large_image;
30 } 29 }
31 30
32 } // namespace doodle 31 } // namespace doodle
OLDNEW
« components/doodle/doodle_fetcher_impl_unittest.cc ('K') | « components/doodle/doodle_types.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698