Chromium Code Reviews| 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/content_settings/local_shared_objects_container.h" | 5 #include "chrome/browser/content_settings/local_shared_objects_container.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "chrome/browser/browsing_data/browsing_data_appcache_helper.h" | 8 #include "chrome/browser/browsing_data/browsing_data_appcache_helper.h" |
| 9 #include "chrome/browser/browsing_data/browsing_data_cache_storage_helper.h" | 9 #include "chrome/browser/browsing_data/browsing_data_cache_storage_helper.h" |
| 10 #include "chrome/browser/browsing_data/browsing_data_channel_id_helper.h" | 10 #include "chrome/browser/browsing_data/browsing_data_channel_id_helper.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 79 // means count all cookies that have been set by a host that is not considered | 79 // means count all cookies that have been set by a host that is not considered |
| 80 // to be a third party regarding the domain of the provided |origin|. E.g. if | 80 // to be a third party regarding the domain of the provided |origin|. E.g. if |
| 81 // the origin is "http://foo.com" then all cookies with domain foo.com, | 81 // the origin is "http://foo.com" then all cookies with domain foo.com, |
| 82 // a.foo.com, b.a.foo.com or *.foo.com will be counted. | 82 // a.foo.com, b.a.foo.com or *.foo.com will be counted. |
| 83 typedef CannedBrowsingDataCookieHelper::OriginCookieSetMap OriginCookieSetMap; | 83 typedef CannedBrowsingDataCookieHelper::OriginCookieSetMap OriginCookieSetMap; |
| 84 const OriginCookieSetMap& origin_cookies_set_map = | 84 const OriginCookieSetMap& origin_cookies_set_map = |
| 85 cookies()->origin_cookie_set_map(); | 85 cookies()->origin_cookie_set_map(); |
| 86 for (OriginCookieSetMap::const_iterator it = origin_cookies_set_map.begin(); | 86 for (OriginCookieSetMap::const_iterator it = origin_cookies_set_map.begin(); |
| 87 it != origin_cookies_set_map.end(); | 87 it != origin_cookies_set_map.end(); |
| 88 ++it) { | 88 ++it) { |
| 89 const canonical_cookie::CookieHashSet* cookie_list = it->second; | 89 const canonical_cookie::CookieHashSet* cookie_list = it->second.get(); |
| 90 for (canonical_cookie::CookieHashSet::const_iterator cookie = | 90 for (auto cookie = cookie_list->begin(); cookie != cookie_list->end(); |
|
Nico
2016/09/22 15:56:11
can this one be for-each?
Avi (use Gerrit)
2016/09/22 19:17:17
Done.
| |
| 91 cookie_list->begin(); | |
| 92 cookie != cookie_list->end(); | |
| 93 ++cookie) { | 91 ++cookie) { |
| 94 // Strip leading '.'s. | 92 // Strip leading '.'s. |
| 95 std::string cookie_domain = cookie->Domain(); | 93 std::string cookie_domain = cookie->Domain(); |
| 96 if (cookie_domain[0] == '.') | 94 if (cookie_domain[0] == '.') |
| 97 cookie_domain = cookie_domain.substr(1); | 95 cookie_domain = cookie_domain.substr(1); |
| 98 // The |domain_url| is only created in order to use the | 96 // The |domain_url| is only created in order to use the |
| 99 // SameDomainOrHost method below. It does not matter which scheme is | 97 // SameDomainOrHost method below. It does not matter which scheme is |
| 100 // used as the scheme is ignored by the SameDomainOrHost method. | 98 // used as the scheme is ignored by the SameDomainOrHost method. |
| 101 GURL domain_url(std::string(url::kHttpScheme) + | 99 GURL domain_url(std::string(url::kHttpScheme) + |
| 102 url::kStandardSchemeSeparator + cookie_domain); | 100 url::kStandardSchemeSeparator + cookie_domain); |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 219 | 217 |
| 220 std::unique_ptr<CookiesTreeModel> | 218 std::unique_ptr<CookiesTreeModel> |
| 221 LocalSharedObjectsContainer::CreateCookiesTreeModel() const { | 219 LocalSharedObjectsContainer::CreateCookiesTreeModel() const { |
| 222 LocalDataContainer* container = new LocalDataContainer( | 220 LocalDataContainer* container = new LocalDataContainer( |
| 223 cookies(), databases(), local_storages(), session_storages(), appcaches(), | 221 cookies(), databases(), local_storages(), session_storages(), appcaches(), |
| 224 indexed_dbs(), file_systems(), nullptr, channel_ids(), service_workers(), | 222 indexed_dbs(), file_systems(), nullptr, channel_ids(), service_workers(), |
| 225 cache_storages(), nullptr); | 223 cache_storages(), nullptr); |
| 226 | 224 |
| 227 return base::MakeUnique<CookiesTreeModel>(container, nullptr); | 225 return base::MakeUnique<CookiesTreeModel>(container, nullptr); |
| 228 } | 226 } |
| OLD | NEW |