Switch global error menu icon to vectorized MD asset
[chromium-blink-merge.git] / content / public / browser / dom_storage_context.h
bloba4aba1e91e1b4f384a0e0eaa9891b8d6e062965c
1 // Copyright (c) 2012 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_PUBLIC_BROWSER_DOM_STORAGE_CONTEXT_H_
6 #define CONTENT_PUBLIC_BROWSER_DOM_STORAGE_CONTEXT_H_
8 #include <string>
9 #include <vector>
11 #include "base/callback.h"
13 class GURL;
15 namespace content {
17 class BrowserContext;
18 struct LocalStorageUsageInfo;
19 class SessionStorageNamespace;
20 struct SessionStorageUsageInfo;
22 // Represents the per-BrowserContext Local Storage data.
23 class DOMStorageContext {
24 public:
25 typedef base::Callback<
26 void(const std::vector<LocalStorageUsageInfo>&)>
27 GetLocalStorageUsageCallback;
29 typedef base::Callback<
30 void(const std::vector<SessionStorageUsageInfo>&)>
31 GetSessionStorageUsageCallback;
33 // Returns a collection of origins using local storage to the given callback.
34 virtual void GetLocalStorageUsage(
35 const GetLocalStorageUsageCallback& callback) = 0;
37 // Returns a collection of origins using session storage to the given
38 // callback.
39 virtual void GetSessionStorageUsage(
40 const GetSessionStorageUsageCallback& callback) = 0;
42 // Deletes the local storage data for the given origin.
43 virtual void DeleteLocalStorage(const GURL& origin) = 0;
45 // Deletes the session storage data identified by |usage_info|.
46 virtual void DeleteSessionStorage(
47 const SessionStorageUsageInfo& usage_info) = 0;
49 // If this is called, sessionStorage data will be stored on disk, and can be
50 // restored after a browser restart (with RecreateSessionStorage). This
51 // function must be called right after DOMStorageContextWrapper is created,
52 // and before it's used.
53 virtual void SetSaveSessionStorageOnDisk() = 0;
55 // Creates a SessionStorageNamespace with the given |persistent_id|. Used
56 // after tabs are restored by session restore. When created, the
57 // SessionStorageNamespace with the correct |persistent_id| will be
58 // associated with the persisted sessionStorage data.
59 virtual scoped_refptr<SessionStorageNamespace> RecreateSessionStorage(
60 const std::string& persistent_id) = 0;
62 // Starts deleting sessionStorages which don't have an associated
63 // SessionStorageNamespace alive. Called when SessionStorageNamespaces have
64 // been created after a session restore, or a session restore won't happen.
65 virtual void StartScavengingUnusedSessionStorage() = 0;
67 protected:
68 virtual ~DOMStorageContext() {}
71 } // namespace content
73 #endif // CONTENT_PUBLIC_BROWSER_DOM_STORAGE_CONTEXT_H_