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_database.h" | 5 #include "chrome/browser/webdata/web_database.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "chrome/browser/webdata/autofill_table.h" | 9 #include "chrome/browser/webdata/autofill_table.h" |
10 #include "chrome/browser/webdata/keyword_table.h" | 10 #include "chrome/browser/webdata/keyword_table.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 } | 82 } |
83 | 83 |
84 WebIntentsTable* WebDatabase::GetWebIntentsTable() { | 84 WebIntentsTable* WebDatabase::GetWebIntentsTable() { |
85 return web_intents_table_.get(); | 85 return web_intents_table_.get(); |
86 } | 86 } |
87 | 87 |
88 sql::Connection* WebDatabase::GetSQLConnection() { | 88 sql::Connection* WebDatabase::GetSQLConnection() { |
89 return &db_; | 89 return &db_; |
90 } | 90 } |
91 | 91 |
92 sql::InitStatus WebDatabase::Init(const FilePath& db_name, | 92 sql::InitStatus WebDatabase::Init(const base::FilePath& db_name, |
93 const std::string& app_locale) { | 93 const std::string& app_locale) { |
94 // When running in unit tests, there is already a NotificationService object. | 94 // When running in unit tests, there is already a NotificationService object. |
95 // Since only one can exist at a time per thread, check first. | 95 // Since only one can exist at a time per thread, check first. |
96 if (!content::NotificationService::current()) | 96 if (!content::NotificationService::current()) |
97 notification_service_.reset(content::NotificationService::Create()); | 97 notification_service_.reset(content::NotificationService::Create()); |
98 | 98 |
99 db_.set_error_histogram_name("Sqlite.Web.Error"); | 99 db_.set_error_histogram_name("Sqlite.Web.Error"); |
100 | 100 |
101 // We don't store that much data in the tables so use a small page size. | 101 // We don't store that much data in the tables so use a small page size. |
102 // This provides a large benefit for empty tables (which is very likely with | 102 // This provides a large benefit for empty tables (which is very likely with |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 | 368 |
369 // Add successive versions here. Each should set the version number and | 369 // Add successive versions here. Each should set the version number and |
370 // compatible version number as appropriate, then fall through to the next | 370 // compatible version number as appropriate, then fall through to the next |
371 // case. | 371 // case. |
372 | 372 |
373 case kCurrentVersionNumber: | 373 case kCurrentVersionNumber: |
374 // No migration needed. | 374 // No migration needed. |
375 return sql::INIT_OK; | 375 return sql::INIT_OK; |
376 } | 376 } |
377 } | 377 } |
OLD | NEW |