OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/history/history_types.h" | 5 #include "chrome/browser/history/history_types.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 hidden_ = false; | 62 hidden_ = false; |
63 } | 63 } |
64 | 64 |
65 // VisitRow -------------------------------------------------------------------- | 65 // VisitRow -------------------------------------------------------------------- |
66 | 66 |
67 VisitRow::VisitRow() | 67 VisitRow::VisitRow() |
68 : visit_id(0), | 68 : visit_id(0), |
69 url_id(0), | 69 url_id(0), |
70 referring_visit(0), | 70 referring_visit(0), |
71 transition(content::PAGE_TRANSITION_LINK), | 71 transition(content::PAGE_TRANSITION_LINK), |
72 segment_id(0), | 72 segment_id(0) { |
73 is_indexed(false) { | |
74 } | 73 } |
75 | 74 |
76 VisitRow::VisitRow(URLID arg_url_id, | 75 VisitRow::VisitRow(URLID arg_url_id, |
77 base::Time arg_visit_time, | 76 base::Time arg_visit_time, |
78 VisitID arg_referring_visit, | 77 VisitID arg_referring_visit, |
79 content::PageTransition arg_transition, | 78 content::PageTransition arg_transition, |
80 SegmentID arg_segment_id) | 79 SegmentID arg_segment_id) |
81 : visit_id(0), | 80 : visit_id(0), |
82 url_id(arg_url_id), | 81 url_id(arg_url_id), |
83 visit_time(arg_visit_time), | 82 visit_time(arg_visit_time), |
84 referring_visit(arg_referring_visit), | 83 referring_visit(arg_referring_visit), |
85 transition(arg_transition), | 84 transition(arg_transition), |
86 segment_id(arg_segment_id), | 85 segment_id(arg_segment_id) { |
87 is_indexed(false) { | |
88 } | 86 } |
89 | 87 |
90 VisitRow::~VisitRow() { | 88 VisitRow::~VisitRow() { |
91 } | 89 } |
92 | 90 |
93 // URLResult ------------------------------------------------------------------- | 91 // URLResult ------------------------------------------------------------------- |
94 | 92 |
95 URLResult::URLResult() | 93 URLResult::URLResult() |
96 : blocked_visit_(false) { | 94 : blocked_visit_(false) { |
97 } | 95 } |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 if (match_index >= begin && match_index <= end) | 237 if (match_index >= begin && match_index <= end) |
240 i->second[match] += delta; | 238 i->second[match] += delta; |
241 } | 239 } |
242 } | 240 } |
243 } | 241 } |
244 | 242 |
245 // QueryOptions ---------------------------------------------------------------- | 243 // QueryOptions ---------------------------------------------------------------- |
246 | 244 |
247 QueryOptions::QueryOptions() | 245 QueryOptions::QueryOptions() |
248 : max_count(0), | 246 : max_count(0), |
249 body_only(false), | |
250 duplicate_policy(QueryOptions::REMOVE_ALL_DUPLICATES) { | 247 duplicate_policy(QueryOptions::REMOVE_ALL_DUPLICATES) { |
251 } | 248 } |
252 | 249 |
253 void QueryOptions::SetRecentDayRange(int days_ago) { | 250 void QueryOptions::SetRecentDayRange(int days_ago) { |
254 end_time = base::Time::Now(); | 251 end_time = base::Time::Now(); |
255 begin_time = end_time - base::TimeDelta::FromDays(days_ago); | 252 begin_time = end_time - base::TimeDelta::FromDays(days_ago); |
256 } | 253 } |
257 | 254 |
258 int64 QueryOptions::EffectiveBeginTime() const { | 255 int64 QueryOptions::EffectiveBeginTime() const { |
259 return begin_time.ToInternalValue(); | 256 return begin_time.ToInternalValue(); |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 | 422 |
426 void ExpireHistoryArgs::SetTimeRangeForOneDay(base::Time time) { | 423 void ExpireHistoryArgs::SetTimeRangeForOneDay(base::Time time) { |
427 begin_time = time.LocalMidnight(); | 424 begin_time = time.LocalMidnight(); |
428 | 425 |
429 // Due to DST, leap seconds, etc., the next day at midnight may be more than | 426 // Due to DST, leap seconds, etc., the next day at midnight may be more than |
430 // 24 hours away, so add 36 hours and round back down to midnight. | 427 // 24 hours away, so add 36 hours and round back down to midnight. |
431 end_time = (begin_time + base::TimeDelta::FromHours(36)).LocalMidnight(); | 428 end_time = (begin_time + base::TimeDelta::FromHours(36)).LocalMidnight(); |
432 } | 429 } |
433 | 430 |
434 } // namespace history | 431 } // namespace history |
OLD | NEW |