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

Side by Side Diff: chrome/browser/extensions/extension_special_storage_policy.cc

Issue 11275088: Remove implicit scoped_refptr operator T* Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 8 years, 1 month 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
OLDNEW
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/logging.h" 8 #include "base/logging.h"
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 base::AutoLock locker(lock_); 49 base::AutoLock locker(lock_);
50 return protected_apps_.Contains(origin); 50 return protected_apps_.Contains(origin);
51 } 51 }
52 52
53 bool ExtensionSpecialStoragePolicy::IsStorageUnlimited(const GURL& origin) { 53 bool ExtensionSpecialStoragePolicy::IsStorageUnlimited(const GURL& origin) {
54 base::AutoLock locker(lock_); 54 base::AutoLock locker(lock_);
55 return unlimited_extensions_.Contains(origin); 55 return unlimited_extensions_.Contains(origin);
56 } 56 }
57 57
58 bool ExtensionSpecialStoragePolicy::IsStorageSessionOnly(const GURL& origin) { 58 bool ExtensionSpecialStoragePolicy::IsStorageSessionOnly(const GURL& origin) {
59 if (cookie_settings_ == NULL) 59 if (cookie_settings_.get() == NULL)
60 return false; 60 return false;
61 return cookie_settings_->IsCookieSessionOnly(origin); 61 return cookie_settings_->IsCookieSessionOnly(origin);
62 } 62 }
63 63
64 bool ExtensionSpecialStoragePolicy::IsInstalledApp(const GURL& origin) { 64 bool ExtensionSpecialStoragePolicy::IsInstalledApp(const GURL& origin) {
65 return installed_apps_.Contains(origin); 65 return installed_apps_.Contains(origin);
66 } 66 }
67 67
68 bool ExtensionSpecialStoragePolicy::HasSessionOnlyOrigins() { 68 bool ExtensionSpecialStoragePolicy::HasSessionOnlyOrigins() {
69 if (cookie_settings_ == NULL) 69 if (cookie_settings_.get() == NULL)
70 return false; 70 return false;
71 if (cookie_settings_->GetDefaultCookieSetting(NULL) == 71 if (cookie_settings_->GetDefaultCookieSetting(NULL) ==
72 CONTENT_SETTING_SESSION_ONLY) 72 CONTENT_SETTING_SESSION_ONLY)
73 return true; 73 return true;
74 ContentSettingsForOneType entries; 74 ContentSettingsForOneType entries;
75 cookie_settings_->GetCookieSettings(&entries); 75 cookie_settings_->GetCookieSettings(&entries);
76 for (size_t i = 0; i < entries.size(); ++i) { 76 for (size_t i = 0; i < entries.size(); ++i) {
77 if (entries[i].setting == CONTENT_SETTING_SESSION_ONLY) 77 if (entries[i].setting == CONTENT_SETTING_SESSION_ONLY)
78 return true; 78 return true;
79 } 79 }
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 230
231 void ExtensionSpecialStoragePolicy::SpecialCollection::Clear() { 231 void ExtensionSpecialStoragePolicy::SpecialCollection::Clear() {
232 ClearCache(); 232 ClearCache();
233 extensions_.Clear(); 233 extensions_.Clear();
234 } 234 }
235 235
236 void ExtensionSpecialStoragePolicy::SpecialCollection::ClearCache() { 236 void ExtensionSpecialStoragePolicy::SpecialCollection::ClearCache() {
237 STLDeleteValues(&cached_results_); 237 STLDeleteValues(&cached_results_);
238 cached_results_.clear(); 238 cached_results_.clear();
239 } 239 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_sorting_unittest.cc ('k') | chrome/browser/extensions/extension_sync_bundle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698