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

Side by Side Diff: chrome/browser/net/sqlite_persistent_cookie_store.cc

Issue 2718011: Initial commit of CookieMonster statistics. (Closed)
Patch Set: Fix perf degradation, add requested comment. Created 10 years, 6 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
« no previous file with comments | « no previous file | net/base/cookie_monster.h » ('j') | net/base/cookie_monster.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/net/sqlite_persistent_cookie_store.h" 5 #include "chrome/browser/net/sqlite_persistent_cookie_store.h"
6 6
7 #include <list> 7 #include <list>
8 8
9 #include "app/sql/statement.h" 9 #include "app/sql/statement.h"
10 #include "app/sql/transaction.h" 10 #include "app/sql/transaction.h"
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 del_smt.BindInt64(0, po->cc().CreationDate().ToInternalValue()); 224 del_smt.BindInt64(0, po->cc().CreationDate().ToInternalValue());
225 if (!del_smt.Run()) 225 if (!del_smt.Run())
226 NOTREACHED() << "Could not delete a cookie from the DB."; 226 NOTREACHED() << "Could not delete a cookie from the DB.";
227 break; 227 break;
228 228
229 default: 229 default:
230 NOTREACHED(); 230 NOTREACHED();
231 break; 231 break;
232 } 232 }
233 } 233 }
234 transaction.Commit(); 234 bool succeeded = transaction.Commit();
235 UMA_HISTOGRAM_ENUMERATION("net.CookieBackingStoreUpdateResults",
236 succeeded ? 0 : 1, 2);
235 } 237 }
236 238
237 // Fire off a close message to the background thread. We could still have a 239 // Fire off a close message to the background thread. We could still have a
238 // pending commit timer that will be holding a reference on us, but if/when 240 // pending commit timer that will be holding a reference on us, but if/when
239 // this fires we will already have been cleaned up and it will be ignored. 241 // this fires we will already have been cleaned up and it will be ignored.
240 void SQLitePersistentCookieStore::Backend::Close() { 242 void SQLitePersistentCookieStore::Backend::Close() {
241 DCHECK(!ChromeThread::CurrentlyOn(ChromeThread::DB)); 243 DCHECK(!ChromeThread::CurrentlyOn(ChromeThread::DB));
242 // Must close the backend on the background thread. 244 // Must close the backend on the background thread.
243 ChromeThread::PostTask( 245 ChromeThread::PostTask(
244 ChromeThread::DB, FROM_HERE, 246 ChromeThread::DB, FROM_HERE,
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 const net::CookieMonster::CanonicalCookie& cc) { 446 const net::CookieMonster::CanonicalCookie& cc) {
445 if (backend_.get()) 447 if (backend_.get())
446 backend_->DeleteCookie(cc); 448 backend_->DeleteCookie(cc);
447 } 449 }
448 450
449 // static 451 // static
450 void SQLitePersistentCookieStore::ClearLocalState( 452 void SQLitePersistentCookieStore::ClearLocalState(
451 const FilePath& path) { 453 const FilePath& path) {
452 file_util::Delete(path, false); 454 file_util::Delete(path, false);
453 } 455 }
OLDNEW
« no previous file with comments | « no previous file | net/base/cookie_monster.h » ('j') | net/base/cookie_monster.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698