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

Side by Side Diff: chrome/browser/history/thumbnail_database.cc

Issue 12096073: Implement sql::Connection::RazeAndClose(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Disable DEATH test on android and ios. Created 7 years, 10 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
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/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 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 // it should be. This error cannot be detected via the SQL error code because 202 // it should be. This error cannot be detected via the SQL error code because
203 // the error code for running SQL statements against a database with missing 203 // the error code for running SQL statements against a database with missing
204 // columns is SQLITE_ERROR which is not unique enough to act upon. 204 // columns is SQLITE_ERROR which is not unique enough to act upon.
205 // TODO(pkotwicz): Revisit this in M27 and see if the razing can be removed. 205 // TODO(pkotwicz): Revisit this in M27 and see if the razing can be removed.
206 // (crbug.com/166453) 206 // (crbug.com/166453)
207 if (IsFaviconDBStructureIncorrect()) { 207 if (IsFaviconDBStructureIncorrect()) {
208 LOG(ERROR) << "Raze thumbnail database because of invalid favicon db" 208 LOG(ERROR) << "Raze thumbnail database because of invalid favicon db"
209 << "structure."; 209 << "structure.";
210 UMA_HISTOGRAM_BOOLEAN("History.InvalidFaviconsDBStructure", true); 210 UMA_HISTOGRAM_BOOLEAN("History.InvalidFaviconsDBStructure", true);
211 211
212 db_.Raze(); 212 db_.RazeAndClose();
213 db_.Close();
214 return sql::INIT_FAILURE; 213 return sql::INIT_FAILURE;
215 } 214 }
216 215
217 return sql::INIT_OK; 216 return sql::INIT_OK;
218 } 217 }
219 218
220 sql::InitStatus ThumbnailDatabase::OpenDatabase(sql::Connection* db, 219 sql::InitStatus ThumbnailDatabase::OpenDatabase(sql::Connection* db,
221 const FilePath& db_name) { 220 const FilePath& db_name) {
222 db->set_error_histogram_name("Sqlite.Thumbnail.Error"); 221 db->set_error_histogram_name("Sqlite.Thumbnail.Error");
223 222
(...skipping 932 matching lines...) Expand 10 before | Expand all | Expand 10 after
1156 } 1155 }
1157 parsing_errors |= !base::StringToInt(t.token(), &height); 1156 parsing_errors |= !base::StringToInt(t.token(), &height);
1158 favicon_sizes->push_back(gfx::Size(width, height)); 1157 favicon_sizes->push_back(gfx::Size(width, height));
1159 } 1158 }
1160 1159
1161 if (parsing_errors) 1160 if (parsing_errors)
1162 favicon_sizes->clear(); 1161 favicon_sizes->clear();
1163 } 1162 }
1164 1163
1165 } // namespace history 1164 } // namespace history
OLDNEW
« no previous file with comments | « chrome/browser/extensions/activity_database.cc ('k') | chrome/browser/net/sqlite_persistent_cookie_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698