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

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

Issue 18286004: Move PathExists to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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/net_log_temp_file_unittest.cc ('k') | chrome/browser/net/url_fixer_upper.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_server_bound_cert_store.h" 5 #include "chrome/browser/net/sqlite_server_bound_cert_store.h"
6 6
7 #include <list> 7 #include <list>
8 #include <set> 8 #include <set>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); 193 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
194 194
195 // This method should be called only once per instance. 195 // This method should be called only once per instance.
196 DCHECK(!db_.get()); 196 DCHECK(!db_.get());
197 197
198 base::TimeTicks start = base::TimeTicks::Now(); 198 base::TimeTicks start = base::TimeTicks::Now();
199 199
200 // Ensure the parent directory for storing certs is created before reading 200 // Ensure the parent directory for storing certs is created before reading
201 // from it. 201 // from it.
202 const base::FilePath dir = path_.DirName(); 202 const base::FilePath dir = path_.DirName();
203 if (!file_util::PathExists(dir) && !file_util::CreateDirectory(dir)) 203 if (!base::PathExists(dir) && !file_util::CreateDirectory(dir))
204 return; 204 return;
205 205
206 int64 db_size = 0; 206 int64 db_size = 0;
207 if (file_util::GetFileSize(path_, &db_size)) 207 if (file_util::GetFileSize(path_, &db_size))
208 UMA_HISTOGRAM_COUNTS("DomainBoundCerts.DBSizeInKB", db_size / 1024 ); 208 UMA_HISTOGRAM_COUNTS("DomainBoundCerts.DBSizeInKB", db_size / 1024 );
209 209
210 db_.reset(new sql::Connection); 210 db_.reset(new sql::Connection);
211 db_->set_histogram_tag("DomainBoundCerts"); 211 db_->set_histogram_tag("DomainBoundCerts");
212 212
213 // Unretained to avoid a ref loop with db_. 213 // Unretained to avoid a ref loop with db_.
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
633 633
634 void SQLiteServerBoundCertStore::SetForceKeepSessionState() { 634 void SQLiteServerBoundCertStore::SetForceKeepSessionState() {
635 backend_->SetForceKeepSessionState(); 635 backend_->SetForceKeepSessionState();
636 } 636 }
637 637
638 SQLiteServerBoundCertStore::~SQLiteServerBoundCertStore() { 638 SQLiteServerBoundCertStore::~SQLiteServerBoundCertStore() {
639 backend_->Close(); 639 backend_->Close();
640 // We release our reference to the Backend, though it will probably still have 640 // We release our reference to the Backend, though it will probably still have
641 // a reference if the background thread has not run Close() yet. 641 // a reference if the background thread has not run Close() yet.
642 } 642 }
OLDNEW
« no previous file with comments | « chrome/browser/net/net_log_temp_file_unittest.cc ('k') | chrome/browser/net/url_fixer_upper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698