OLD | NEW |
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 22 matching lines...) Expand all Loading... |
33 using content::BrowserThread; | 33 using content::BrowserThread; |
34 | 34 |
35 // This class is designed to be shared between any calling threads and the | 35 // This class is designed to be shared between any calling threads and the |
36 // database thread. It batches operations and commits them on a timer. | 36 // database thread. It batches operations and commits them on a timer. |
37 class SQLiteServerBoundCertStore::Backend | 37 class SQLiteServerBoundCertStore::Backend |
38 : public base::RefCountedThreadSafe<SQLiteServerBoundCertStore::Backend> { | 38 : public base::RefCountedThreadSafe<SQLiteServerBoundCertStore::Backend> { |
39 public: | 39 public: |
40 Backend(const base::FilePath& path, | 40 Backend(const base::FilePath& path, |
41 quota::SpecialStoragePolicy* special_storage_policy) | 41 quota::SpecialStoragePolicy* special_storage_policy) |
42 : path_(path), | 42 : path_(path), |
43 db_(NULL), | |
44 num_pending_(0), | 43 num_pending_(0), |
45 force_keep_session_state_(false), | 44 force_keep_session_state_(false), |
46 special_storage_policy_(special_storage_policy), | 45 special_storage_policy_(special_storage_policy), |
47 corruption_detected_(false) { | 46 corruption_detected_(false) {} |
48 } | |
49 | 47 |
50 // Creates or loads the SQLite database. | 48 // Creates or loads the SQLite database. |
51 void Load(const LoadedCallback& loaded_callback); | 49 void Load(const LoadedCallback& loaded_callback); |
52 | 50 |
53 // Batch a server bound cert addition. | 51 // Batch a server bound cert addition. |
54 void AddServerBoundCert( | 52 void AddServerBoundCert( |
55 const net::DefaultServerBoundCertStore::ServerBoundCert& cert); | 53 const net::DefaultServerBoundCertStore::ServerBoundCert& cert); |
56 | 54 |
57 // Batch a server bound cert deletion. | 55 // Batch a server bound cert deletion. |
58 void DeleteServerBoundCert( | 56 void DeleteServerBoundCert( |
(...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
636 | 634 |
637 void SQLiteServerBoundCertStore::SetForceKeepSessionState() { | 635 void SQLiteServerBoundCertStore::SetForceKeepSessionState() { |
638 backend_->SetForceKeepSessionState(); | 636 backend_->SetForceKeepSessionState(); |
639 } | 637 } |
640 | 638 |
641 SQLiteServerBoundCertStore::~SQLiteServerBoundCertStore() { | 639 SQLiteServerBoundCertStore::~SQLiteServerBoundCertStore() { |
642 backend_->Close(); | 640 backend_->Close(); |
643 // We release our reference to the Backend, though it will probably still have | 641 // We release our reference to the Backend, though it will probably still have |
644 // a reference if the background thread has not run Close() yet. | 642 // a reference if the background thread has not run Close() yet. |
645 } | 643 } |
OLD | NEW |