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

Side by Side Diff: chrome/browser/webdata/keyword_table.cc

Issue 13993005: Switch to narrowest scope for a static, per suggestion in a review on another file. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/webdata/logins_table.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/webdata/keyword_table.h" 5 #include "chrome/browser/webdata/keyword_table.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/json/json_reader.h" 9 #include "base/json/json_reader.h"
10 #include "base/json/json_writer.h" 10 #include "base/json/json_writer.h"
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 s->BindString(starting_column + 10, data.suggestions_url); 109 s->BindString(starting_column + 10, data.suggestions_url);
110 s->BindInt(starting_column + 11, data.prepopulate_id); 110 s->BindInt(starting_column + 11, data.prepopulate_id);
111 s->BindBool(starting_column + 12, data.created_by_policy); 111 s->BindBool(starting_column + 12, data.created_by_policy);
112 s->BindString(starting_column + 13, data.instant_url); 112 s->BindString(starting_column + 13, data.instant_url);
113 s->BindInt64(starting_column + 14, data.last_modified.ToTimeT()); 113 s->BindInt64(starting_column + 14, data.last_modified.ToTimeT());
114 s->BindString(starting_column + 15, data.sync_guid); 114 s->BindString(starting_column + 15, data.sync_guid);
115 s->BindString(starting_column + 16, alternate_urls); 115 s->BindString(starting_column + 16, alternate_urls);
116 s->BindString(starting_column + 17, data.search_terms_replacement_key); 116 s->BindString(starting_column + 17, data.search_terms_replacement_key);
117 } 117 }
118 118
119 int table_key = 0;
120
121 WebDatabaseTable::TypeKey GetKey() { 119 WebDatabaseTable::TypeKey GetKey() {
120 // We just need a unique constant. Use the address of a static that
121 // COMDAT folding won't touch in an optimizing linker.
122 static int table_key = 0;
122 return reinterpret_cast<void*>(&table_key); 123 return reinterpret_cast<void*>(&table_key);
123 } 124 }
124 125
125 } // namespace 126 } // namespace
126 127
127 KeywordTable::KeywordTable() { 128 KeywordTable::KeywordTable() {
128 } 129 }
129 130
130 KeywordTable::~KeywordTable() {} 131 KeywordTable::~KeywordTable() {}
131 132
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after
607 } 608 }
608 } 609 }
609 610
610 // Replace the old table with the new one. 611 // Replace the old table with the new one.
611 sql = "DROP TABLE " + name; 612 sql = "DROP TABLE " + name;
612 if (!db_->Execute(sql.c_str())) 613 if (!db_->Execute(sql.c_str()))
613 return false; 614 return false;
614 sql = "ALTER TABLE keywords_temp RENAME TO " + name; 615 sql = "ALTER TABLE keywords_temp RENAME TO " + name;
615 return db_->Execute(sql.c_str()); 616 return db_->Execute(sql.c_str());
616 } 617 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/webdata/logins_table.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698