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

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

Issue 100573002: Move directory creation functions to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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
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 526 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 537
538 if (initialized_ || corruption_detected_) { 538 if (initialized_ || corruption_detected_) {
539 // Return false if we were previously initialized but the DB has since been 539 // Return false if we were previously initialized but the DB has since been
540 // closed, or if corruption caused a database reset during initialization. 540 // closed, or if corruption caused a database reset during initialization.
541 return db_ != NULL; 541 return db_ != NULL;
542 } 542 }
543 543
544 base::Time start = base::Time::Now(); 544 base::Time start = base::Time::Now();
545 545
546 const base::FilePath dir = path_.DirName(); 546 const base::FilePath dir = path_.DirName();
547 if (!base::PathExists(dir) && !file_util::CreateDirectory(dir)) { 547 if (!base::PathExists(dir) && !base::CreateDirectory(dir)) {
548 return false; 548 return false;
549 } 549 }
550 550
551 int64 db_size = 0; 551 int64 db_size = 0;
552 if (file_util::GetFileSize(path_, &db_size)) 552 if (file_util::GetFileSize(path_, &db_size))
553 UMA_HISTOGRAM_COUNTS("Cookie.DBSizeInKB", db_size / 1024 ); 553 UMA_HISTOGRAM_COUNTS("Cookie.DBSizeInKB", db_size / 1024 );
554 554
555 db_.reset(new sql::Connection); 555 db_.reset(new sql::Connection);
556 db_->set_histogram_tag("Cookie"); 556 db_->set_histogram_tag("Cookie");
557 557
(...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after
1219 path, 1219 path,
1220 restore_old_session_cookies, 1220 restore_old_session_cookies,
1221 storage_policy, 1221 storage_policy,
1222 cookie_monster_delegate, 1222 cookie_monster_delegate,
1223 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), 1223 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO),
1224 BrowserThread::GetBlockingPool()->GetSequencedTaskRunner( 1224 BrowserThread::GetBlockingPool()->GetSequencedTaskRunner(
1225 BrowserThread::GetBlockingPool()->GetSequenceToken())); 1225 BrowserThread::GetBlockingPool()->GetSequenceToken()));
1226 } 1226 }
1227 1227
1228 } // namespace content 1228 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698