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

Side by Side Diff: components/browsing_data/core/browsing_data_utils.cc

Issue 2127403002: Make browsing_data component a layered component (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed output_name from components/browsing_data/content/BUILD.gn Created 4 years, 5 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/browsing_data/browsing_data_utils.h" 5 #include "components/browsing_data/core/browsing_data_utils.h"
6 6
7 namespace browsing_data { 7 namespace browsing_data {
8 8
9 base::Time CalculateBeginDeleteTime(TimePeriod time_period) { 9 base::Time CalculateBeginDeleteTime(TimePeriod time_period) {
10 base::TimeDelta diff; 10 base::TimeDelta diff;
11 base::Time delete_begin_time = base::Time::Now(); 11 base::Time delete_begin_time = base::Time::Now();
12 switch (time_period) { 12 switch (time_period) {
13 case LAST_HOUR: 13 case LAST_HOUR:
14 diff = base::TimeDelta::FromHours(1); 14 diff = base::TimeDelta::FromHours(1);
15 break; 15 break;
16 case LAST_DAY: 16 case LAST_DAY:
17 diff = base::TimeDelta::FromHours(24); 17 diff = base::TimeDelta::FromHours(24);
18 break; 18 break;
19 case LAST_WEEK: 19 case LAST_WEEK:
20 diff = base::TimeDelta::FromHours(7 * 24); 20 diff = base::TimeDelta::FromHours(7 * 24);
21 break; 21 break;
22 case FOUR_WEEKS: 22 case FOUR_WEEKS:
23 diff = base::TimeDelta::FromHours(4 * 7 * 24); 23 diff = base::TimeDelta::FromHours(4 * 7 * 24);
24 break; 24 break;
25 case EVERYTHING: 25 case EVERYTHING:
26 delete_begin_time = base::Time(); 26 delete_begin_time = base::Time();
27 break; 27 break;
28 } 28 }
29 return delete_begin_time - diff; 29 return delete_begin_time - diff;
30 } 30 }
31 31
32 } // namespace browsing_data 32 } // namespace browsing_data
OLDNEW
« no previous file with comments | « components/browsing_data/core/browsing_data_utils.h ('k') | components/browsing_data/core/counters/browsing_data_counter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698