| 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_QUOTA_POLICY_CHANNEL_ID_STORE_H_ | 5 #ifndef CHROME_BROWSER_NET_QUOTA_POLICY_CHANNEL_ID_STORE_H_ |
| 6 #define CHROME_BROWSER_NET_QUOTA_POLICY_CHANNEL_ID_STORE_H_ | 6 #define CHROME_BROWSER_NET_QUOTA_POLICY_CHANNEL_ID_STORE_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 class QuotaPolicyChannelIDStore | 31 class QuotaPolicyChannelIDStore |
| 32 : public net::DefaultChannelIDStore::PersistentStore { | 32 : public net::DefaultChannelIDStore::PersistentStore { |
| 33 public: | 33 public: |
| 34 // Create or open persistent store in file |path|. All I/O tasks are performed | 34 // Create or open persistent store in file |path|. All I/O tasks are performed |
| 35 // in background using |background_task_runner|. If provided, a | 35 // in background using |background_task_runner|. If provided, a |
| 36 // |special_storage_policy| is consulted when the store is closed to decide | 36 // |special_storage_policy| is consulted when the store is closed to decide |
| 37 // which certificates to keep. | 37 // which certificates to keep. |
| 38 QuotaPolicyChannelIDStore( | 38 QuotaPolicyChannelIDStore( |
| 39 const base::FilePath& path, | 39 const base::FilePath& path, |
| 40 const scoped_refptr<base::SequencedTaskRunner>& background_task_runner, | 40 const scoped_refptr<base::SequencedTaskRunner>& background_task_runner, |
| 41 storage::SpecialStoragePolicy* special_storage_policy); | 41 const scoped_refptr<storage::SpecialStoragePolicy>& |
| 42 special_storage_policy); |
| 42 | 43 |
| 43 // net::DefaultChannelIDStore::PersistentStore: | 44 // net::DefaultChannelIDStore::PersistentStore: |
| 44 virtual void Load(const LoadedCallback& loaded_callback) OVERRIDE; | 45 virtual void Load(const LoadedCallback& loaded_callback) OVERRIDE; |
| 45 virtual void AddChannelID( | 46 virtual void AddChannelID( |
| 46 const net::DefaultChannelIDStore::ChannelID& channel_id) OVERRIDE; | 47 const net::DefaultChannelIDStore::ChannelID& channel_id) OVERRIDE; |
| 47 virtual void DeleteChannelID( | 48 virtual void DeleteChannelID( |
| 48 const net::DefaultChannelIDStore::ChannelID& channel_id) OVERRIDE; | 49 const net::DefaultChannelIDStore::ChannelID& channel_id) OVERRIDE; |
| 49 virtual void SetForceKeepSessionState() OVERRIDE; | 50 virtual void SetForceKeepSessionState() OVERRIDE; |
| 50 | 51 |
| 51 private: | 52 private: |
| 52 typedef ScopedVector<net::DefaultChannelIDStore::ChannelID> ChannelIDVector; | 53 typedef ScopedVector<net::DefaultChannelIDStore::ChannelID> ChannelIDVector; |
| 53 | 54 |
| 54 virtual ~QuotaPolicyChannelIDStore(); | 55 virtual ~QuotaPolicyChannelIDStore(); |
| 55 | 56 |
| 56 void OnLoad(const LoadedCallback& loaded_callback, | 57 void OnLoad(const LoadedCallback& loaded_callback, |
| 57 scoped_ptr<ChannelIDVector> channel_ids); | 58 scoped_ptr<ChannelIDVector> channel_ids); |
| 58 | 59 |
| 59 scoped_refptr<storage::SpecialStoragePolicy> special_storage_policy_; | 60 scoped_refptr<storage::SpecialStoragePolicy> special_storage_policy_; |
| 60 scoped_refptr<net::SQLiteChannelIDStore> persistent_store_; | 61 scoped_refptr<net::SQLiteChannelIDStore> persistent_store_; |
| 61 // Cache of server identifiers we have channel IDs stored for. | 62 // Cache of server identifiers we have channel IDs stored for. |
| 62 std::set<std::string> server_identifiers_; | 63 std::set<std::string> server_identifiers_; |
| 63 | 64 |
| 64 DISALLOW_COPY_AND_ASSIGN(QuotaPolicyChannelIDStore); | 65 DISALLOW_COPY_AND_ASSIGN(QuotaPolicyChannelIDStore); |
| 65 }; | 66 }; |
| 66 | 67 |
| 67 #endif // CHROME_BROWSER_NET_QUOTA_POLICY_CHANNEL_ID_STORE_H_ | 68 #endif // CHROME_BROWSER_NET_QUOTA_POLICY_CHANNEL_ID_STORE_H_ |
| OLD | NEW |