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

Side by Side Diff: components/search_engines/keyword_table.cc

Issue 2695883003: Change uses of base::JoinString to pass StringPieces where possible. (Closed)
Patch Set: Remove dependency CL. Created 3 years, 8 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/search_engines/keyword_table.h" 5 #include "components/search_engines/keyword_table.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <set> 10 #include <set>
11 11
12 #include "base/json/json_reader.h" 12 #include "base/json/json_reader.h"
13 #include "base/json/json_writer.h" 13 #include "base/json/json_writer.h"
14 #include "base/logging.h" 14 #include "base/logging.h"
15 #include "base/strings/string_number_conversions.h" 15 #include "base/strings/string_number_conversions.h"
16 #include "base/strings/string_piece.h"
16 #include "base/strings/string_split.h" 17 #include "base/strings/string_split.h"
17 #include "base/strings/string_util.h" 18 #include "base/strings/string_util.h"
18 #include "base/strings/utf_string_conversions.h" 19 #include "base/strings/utf_string_conversions.h"
19 #include "base/values.h" 20 #include "base/values.h"
20 #include "components/history/core/browser/url_database.h" 21 #include "components/history/core/browser/url_database.h"
21 #include "components/search_engines/search_terms_data.h" 22 #include "components/search_engines/search_terms_data.h"
22 #include "components/search_engines/template_url.h" 23 #include "components/search_engines/template_url.h"
23 #include "components/webdata/common/web_database.h" 24 #include "components/webdata/common/web_database.h"
24 #include "sql/statement.h" 25 #include "sql/statement.h"
25 #include "sql/transaction.h" 26 #include "sql/transaction.h"
26 #include "url/gurl.h" 27 #include "url/gurl.h"
27 28
28 using base::Time; 29 using base::Time;
29 30
30 // static 31 // static
31 const char KeywordTable::kDefaultSearchProviderKey[] = 32 const char KeywordTable::kDefaultSearchProviderKey[] =
32 "Default Search Provider ID"; 33 "Default Search Provider ID";
33 34
34 namespace { 35 namespace {
35 36
36 // Keys used in the meta table. 37 // Keys used in the meta table.
37 const char kBuiltinKeywordVersion[] = "Builtin Keyword Version"; 38 const char kBuiltinKeywordVersion[] = "Builtin Keyword Version";
38 39
39 const std::string ColumnsForVersion(int version, bool concatenated) { 40 const std::string ColumnsForVersion(int version, bool concatenated) {
40 std::vector<std::string> columns; 41 std::vector<base::StringPiece> columns;
41 42
42 columns.push_back("id"); 43 columns.push_back("id");
43 columns.push_back("short_name"); 44 columns.push_back("short_name");
44 columns.push_back("keyword"); 45 columns.push_back("keyword");
45 columns.push_back("favicon_url"); 46 columns.push_back("favicon_url");
46 columns.push_back("url"); 47 columns.push_back("url");
47 columns.push_back("safe_for_autoreplace"); 48 columns.push_back("safe_for_autoreplace");
48 columns.push_back("originating_url"); 49 columns.push_back("originating_url");
49 columns.push_back("date_created"); 50 columns.push_back("date_created");
50 columns.push_back("usage_count"); 51 columns.push_back("usage_count");
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 << ", ignoring."; 454 << ", ignoring.";
454 return true; 455 return true;
455 } 456 }
456 457
457 if (!s.Succeeded()) 458 if (!s.Succeeded())
458 return false; 459 return false;
459 460
460 *result = s.ColumnString(0); 461 *result = s.ColumnString(0);
461 return true; 462 return true;
462 } 463 }
OLDNEW
« no previous file with comments | « components/safe_browsing_db/safe_browsing_prefs_unittest.cc ('k') | components/search_provider_logos/google_logo_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698