OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/extensions/extension_special_storage_policy.h" | 5 #include "chrome/browser/extensions/extension_special_storage_policy.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 if (origin.SchemeIs(extensions::kExtensionScheme)) | 36 if (origin.SchemeIs(extensions::kExtensionScheme)) |
37 return true; | 37 return true; |
38 base::AutoLock locker(lock_); | 38 base::AutoLock locker(lock_); |
39 return protected_apps_.Contains(origin); | 39 return protected_apps_.Contains(origin); |
40 } | 40 } |
41 | 41 |
42 bool ExtensionSpecialStoragePolicy::IsStorageUnlimited(const GURL& origin) { | 42 bool ExtensionSpecialStoragePolicy::IsStorageUnlimited(const GURL& origin) { |
43 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUnlimitedStorage)) | 43 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUnlimitedStorage)) |
44 return true; | 44 return true; |
45 | 45 |
46 if (origin.SchemeIs(chrome::kChromeDevToolsScheme) && | 46 if (origin.SchemeIs(content::kChromeDevToolsScheme) && |
47 origin.host() == chrome::kChromeUIDevToolsHost) | 47 origin.host() == chrome::kChromeUIDevToolsHost) |
48 return true; | 48 return true; |
49 | 49 |
50 base::AutoLock locker(lock_); | 50 base::AutoLock locker(lock_); |
51 return unlimited_extensions_.Contains(origin); | 51 return unlimited_extensions_.Contains(origin); |
52 } | 52 } |
53 | 53 |
54 bool ExtensionSpecialStoragePolicy::IsStorageSessionOnly(const GURL& origin) { | 54 bool ExtensionSpecialStoragePolicy::IsStorageSessionOnly(const GURL& origin) { |
55 if (cookie_settings_.get() == NULL) | 55 if (cookie_settings_.get() == NULL) |
56 return false; | 56 return false; |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 | 272 |
273 void ExtensionSpecialStoragePolicy::SpecialCollection::Clear() { | 273 void ExtensionSpecialStoragePolicy::SpecialCollection::Clear() { |
274 ClearCache(); | 274 ClearCache(); |
275 extensions_.Clear(); | 275 extensions_.Clear(); |
276 } | 276 } |
277 | 277 |
278 void ExtensionSpecialStoragePolicy::SpecialCollection::ClearCache() { | 278 void ExtensionSpecialStoragePolicy::SpecialCollection::ClearCache() { |
279 STLDeleteValues(&cached_results_); | 279 STLDeleteValues(&cached_results_); |
280 cached_results_.clear(); | 280 cached_results_.clear(); |
281 } | 281 } |
OLD | NEW |