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

Side by Side Diff: webkit/appcache/appcache_database.cc

Issue 14976003: Histogram versions and extended error codes for SQLite databases. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Oops - need old histograms for continuity. Created 7 years, 7 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 | « tools/metrics/histograms/histograms.xml ('k') | webkit/database/database_tracker.cc » ('j') | 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 "webkit/appcache/appcache_database.h" 5 #include "webkit/appcache/appcache_database.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 983 matching lines...) Expand 10 before | Expand all | Expand 10 after
994 // Avoid creating a database at all if we can. 994 // Avoid creating a database at all if we can.
995 bool use_in_memory_db = db_file_path_.empty(); 995 bool use_in_memory_db = db_file_path_.empty();
996 if (!create_if_needed && 996 if (!create_if_needed &&
997 (use_in_memory_db || !file_util::PathExists(db_file_path_))) { 997 (use_in_memory_db || !file_util::PathExists(db_file_path_))) {
998 return false; 998 return false;
999 } 999 }
1000 1000
1001 db_.reset(new sql::Connection); 1001 db_.reset(new sql::Connection);
1002 meta_table_.reset(new sql::MetaTable); 1002 meta_table_.reset(new sql::MetaTable);
1003 1003
1004 db_->set_error_histogram_name("Sqlite.AppCache.Error"); 1004 db_->set_histogram_tag("AppCache");
1005 1005
1006 bool opened = false; 1006 bool opened = false;
1007 if (use_in_memory_db) { 1007 if (use_in_memory_db) {
1008 opened = db_->OpenInMemory(); 1008 opened = db_->OpenInMemory();
1009 } else if (!file_util::CreateDirectory(db_file_path_.DirName())) { 1009 } else if (!file_util::CreateDirectory(db_file_path_.DirName())) {
1010 LOG(ERROR) << "Failed to create appcache directory."; 1010 LOG(ERROR) << "Failed to create appcache directory.";
1011 } else { 1011 } else {
1012 opened = db_->Open(db_file_path_); 1012 opened = db_->Open(db_file_path_);
1013 if (opened) 1013 if (opened)
1014 db_->Preload(); 1014 db_->Preload();
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
1197 1197
1198 // So we can't go recursive. 1198 // So we can't go recursive.
1199 if (is_recreating_) 1199 if (is_recreating_)
1200 return false; 1200 return false;
1201 1201
1202 base::AutoReset<bool> auto_reset(&is_recreating_, true); 1202 base::AutoReset<bool> auto_reset(&is_recreating_, true);
1203 return LazyOpen(true); 1203 return LazyOpen(true);
1204 } 1204 }
1205 1205
1206 } // namespace appcache 1206 } // namespace appcache
OLDNEW
« no previous file with comments | « tools/metrics/histograms/histograms.xml ('k') | webkit/database/database_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698