OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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/content_settings/tab_specific_content_settings.h" | 5 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
6 | 6 |
7 #include <list> | 7 #include <list> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 | 193 |
194 return content_accessed_[content_type]; | 194 return content_accessed_[content_type]; |
195 } | 195 } |
196 | 196 |
197 const std::set<std::string>& | 197 const std::set<std::string>& |
198 TabSpecificContentSettings::BlockedResourcesForType( | 198 TabSpecificContentSettings::BlockedResourcesForType( |
199 ContentSettingsType content_type) const { | 199 ContentSettingsType content_type) const { |
200 if (blocked_resources_[content_type].get()) { | 200 if (blocked_resources_[content_type].get()) { |
201 return *blocked_resources_[content_type]; | 201 return *blocked_resources_[content_type]; |
202 } else { | 202 } else { |
203 static std::set<std::string> empty_set; | 203 CR_DEFINE_STATIC_LOCAL(std::set<std::string>, empty_set, ()); |
204 return empty_set; | 204 return empty_set; |
205 } | 205 } |
206 } | 206 } |
207 | 207 |
208 void TabSpecificContentSettings::AddBlockedResource( | 208 void TabSpecificContentSettings::AddBlockedResource( |
209 ContentSettingsType content_type, | 209 ContentSettingsType content_type, |
210 const std::string& resource_identifier) { | 210 const std::string& resource_identifier) { |
211 if (!blocked_resources_[content_type].get()) | 211 if (!blocked_resources_[content_type].get()) |
212 blocked_resources_[content_type].reset(new std::set<std::string>()); | 212 blocked_resources_[content_type].reset(new std::set<std::string>()); |
213 blocked_resources_[content_type]->insert(resource_identifier); | 213 blocked_resources_[content_type]->insert(resource_identifier); |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
514 return new CookiesTreeModel(cookies_->Clone(), | 514 return new CookiesTreeModel(cookies_->Clone(), |
515 databases_->Clone(), | 515 databases_->Clone(), |
516 local_storages_->Clone(), | 516 local_storages_->Clone(), |
517 session_storages_->Clone(), | 517 session_storages_->Clone(), |
518 appcaches_->Clone(), | 518 appcaches_->Clone(), |
519 indexed_dbs_->Clone(), | 519 indexed_dbs_->Clone(), |
520 file_systems_->Clone(), | 520 file_systems_->Clone(), |
521 NULL, | 521 NULL, |
522 true); | 522 true); |
523 } | 523 } |
OLD | NEW |