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

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

Issue 9572036: Convert uses of int ms to TimeDelta in chrome/browser and net. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Add more TimeDelta integration. Created 8 years, 9 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 | « chrome/browser/net/sqlite_origin_bound_cert_store.cc ('k') | chrome/browser/plugin_prefs.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 "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 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <utility> 10 #include <utility>
(...skipping 796 matching lines...) Expand 10 before | Expand all | Expand 10 after
807 { 807 {
808 base::AutoLock locked(lock_); 808 base::AutoLock locked(lock_);
809 pending_.push_back(po.release()); 809 pending_.push_back(po.release());
810 num_pending = ++num_pending_; 810 num_pending = ++num_pending_;
811 } 811 }
812 812
813 if (num_pending == 1) { 813 if (num_pending == 1) {
814 // We've gotten our first entry for this batch, fire off the timer. 814 // We've gotten our first entry for this batch, fire off the timer.
815 BrowserThread::PostDelayedTask( 815 BrowserThread::PostDelayedTask(
816 BrowserThread::DB, FROM_HERE, 816 BrowserThread::DB, FROM_HERE,
817 base::Bind(&Backend::Commit, this), kCommitIntervalMs); 817 base::Bind(&Backend::Commit, this),
818 base::TimeDelta::FromMilliseconds(kCommitIntervalMs));
818 } else if (num_pending == kCommitAfterBatchSize) { 819 } else if (num_pending == kCommitAfterBatchSize) {
819 // We've reached a big enough batch, fire off a commit now. 820 // We've reached a big enough batch, fire off a commit now.
820 BrowserThread::PostTask( 821 BrowserThread::PostTask(
821 BrowserThread::DB, FROM_HERE, 822 BrowserThread::DB, FROM_HERE,
822 base::Bind(&Backend::Commit, this)); 823 base::Bind(&Backend::Commit, this));
823 } 824 }
824 } 825 }
825 826
826 void SQLitePersistentCookieStore::Backend::Commit() { 827 void SQLitePersistentCookieStore::Backend::Commit() {
827 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); 828 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
1006 if (backend_.get()) 1007 if (backend_.get())
1007 backend_->SetClearLocalStateOnExit(clear_local_state); 1008 backend_->SetClearLocalStateOnExit(clear_local_state);
1008 } 1009 }
1009 1010
1010 void SQLitePersistentCookieStore::Flush(const base::Closure& callback) { 1011 void SQLitePersistentCookieStore::Flush(const base::Closure& callback) {
1011 if (backend_.get()) 1012 if (backend_.get())
1012 backend_->Flush(callback); 1013 backend_->Flush(callback);
1013 else if (!callback.is_null()) 1014 else if (!callback.is_null())
1014 MessageLoop::current()->PostTask(FROM_HERE, callback); 1015 MessageLoop::current()->PostTask(FROM_HERE, callback);
1015 } 1016 }
OLDNEW
« no previous file with comments | « chrome/browser/net/sqlite_origin_bound_cert_store.cc ('k') | chrome/browser/plugin_prefs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698