| OLD | NEW |
| (Empty) | |
| 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. |
| 4 |
| 5 // A wrapper around quota::PersistentStoragePolicy used by the net storage |
| 6 // backends in chrome/browser/net to decide what to delete at shutdown. |
| 7 |
| 8 #ifndef CHROME_BROWSER_NET_CLEAR_ON_EXIT_POLICY_H_ |
| 9 #define CHROME_BROWSER_NET_CLEAR_ON_EXIT_POLICY_H_ |
| 10 #pragma once |
| 11 |
| 12 #include <string> |
| 13 |
| 14 #include "base/basictypes.h" |
| 15 #include "base/memory/ref_counted.h" |
| 16 |
| 17 namespace quota { |
| 18 class SpecialStoragePolicy; |
| 19 } |
| 20 |
| 21 class ClearOnExitPolicy : public base::RefCountedThreadSafe<ClearOnExitPolicy> { |
| 22 public: |
| 23 // |special_storage_policy| can be NULL, if no policy is to be applied. |
| 24 // Otherwise, will keep a scoped_refptr to |special_storage_policy| |
| 25 // throughout its lifetime. |
| 26 explicit ClearOnExitPolicy( |
| 27 quota::SpecialStoragePolicy* special_storage_policy); |
| 28 |
| 29 // True if there are origins that should be cleared on exit. |
| 30 bool HasClearOnExitOrigins(); |
| 31 |
| 32 // True if the given origin (defined by the |domain| and whether or not the |
| 33 // |scheme_is_secure|) should be cleared on exit. |
| 34 bool ShouldClearOriginOnExit(const std::string& domain, |
| 35 bool scheme_is_secure); |
| 36 |
| 37 private: |
| 38 friend class base::RefCountedThreadSafe<ClearOnExitPolicy>; |
| 39 |
| 40 virtual ~ClearOnExitPolicy(); |
| 41 |
| 42 scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy_; |
| 43 |
| 44 DISALLOW_COPY_AND_ASSIGN(ClearOnExitPolicy); |
| 45 }; |
| 46 |
| 47 #endif // CHROME_BROWSER_NET_CLEAR_ON_EXIT_POLICY_H_ |
| OLD | NEW |