Commit 39f5b80c authored by msramek's avatar msramek Committed by Commit bot

Fix the end time bound in WebHistoryService to match the API

Change the exclusive end time bound in WebHistoryService to be inclusive,
as required by the history.google.com API.

BUG=674165

Review-Url: https://codereview.chromium.org/2621143004
Cr-Commit-Position: refs/heads/master@{#443245}
parent 66c78e9b
...@@ -275,10 +275,14 @@ GURL GetQueryUrl(const base::string16& text_query, ...@@ -275,10 +275,14 @@ GURL GetQueryUrl(const base::string16& text_query,
url = net::AppendQueryParameter(url, "titles", "1"); url = net::AppendQueryParameter(url, "titles", "1");
// Take |begin_time|, |end_time|, and |max_count| from the original query // Take |begin_time|, |end_time|, and |max_count| from the original query
// options, and convert them to the equivalent URL parameters. // options, and convert them to the equivalent URL parameters. Note that
// QueryOptions uses exclusive |end_time| while the history.google.com API
// uses it inclusively, so we subtract 1us during conversion.
base::Time end_time = base::Time end_time =
std::min(base::Time::FromInternalValue(options.EffectiveEndTime()), options.end_time.is_null()
? base::Time::Now()
: std::min(options.end_time - base::TimeDelta::FromMicroseconds(1),
base::Time::Now()); base::Time::Now());
url = net::AppendQueryParameter(url, "max", ServerTimeString(end_time)); url = net::AppendQueryParameter(url, "max", ServerTimeString(end_time));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment