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

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

Issue 273193004: Move some content url constants to /url. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add missing files. Created 6 years, 6 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
« no previous file with comments | « chrome/browser/history/in_memory_url_index.cc ('k') | chrome/browser/io_thread.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/url_database.h" 5 #include "chrome/browser/history/url_database.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 if (info.url().is_valid()) 308 if (info.url().is_valid())
309 results->push_back(info); 309 results->push_back(info);
310 } 310 }
311 return !results->empty(); 311 return !results->empty();
312 } 312 }
313 313
314 bool URLDatabase::IsTypedHost(const std::string& host) { 314 bool URLDatabase::IsTypedHost(const std::string& host) {
315 const char* schemes[] = { 315 const char* schemes[] = {
316 url::kHttpScheme, 316 url::kHttpScheme,
317 url::kHttpsScheme, 317 url::kHttpsScheme,
318 content::kFtpScheme 318 url::kFtpScheme
319 }; 319 };
320 URLRows dummy; 320 URLRows dummy;
321 for (size_t i = 0; i < arraysize(schemes); ++i) { 321 for (size_t i = 0; i < arraysize(schemes); ++i) {
322 std::string scheme_and_host(schemes[i]); 322 std::string scheme_and_host(schemes[i]);
323 scheme_and_host += content::kStandardSchemeSeparator + host; 323 scheme_and_host += content::kStandardSchemeSeparator + host;
324 if (AutocompleteForPrefix(scheme_and_host + '/', 1, true, &dummy) || 324 if (AutocompleteForPrefix(scheme_and_host + '/', 1, true, &dummy) ||
325 AutocompleteForPrefix(scheme_and_host + ':', 1, true, &dummy)) 325 AutocompleteForPrefix(scheme_and_host + ':', 1, true, &dummy))
326 return true; 326 return true;
327 } 327 }
328 return false; 328 return false;
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
616 return GetDB().Execute(sql.c_str()); 616 return GetDB().Execute(sql.c_str());
617 } 617 }
618 618
619 bool URLDatabase::CreateMainURLIndex() { 619 bool URLDatabase::CreateMainURLIndex() {
620 // Index over URLs so we can quickly look up based on URL. 620 // Index over URLs so we can quickly look up based on URL.
621 return GetDB().Execute( 621 return GetDB().Execute(
622 "CREATE INDEX IF NOT EXISTS urls_url_index ON urls (url)"); 622 "CREATE INDEX IF NOT EXISTS urls_url_index ON urls (url)");
623 } 623 }
624 624
625 } // namespace history 625 } // namespace history
OLDNEW
« no previous file with comments | « chrome/browser/history/in_memory_url_index.cc ('k') | chrome/browser/io_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698