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

Side by Side Diff: content/browser/net/sqlite_persistent_cookie_store.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 | « components/webdata/common/web_database.cc ('k') | sql/connection.h » ('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 "content/browser/net/sqlite_persistent_cookie_store.h" 5 #include "content/browser/net/sqlite_persistent_cookie_store.h"
6 6
7 #include <list> 7 #include <list>
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <utility> 10 #include <utility>
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after
589 const base::FilePath dir = path_.DirName(); 589 const base::FilePath dir = path_.DirName();
590 if (!file_util::PathExists(dir) && !file_util::CreateDirectory(dir)) { 590 if (!file_util::PathExists(dir) && !file_util::CreateDirectory(dir)) {
591 return false; 591 return false;
592 } 592 }
593 593
594 int64 db_size = 0; 594 int64 db_size = 0;
595 if (file_util::GetFileSize(path_, &db_size)) 595 if (file_util::GetFileSize(path_, &db_size))
596 UMA_HISTOGRAM_COUNTS("Cookie.DBSizeInKB", db_size / 1024 ); 596 UMA_HISTOGRAM_COUNTS("Cookie.DBSizeInKB", db_size / 1024 );
597 597
598 db_.reset(new sql::Connection); 598 db_.reset(new sql::Connection);
599 db_->set_error_histogram_name("Sqlite.Cookie.Error"); 599 db_->set_histogram_tag("Cookie");
600 db_->set_error_delegate(new KillDatabaseErrorDelegate(this)); 600 db_->set_error_delegate(new KillDatabaseErrorDelegate(this));
601 601
602 if (!db_->Open(path_)) { 602 if (!db_->Open(path_)) {
603 NOTREACHED() << "Unable to open cookie DB."; 603 NOTREACHED() << "Unable to open cookie DB.";
604 if (corruption_detected_) 604 if (corruption_detected_)
605 db_->Raze(); 605 db_->Raze();
606 meta_table_.Reset(); 606 meta_table_.Reset();
607 db_.reset(); 607 db_.reset();
608 return false; 608 return false;
609 } 609 }
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after
1214 path, 1214 path,
1215 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), 1215 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO),
1216 BrowserThread::GetBlockingPool()->GetSequencedTaskRunner( 1216 BrowserThread::GetBlockingPool()->GetSequencedTaskRunner(
1217 BrowserThread::GetBlockingPool()->GetSequenceToken()), 1217 BrowserThread::GetBlockingPool()->GetSequenceToken()),
1218 restore_old_session_cookies, 1218 restore_old_session_cookies,
1219 storage_policy); 1219 storage_policy);
1220 return new net::CookieMonster(persistent_store, cookie_monster_delegate); 1220 return new net::CookieMonster(persistent_store, cookie_monster_delegate);
1221 } 1221 }
1222 1222
1223 } // namespace content 1223 } // namespace content
OLDNEW
« no previous file with comments | « components/webdata/common/web_database.cc ('k') | sql/connection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698