Change layout of app list items in experimental app list.
[chromium-blink-merge.git] / content / browser / dom_storage / dom_storage_context_wrapper.h
blobfb7441c6297d192c48c086e1e9bc4d0bed038c3d
1 // Copyright 2013 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.
5 #ifndef CONTENT_BROWSER_DOM_STORAGE_DOM_STORAGE_CONTEXT_WRAPPER_H_
6 #define CONTENT_BROWSER_DOM_STORAGE_DOM_STORAGE_CONTEXT_WRAPPER_H_
8 #include "base/memory/ref_counted.h"
9 #include "content/common/content_export.h"
10 #include "content/public/browser/dom_storage_context.h"
12 namespace base {
13 class FilePath;
16 namespace storage {
17 class SpecialStoragePolicy;
20 namespace content {
22 class DOMStorageContextImpl;
24 // This is owned by BrowserContext (aka Profile) and encapsulates all
25 // per-profile dom storage state.
26 class CONTENT_EXPORT DOMStorageContextWrapper :
27 NON_EXPORTED_BASE(public DOMStorageContext),
28 public base::RefCountedThreadSafe<DOMStorageContextWrapper> {
29 public:
30 // If |data_path| is empty, nothing will be saved to disk.
31 DOMStorageContextWrapper(
32 const base::FilePath& data_path,
33 storage::SpecialStoragePolicy* special_storage_policy);
35 // DOMStorageContext implementation.
36 virtual void GetLocalStorageUsage(
37 const GetLocalStorageUsageCallback& callback) OVERRIDE;
38 virtual void GetSessionStorageUsage(
39 const GetSessionStorageUsageCallback& callback) OVERRIDE;
40 virtual void DeleteLocalStorage(const GURL& origin) OVERRIDE;
41 virtual void DeleteSessionStorage(
42 const SessionStorageUsageInfo& usage_info) OVERRIDE;
43 virtual void SetSaveSessionStorageOnDisk() OVERRIDE;
44 virtual scoped_refptr<SessionStorageNamespace>
45 RecreateSessionStorage(const std::string& persistent_id) OVERRIDE;
46 virtual void StartScavengingUnusedSessionStorage() OVERRIDE;
48 // Used by content settings to alter the behavior around
49 // what data to keep and what data to discard at shutdown.
50 // The policy is not so straight forward to describe, see
51 // the implementation for details.
52 void SetForceKeepSessionState();
54 // Called when the BrowserContext/Profile is going away.
55 void Shutdown();
57 private:
58 friend class DOMStorageMessageFilter; // for access to context()
59 friend class SessionStorageNamespaceImpl; // ditto
60 friend class base::RefCountedThreadSafe<DOMStorageContextWrapper>;
62 virtual ~DOMStorageContextWrapper();
63 DOMStorageContextImpl* context() const { return context_.get(); }
65 scoped_refptr<DOMStorageContextImpl> context_;
67 DISALLOW_IMPLICIT_CONSTRUCTORS(DOMStorageContextWrapper);
70 } // namespace content
72 #endif // CONTENT_BROWSER_DOM_STORAGE_DOM_STORAGE_CONTEXT_WRAPPER_H_