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

Side by Side Diff: content/browser/net/quota_policy_channel_id_store.h

Issue 381073002: Move sqlite_channel_id_store from chrome/browser/net to net/extras. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased to r286605 Created 6 years, 4 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
OLDNEW
(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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698