| 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/history/thumbnail_database.h" | 5 #include "chrome/browser/history/thumbnail_database.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 | 211 |
| 212 db_.RazeAndClose(); | 212 db_.RazeAndClose(); |
| 213 return sql::INIT_FAILURE; | 213 return sql::INIT_FAILURE; |
| 214 } | 214 } |
| 215 | 215 |
| 216 return sql::INIT_OK; | 216 return sql::INIT_OK; |
| 217 } | 217 } |
| 218 | 218 |
| 219 sql::InitStatus ThumbnailDatabase::OpenDatabase(sql::Connection* db, | 219 sql::InitStatus ThumbnailDatabase::OpenDatabase(sql::Connection* db, |
| 220 const base::FilePath& db_name) { | 220 const base::FilePath& db_name) { |
| 221 db->set_error_histogram_name("Sqlite.Thumbnail.Error"); | 221 db->set_histogram_prefix("Sqlite.Thumbnail"); |
| 222 | 222 |
| 223 // Thumbnails db now only stores favicons, so we don't need that big a page | 223 // Thumbnails db now only stores favicons, so we don't need that big a page |
| 224 // size or cache. | 224 // size or cache. |
| 225 db->set_page_size(2048); | 225 db->set_page_size(2048); |
| 226 db->set_cache_size(32); | 226 db->set_cache_size(32); |
| 227 | 227 |
| 228 // Run the database in exclusive mode. Nobody else should be accessing the | 228 // Run the database in exclusive mode. Nobody else should be accessing the |
| 229 // database while we're running, and this will give somewhat improved perf. | 229 // database while we're running, and this will give somewhat improved perf. |
| 230 db->set_exclusive_locking(); | 230 db->set_exclusive_locking(); |
| 231 | 231 |
| (...skipping 932 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1164 } | 1164 } |
| 1165 parsing_errors |= !base::StringToInt(t.token(), &height); | 1165 parsing_errors |= !base::StringToInt(t.token(), &height); |
| 1166 favicon_sizes->push_back(gfx::Size(width, height)); | 1166 favicon_sizes->push_back(gfx::Size(width, height)); |
| 1167 } | 1167 } |
| 1168 | 1168 |
| 1169 if (parsing_errors) | 1169 if (parsing_errors) |
| 1170 favicon_sizes->clear(); | 1170 favicon_sizes->clear(); |
| 1171 } | 1171 } |
| 1172 | 1172 |
| 1173 } // namespace history | 1173 } // namespace history |
| OLD | NEW |