summaryrefslogtreecommitdiffstats
path: root/content/public/browser/dom_storage_context.h
blob: 99f8cd142e883dea54a970d99baf227d78414cda (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CONTENT_PUBLIC_BROWSER_DOM_STORAGE_CONTEXT_H_
#define CONTENT_PUBLIC_BROWSER_DOM_STORAGE_CONTEXT_H_

#include <vector>

#include "base/callback.h"
#include "content/common/content_export.h"
#include "webkit/dom_storage/dom_storage_context.h"

class GURL;

namespace content {

class BrowserContext;
class SessionStorageNamespace;

// Represents the per-BrowserContext Local Storage data.
class DOMStorageContext {
 public:
  typedef base::Callback<
      void(const std::vector<dom_storage::DomStorageContext::UsageInfo>&)>
          GetUsageInfoCallback;

  // Returns a collection of origins using local storage to the given callback.
  virtual void GetUsageInfo(const GetUsageInfoCallback& callback) = 0;

  // Deletes the local storage data for the given origin.
  virtual void DeleteOrigin(const GURL& origin) = 0;

  // Creates a SessionStorageNamespace with the given |persistent_id|. Used
  // after tabs are restored by session restore. When created, the
  // SessionStorageNamespace with the correct |persistent_id| will be
  // associated with the persisted sessionStorage data.
  virtual scoped_refptr<SessionStorageNamespace> RecreateSessionStorage(
      const std::string& persistent_id) = 0;

 protected:
  virtual ~DOMStorageContext() {}
};

}  // namespace content

#endif  // CONTENT_PUBLIC_BROWSER_DOM_STORAGE_CONTEXT_H_