Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(97)

Side by Side Diff: chrome/browser/extensions/mock_extension_special_storage_policy.h

Issue 7210006: AppCaches which belong to hosted apps are not protected from deletion (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Test beautification. Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2011 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 CHROME_BROWSER_EXTENSIONS_MOCK_EXTENSION_SPECIAL_STORAGE_POLICY_H_
6 #define CHROME_BROWSER_EXTENSIONS_MOCK_EXTENSION_SPECIAL_STORAGE_POLICY_H_
7 #pragma once
8
9 #include <set>
10 #include <string>
11
12 #include "chrome/browser/extensions/extension_special_storage_policy.h"
13 #include "googleurl/src/gurl.h"
14
15 // This class is the same as MockSpecialStoragePolicy (in
16 // webkit/quota/mock_special_storage_policy.h), but it inherits
17 // ExtensionSpecialStoragePolicy instead of quota::SpecialStoragePolicy.
18 class MockExtensionSpecialStoragePolicy : public ExtensionSpecialStoragePolicy {
19 public:
20 MockExtensionSpecialStoragePolicy();
21 virtual ~MockExtensionSpecialStoragePolicy();
22
23 virtual bool IsStorageProtected(const GURL& origin);
24 virtual bool IsStorageUnlimited(const GURL& origin);
25 virtual bool IsFileHandler(const std::string& extension_id);
26
27 void AddProtected(const GURL& origin) {
28 protected_.insert(origin);
29 }
30
31 void AddUnlimited(const GURL& origin) {
32 unlimited_.insert(origin);
33 }
34
35 void AddFileHandler(const std::string& id) {
36 file_handlers_.insert(id);
37 }
38
39 void Reset() {
40 protected_.clear();
41 unlimited_.clear();
42 file_handlers_.clear();
43 }
44
45 private:
46 std::set<GURL> protected_;
47 std::set<GURL> unlimited_;
48 std::set<std::string> file_handlers_;
49
50 DISALLOW_COPY_AND_ASSIGN(MockExtensionSpecialStoragePolicy);
51 };
52
53 #endif // CHROME_BROWSER_EXTENSIONS_MOCK_EXTENSION_SPECIAL_STORAGE_POLICY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698