OLD | NEW |
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/web_intents_table.h" | 5 #include "chrome/browser/webdata/web_intents_table.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/i18n/case_conversion.h" | 9 #include "base/i18n/case_conversion.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/string_util.h" | 11 #include "base/string_util.h" |
12 #include "base/utf_string_conversions.h" | 12 #include "base/utf_string_conversions.h" |
13 #include "components/webdata/common/web_database.h" | 13 #include "components/webdata/common/web_database.h" |
14 #include "googleurl/src/gurl.h" | 14 #include "googleurl/src/gurl.h" |
15 #include "net/base/mime_util.h" | 15 #include "net/base/mime_util.h" |
16 #include "sql/statement.h" | 16 #include "sql/statement.h" |
17 #include "third_party/sqlite/sqlite3.h" | 17 #include "third_party/sqlite/sqlite3.h" |
18 | 18 |
19 namespace { | 19 namespace { |
20 | 20 |
21 int table_key = 0; | |
22 | |
23 WebDatabaseTable::TypeKey GetKey() { | 21 WebDatabaseTable::TypeKey GetKey() { |
| 22 // We just need a unique constant. Use the address of a static that |
| 23 // COMDAT folding won't touch in an optimizing linker. |
| 24 static int table_key = 0; |
24 return reinterpret_cast<void*>(&table_key); | 25 return reinterpret_cast<void*>(&table_key); |
25 } | 26 } |
26 | 27 |
27 } // namespace | 28 } // namespace |
28 | 29 |
29 WebIntentsTable::WebIntentsTable() { | 30 WebIntentsTable::WebIntentsTable() { |
30 } | 31 } |
31 | 32 |
32 WebIntentsTable::~WebIntentsTable() { | 33 WebIntentsTable::~WebIntentsTable() { |
33 } | 34 } |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 return false; | 149 return false; |
149 } | 150 } |
150 | 151 |
151 if (!db_->Execute("DROP table old_web_intents_defaults")) { | 152 if (!db_->Execute("DROP table old_web_intents_defaults")) { |
152 DLOG(WARNING) << "Could not drop backup web_intents_defaults table."; | 153 DLOG(WARNING) << "Could not drop backup web_intents_defaults table."; |
153 return false; | 154 return false; |
154 } | 155 } |
155 | 156 |
156 return true; | 157 return true; |
157 } | 158 } |
OLD | NEW |