blob: 5c34e062a6e81ce3888b4a0fc668a01b4035bc06 (
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.
// A wrapper around quota::PersistentStoragePolicy used by the net storage
// backends in chrome/browser/net to decide what to delete at shutdown.
#ifndef CHROME_BROWSER_NET_CLEAR_ON_EXIT_POLICY_H_
#define CHROME_BROWSER_NET_CLEAR_ON_EXIT_POLICY_H_
#pragma once
#include <string>
#include "base/basictypes.h"
#include "base/memory/ref_counted.h"
namespace quota {
class SpecialStoragePolicy;
}
class ClearOnExitPolicy : public base::RefCountedThreadSafe<ClearOnExitPolicy> {
public:
// |special_storage_policy| can be NULL, if no policy is to be applied.
// Otherwise, will keep a scoped_refptr to |special_storage_policy|
// throughout its lifetime.
explicit ClearOnExitPolicy(
quota::SpecialStoragePolicy* special_storage_policy);
// True if there are origins that should be cleared on exit.
bool HasClearOnExitOrigins();
// True if the given origin (defined by the |domain| and whether or not the
// |scheme_is_secure|) should be cleared on exit.
bool ShouldClearOriginOnExit(const std::string& domain,
bool scheme_is_secure);
private:
friend class base::RefCountedThreadSafe<ClearOnExitPolicy>;
virtual ~ClearOnExitPolicy();
scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy_;
DISALLOW_COPY_AND_ASSIGN(ClearOnExitPolicy);
};
#endif // CHROME_BROWSER_NET_CLEAR_ON_EXIT_POLICY_H_
|