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

Side by Side Diff: chrome/browser/history/visit_database.cc

Issue 23112033: content: Move kHttpsScheme constant into content namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/history/url_database.cc ('k') | chrome/browser/prerender/prerender_contents.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 (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/visit_database.h" 5 #include "chrome/browser/history/visit_database.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
(...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 return false; 484 return false;
485 485
486 *from_url = GURL(statement.ColumnString(0)); 486 *from_url = GURL(statement.ColumnString(0));
487 } 487 }
488 return true; 488 return true;
489 } 489 }
490 490
491 bool VisitDatabase::GetVisibleVisitCountToHost(const GURL& url, 491 bool VisitDatabase::GetVisibleVisitCountToHost(const GURL& url,
492 int* count, 492 int* count,
493 base::Time* first_visit) { 493 base::Time* first_visit) {
494 if (!url.SchemeIs(chrome::kHttpScheme) && !url.SchemeIs(chrome::kHttpsScheme)) 494 if (!url.SchemeIs(chrome::kHttpScheme) &&
495 !url.SchemeIs(content::kHttpsScheme))
495 return false; 496 return false;
496 497
497 // We need to search for URLs with a matching host/port. One way to query for 498 // We need to search for URLs with a matching host/port. One way to query for
498 // this is to use the LIKE operator, eg 'url LIKE http://google.com/%'. This 499 // this is to use the LIKE operator, eg 'url LIKE http://google.com/%'. This
499 // is inefficient though in that it doesn't use the index and each entry must 500 // is inefficient though in that it doesn't use the index and each entry must
500 // be visited. The same query can be executed by using >= and < operator. 501 // be visited. The same query can be executed by using >= and < operator.
501 // The query becomes: 502 // The query becomes:
502 // 'url >= http://google.com/' and url < http://google.com0'. 503 // 'url >= http://google.com/' and url < http://google.com0'.
503 // 0 is used as it is one character greater than '/'. 504 // 0 is used as it is one character greater than '/'.
504 const std::string host_query_min = url.GetOrigin().spec(); 505 const std::string host_query_min = url.GetOrigin().spec();
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
616 while (statement.Step()) { 617 while (statement.Step()) {
617 BriefVisitInfo info; 618 BriefVisitInfo info;
618 info.url_id = statement.ColumnInt64(0); 619 info.url_id = statement.ColumnInt64(0);
619 info.time = base::Time::FromInternalValue(statement.ColumnInt64(1)); 620 info.time = base::Time::FromInternalValue(statement.ColumnInt64(1));
620 info.transition = content::PageTransitionFromInt(statement.ColumnInt(2)); 621 info.transition = content::PageTransitionFromInt(statement.ColumnInt(2));
621 result_vector->push_back(info); 622 result_vector->push_back(info);
622 } 623 }
623 } 624 }
624 625
625 } // namespace history 626 } // namespace history
OLDNEW
« no previous file with comments | « chrome/browser/history/url_database.cc ('k') | chrome/browser/prerender/prerender_contents.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698