blob: 928e762c00634e81d1c58adeb7e1079298669338 [file] [log] [blame]
jsbelle1fe9692015-08-22 01:02:421// Copyright 2015 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_PUBLIC_BROWSER_CACHE_STORAGE_CONTEXT_H_
6#define CONTENT_PUBLIC_BROWSER_CACHE_STORAGE_CONTEXT_H_
7
8#include <vector>
9
10#include "base/callback.h"
11#include "base/memory/ref_counted.h"
12#include "content/public/browser/cache_storage_usage_info.h"
13
14namespace content {
15
16// Represents the per-BrowserContext Cache Storage data.
17class CacheStorageContext
18 : public base::RefCountedThreadSafe<CacheStorageContext> {
19 public:
20 using GetUsageInfoCallback = base::Callback<void(
21 const std::vector<CacheStorageUsageInfo>& usage_info)>;
22
23 // Methods used in response to browsing data and quota manager requests.
24 // Must be called on the IO thread.
25 virtual void GetAllOriginsInfo(const GetUsageInfoCallback& callback) = 0;
26 virtual void DeleteForOrigin(const GURL& origin_url) = 0;
27
28 protected:
29 friend class base::RefCountedThreadSafe<CacheStorageContext>;
30 virtual ~CacheStorageContext() {}
31};
32
33} // namespace content
34
35#endif // CONTENT_PUBLIC_BROWSER_CACHE_STORAGE_CONTEXT_H_