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/browsing_data/cookies_tree_model.h" | 5 #include "chrome/browser/browsing_data/cookies_tree_model.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <functional> | 8 #include <functional> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 // string comparison works to order hosts by registry controlled domain | 69 // string comparison works to order hosts by registry controlled domain |
70 // first. Leading dots are ignored, ".google.com" is the same as | 70 // first. Leading dots are ignored, ".google.com" is the same as |
71 // "google.com". | 71 // "google.com". |
72 | 72 |
73 if (url.SchemeIsFile()) { | 73 if (url.SchemeIsFile()) { |
74 return std::string(chrome::kFileScheme) + | 74 return std::string(chrome::kFileScheme) + |
75 content::kStandardSchemeSeparator; | 75 content::kStandardSchemeSeparator; |
76 } | 76 } |
77 | 77 |
78 std::string host = url.host(); | 78 std::string host = url.host(); |
79 std::string retval = net::RegistryControlledDomainService:: | 79 std::string retval = |
80 GetDomainAndRegistry(host); | 80 net::RegistryControlledDomainService::GetDomainAndRegistry( |
| 81 host, net::RCDS::EXCLUDE_PRIVATE_REGISTRIES); |
81 if (!retval.length()) // Is an IP address or other special origin. | 82 if (!retval.length()) // Is an IP address or other special origin. |
82 return host; | 83 return host; |
83 | 84 |
84 std::string::size_type position = host.rfind(retval); | 85 std::string::size_type position = host.rfind(retval); |
85 | 86 |
86 // The host may be the registry controlled domain, in which case fail fast. | 87 // The host may be the registry controlled domain, in which case fail fast. |
87 if (position == 0 || position == std::string::npos) | 88 if (position == 0 || position == std::string::npos) |
88 return host; | 89 return host; |
89 | 90 |
90 // If host is www.google.com, retval will contain google.com at this point. | 91 // If host is www.google.com, retval will contain google.com at this point. |
(...skipping 1236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1327 | 1328 |
1328 void CookiesTreeModel::NotifyObserverEndBatch() { | 1329 void CookiesTreeModel::NotifyObserverEndBatch() { |
1329 // Only notify the observers if this is the outermost call to EndBatch() if | 1330 // Only notify the observers if this is the outermost call to EndBatch() if |
1330 // called in a nested manner. | 1331 // called in a nested manner. |
1331 if (--batch_update_ == 0) { | 1332 if (--batch_update_ == 0) { |
1332 FOR_EACH_OBSERVER(Observer, | 1333 FOR_EACH_OBSERVER(Observer, |
1333 cookies_observer_list_, | 1334 cookies_observer_list_, |
1334 TreeModelEndBatch(this)); | 1335 TreeModelEndBatch(this)); |
1335 } | 1336 } |
1336 } | 1337 } |
OLD | NEW |