OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_BROWSER_NET_QUOTA_POLICY_CHANNEL_ID_STORE_H_ |
| 6 #define CONTENT_BROWSER_NET_QUOTA_POLICY_CHANNEL_ID_STORE_H_ |
| 7 |
| 8 #include "base/callback_forward.h" |
| 9 #include "base/compiler_specific.h" |
| 10 #include "base/memory/ref_counted.h" |
| 11 #include "content/common/content_export.h" |
| 12 #include "net/ssl/default_channel_id_store.h" |
| 13 |
| 14 namespace base { |
| 15 class FilePath; |
| 16 class SequencedTaskRunner; |
| 17 } |
| 18 |
| 19 namespace quota { |
| 20 class SpecialStoragePolicy; |
| 21 } |
| 22 |
| 23 namespace content { |
| 24 |
| 25 // Persistent ChannelID Store that takes into account SpecialStoragePolicy and |
| 26 // removes ChannelIDs that StorageSessionOnly when store is closed. |
| 27 class CONTENT_EXPORT QuotaPolicyChannelIDStore |
| 28 : public net::DefaultChannelIDStore::PersistentStore { |
| 29 public: |
| 30 QuotaPolicyChannelIDStore( |
| 31 const base::FilePath& path, |
| 32 const scoped_refptr<base::SequencedTaskRunner>& background_task_runner, |
| 33 quota::SpecialStoragePolicy* special_storage_policy); |
| 34 |
| 35 // net::DefaultChannelIDStore::PersistentStore: |
| 36 virtual void Load(const LoadedCallback& loaded_callback) OVERRIDE; |
| 37 virtual void AddChannelID( |
| 38 const net::DefaultChannelIDStore::ChannelID& cert) OVERRIDE; |
| 39 virtual void DeleteChannelID( |
| 40 const net::DefaultChannelIDStore::ChannelID& cert) OVERRIDE; |
| 41 virtual void SetForceKeepSessionState() OVERRIDE; |
| 42 |
| 43 protected: |
| 44 virtual ~QuotaPolicyChannelIDStore(); |
| 45 |
| 46 private: |
| 47 bool IsStorageSessionOnly(const net::DefaultChannelIDStore::ChannelID& cert); |
| 48 |
| 49 // True if everything should go to persistent store. |
| 50 bool force_keep_session_state_; |
| 51 scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy_; |
| 52 scoped_refptr<net::DefaultChannelIDStore::PersistentStore> persistent_; |
| 53 scoped_refptr<net::DefaultChannelIDStore::PersistentStore> temporary_; |
| 54 |
| 55 DISALLOW_COPY_AND_ASSIGN(QuotaPolicyChannelIDStore); |
| 56 }; |
| 57 |
| 58 } // namespace content |
| 59 |
| 60 #endif // CONTENT_BROWSER_NET_QUOTA_POLICY_CHANNEL_ID_STORE_H_ |
OLD | NEW |