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

Side by Side Diff: components/webdata/autofill/autofill_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 | « chrome/browser/webdata/web_intents_table.cc ('k') | no next file » | 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 "components/webdata/autofill/autofill_table.h" 5 #include "components/webdata/autofill/autofill_table.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 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 if (!s2.Run()) 315 if (!s2.Run())
316 return false; 316 return false;
317 317
318 sql::Statement s3(db->GetUniqueStatement( 318 sql::Statement s3(db->GetUniqueStatement(
319 "DELETE FROM autofill_profile_phones WHERE guid = ?")); 319 "DELETE FROM autofill_profile_phones WHERE guid = ?"));
320 s3.BindString(0, guid); 320 s3.BindString(0, guid);
321 321
322 return s3.Run(); 322 return s3.Run();
323 } 323 }
324 324
325 int table_key = 0;
326
327 WebDatabaseTable::TypeKey GetKey() { 325 WebDatabaseTable::TypeKey GetKey() {
326 // We just need a unique constant. Use the address of a static that
327 // COMDAT folding won't touch in an optimizing linker.
328 static int table_key = 0;
328 return reinterpret_cast<void*>(&table_key); 329 return reinterpret_cast<void*>(&table_key);
329 } 330 }
330 331
331 } // namespace 332 } // namespace
332 333
333 // The maximum length allowed for form data. 334 // The maximum length allowed for form data.
334 const size_t AutofillTable::kMaxDataLength = 1024; 335 const size_t AutofillTable::kMaxDataLength = 1024;
335 336
336 AutofillTable::AutofillTable(const std::string& app_locale) 337 AutofillTable::AutofillTable(const std::string& app_locale)
337 : app_locale_(app_locale) { 338 : app_locale_(app_locale) {
(...skipping 1702 matching lines...) Expand 10 before | Expand all | Expand 10 after
2040 "WHERE guid=?")); 2041 "WHERE guid=?"));
2041 s_date.BindInt64(0, date_item->second); 2042 s_date.BindInt64(0, date_item->second);
2042 s_date.BindString(1, iter->guid()); 2043 s_date.BindString(1, iter->guid());
2043 2044
2044 if (!s_date.Run()) 2045 if (!s_date.Run())
2045 return false; 2046 return false;
2046 } 2047 }
2047 2048
2048 return true; 2049 return true;
2049 } 2050 }
OLDNEW
« no previous file with comments | « chrome/browser/webdata/web_intents_table.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698