| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef CHROME_BROWSER_NET_SQLITE_CHANNEL_ID_STORE_H_ | 5 #ifndef NET_EXTRAS_SQLITE_SQLITE_CHANNEL_ID_STORE_H_ |
| 6 #define CHROME_BROWSER_NET_SQLITE_CHANNEL_ID_STORE_H_ | 6 #define NET_EXTRAS_SQLITE_SQLITE_CHANNEL_ID_STORE_H_ |
| 7 |
| 8 #include <list> |
| 9 #include <string> |
| 7 | 10 |
| 8 #include "base/callback_forward.h" | 11 #include "base/callback_forward.h" |
| 9 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/macros.h" |
| 10 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 11 #include "net/ssl/default_channel_id_store.h" | 15 #include "net/ssl/default_channel_id_store.h" |
| 12 | 16 |
| 13 namespace base { | 17 namespace base { |
| 14 class FilePath; | 18 class FilePath; |
| 15 class SequencedTaskRunner; | 19 class SequencedTaskRunner; |
| 16 } | 20 } |
| 17 | 21 |
| 18 namespace quota { | 22 class GURL; |
| 19 class SpecialStoragePolicy; | |
| 20 } | |
| 21 | 23 |
| 22 // Implements the net::DefaultChannelIDStore::PersistentStore interface | 24 namespace net { |
| 25 |
| 26 // Implements the DefaultChannelIDStore::PersistentStore interface |
| 23 // in terms of a SQLite database. For documentation about the actual member | 27 // in terms of a SQLite database. For documentation about the actual member |
| 24 // functions consult the documentation of the parent class | 28 // functions consult the documentation of the parent class |
| 25 // |net::DefaultChannelIDStore::PersistentCertStore|. | 29 // DefaultChannelIDStore::PersistentCertStore. |
| 26 // If provided, a |SpecialStoragePolicy| is consulted when the SQLite database | 30 class SQLiteChannelIDStore : public DefaultChannelIDStore::PersistentStore { |
| 27 // is closed to decide which certificates to keep. | |
| 28 class SQLiteChannelIDStore | |
| 29 : public net::DefaultChannelIDStore::PersistentStore { | |
| 30 public: | 31 public: |
| 32 // Create or open persistent store in file |path|. All I/O tasks are performed |
| 33 // in background using |background_task_runner|. |
| 31 SQLiteChannelIDStore( | 34 SQLiteChannelIDStore( |
| 32 const base::FilePath& path, | 35 const base::FilePath& path, |
| 33 const scoped_refptr<base::SequencedTaskRunner>& background_task_runner, | 36 const scoped_refptr<base::SequencedTaskRunner>& background_task_runner); |
| 34 quota::SpecialStoragePolicy* special_storage_policy); | |
| 35 | 37 |
| 36 // net::DefaultChannelIDStore::PersistentStore: | 38 // DefaultChannelIDStore::PersistentStore: |
| 37 virtual void Load(const LoadedCallback& loaded_callback) OVERRIDE; | 39 virtual void Load(const LoadedCallback& loaded_callback) OVERRIDE; |
| 38 virtual void AddChannelID( | 40 virtual void AddChannelID( |
| 39 const net::DefaultChannelIDStore::ChannelID& channel_id) OVERRIDE; | 41 const DefaultChannelIDStore::ChannelID& channel_id) OVERRIDE; |
| 40 virtual void DeleteChannelID( | 42 virtual void DeleteChannelID( |
| 41 const net::DefaultChannelIDStore::ChannelID& channel_idx) OVERRIDE; | 43 const DefaultChannelIDStore::ChannelID& channel_id) OVERRIDE; |
| 42 virtual void SetForceKeepSessionState() OVERRIDE; | 44 virtual void SetForceKeepSessionState() OVERRIDE; |
| 43 | 45 |
| 44 protected: | 46 // Delete channel ids from servers in |server_identifiers|. |
| 47 void DeleteAllInList(const std::list<std::string>& server_identifiers); |
| 48 |
| 49 private: |
| 45 virtual ~SQLiteChannelIDStore(); | 50 virtual ~SQLiteChannelIDStore(); |
| 46 | 51 |
| 47 private: | |
| 48 class Backend; | 52 class Backend; |
| 49 | 53 |
| 50 scoped_refptr<Backend> backend_; | 54 scoped_refptr<Backend> backend_; |
| 51 | 55 |
| 52 DISALLOW_COPY_AND_ASSIGN(SQLiteChannelIDStore); | 56 DISALLOW_COPY_AND_ASSIGN(SQLiteChannelIDStore); |
| 53 }; | 57 }; |
| 54 | 58 |
| 55 #endif // CHROME_BROWSER_NET_SQLITE_CHANNEL_ID_STORE_H_ | 59 } // namespace net |
| 60 |
| 61 #endif // NET_EXTRAS_SQLITE_SQLITE_CHANNEL_ID_STORE_H_ |
| OLD | NEW |