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

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

Issue 9597005: Revert 124890 - Convert uses of int ms to TimeDelta in chrome/browser and net. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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 | Annotate | Revision Log
« 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), 817 base::Bind(&Backend::Commit, this), kCommitIntervalMs);
818 base::TimeDelta::FromMilliseconds(kCommitIntervalMs));
819 } else if (num_pending == kCommitAfterBatchSize) { 818 } else if (num_pending == kCommitAfterBatchSize) {
820 // We've reached a big enough batch, fire off a commit now. 819 // We've reached a big enough batch, fire off a commit now.
821 BrowserThread::PostTask( 820 BrowserThread::PostTask(
822 BrowserThread::DB, FROM_HERE, 821 BrowserThread::DB, FROM_HERE,
823 base::Bind(&Backend::Commit, this)); 822 base::Bind(&Backend::Commit, this));
824 } 823 }
825 } 824 }
826 825
827 void SQLitePersistentCookieStore::Backend::Commit() { 826 void SQLitePersistentCookieStore::Backend::Commit() {
828 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); 827 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
1007 if (backend_.get()) 1006 if (backend_.get())
1008 backend_->SetClearLocalStateOnExit(clear_local_state); 1007 backend_->SetClearLocalStateOnExit(clear_local_state);
1009 } 1008 }
1010 1009
1011 void SQLitePersistentCookieStore::Flush(const base::Closure& callback) { 1010 void SQLitePersistentCookieStore::Flush(const base::Closure& callback) {
1012 if (backend_.get()) 1011 if (backend_.get())
1013 backend_->Flush(callback); 1012 backend_->Flush(callback);
1014 else if (!callback.is_null()) 1013 else if (!callback.is_null())
1015 MessageLoop::current()->PostTask(FROM_HERE, callback); 1014 MessageLoop::current()->PostTask(FROM_HERE, callback);
1016 } 1015 }
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