| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "content/renderer/savable_resources.h" | 5 #include "content/renderer/savable_resources.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 if (value.isNull()) | 83 if (value.isNull()) |
| 84 return; | 84 return; |
| 85 // Get absolute URL. | 85 // Get absolute URL. |
| 86 GURL u = current_doc.completeURL(value); | 86 GURL u = current_doc.completeURL(value); |
| 87 // ignore invalid URL | 87 // ignore invalid URL |
| 88 if (!u.is_valid()) | 88 if (!u.is_valid()) |
| 89 return; | 89 return; |
| 90 // Ignore those URLs which are not standard protocols. Because FTP | 90 // Ignore those URLs which are not standard protocols. Because FTP |
| 91 // protocol does no have cache mechanism, we will skip all | 91 // protocol does no have cache mechanism, we will skip all |
| 92 // sub-resources if they use FTP protocol. | 92 // sub-resources if they use FTP protocol. |
| 93 if (!u.SchemeIsHTTPOrHTTPS() && !u.SchemeIs("file")) | 93 if (!u.SchemeIsHTTPOrHTTPS() && !u.SchemeIs(url::kFileScheme)) |
| 94 return; | 94 return; |
| 95 // Ignore duplicated resource link. | 95 // Ignore duplicated resource link. |
| 96 if (!unique_check->resources_set->insert(u).second) | 96 if (!unique_check->resources_set->insert(u).second) |
| 97 return; | 97 return; |
| 98 result->resources_list->push_back(u); | 98 result->resources_list->push_back(u); |
| 99 // Insert referrer for above new resource link. | 99 // Insert referrer for above new resource link. |
| 100 result->referrer_urls_list->push_back(GURL()); | 100 result->referrer_urls_list->push_back(GURL()); |
| 101 result->referrer_policies_list->push_back(blink::WebReferrerPolicyDefault); | 101 result->referrer_policies_list->push_back(blink::WebReferrerPolicyDefault); |
| 102 } | 102 } |
| 103 | 103 |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 it != frames_set.end(); ++it) { | 226 it != frames_set.end(); ++it) { |
| 227 // Append unique frame source to savable frame list. | 227 // Append unique frame source to savable frame list. |
| 228 if (resources_set.find(*it) == resources_set.end()) | 228 if (resources_set.find(*it) == resources_set.end()) |
| 229 result->frames_list->push_back(*it); | 229 result->frames_list->push_back(*it); |
| 230 } | 230 } |
| 231 | 231 |
| 232 return true; | 232 return true; |
| 233 } | 233 } |
| 234 | 234 |
| 235 } // namespace content | 235 } // namespace content |
| OLD | NEW |