| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 // Get absolute URL. | 53 // Get absolute URL. |
| 54 GURL u = current_doc.completeURL(value); | 54 GURL u = current_doc.completeURL(value); |
| 55 // ignore invalid URL | 55 // ignore invalid URL |
| 56 if (!u.is_valid()) | 56 if (!u.is_valid()) |
| 57 return; | 57 return; |
| 58 // Ignore those URLs which are not standard protocols. Because FTP | 58 // Ignore those URLs which are not standard protocols. Because FTP |
| 59 // protocol does no have cache mechanism, we will skip all | 59 // protocol does no have cache mechanism, we will skip all |
| 60 // sub-resources if they use FTP protocol. | 60 // sub-resources if they use FTP protocol. |
| 61 if (!u.SchemeIsHTTPOrHTTPS() && !u.SchemeIs(url::kFileScheme)) | 61 if (!u.SchemeIsHTTPOrHTTPS() && !u.SchemeIs(url::kFileScheme)) |
| 62 return; | 62 return; |
| 63 // Ignore duplicated resource link. | 63 |
| 64 result->resources_list->push_back(u); | 64 result->resources_list->push_back(u); |
| 65 // Insert referrer for above new resource link. | |
| 66 result->referrer_urls_list->push_back(GURL()); | |
| 67 result->referrer_policies_list->push_back(blink::WebReferrerPolicyDefault); | |
| 68 } | 65 } |
| 69 | 66 |
| 70 } // namespace | 67 } // namespace |
| 71 | 68 |
| 72 bool GetSavableResourceLinksForFrame(WebFrame* current_frame, | 69 bool GetSavableResourceLinksForFrame(WebFrame* current_frame, |
| 73 SavableResourcesResult* result, | 70 SavableResourcesResult* result, |
| 74 const char** savable_schemes) { | 71 const char** savable_schemes) { |
| 75 // Get current frame's URL. | 72 // Get current frame's URL. |
| 76 GURL current_frame_url = current_frame->document().url(); | 73 GURL current_frame_url = current_frame->document().url(); |
| 77 | 74 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 // otherwise return NULL. | 141 // otherwise return NULL. |
| 145 if (!value.isNull() && !value.isEmpty() && | 142 if (!value.isNull() && !value.isEmpty() && |
| 146 !base::StartsWith(value.utf8(), "javascript:", | 143 !base::StartsWith(value.utf8(), "javascript:", |
| 147 base::CompareCase::INSENSITIVE_ASCII)) | 144 base::CompareCase::INSENSITIVE_ASCII)) |
| 148 return value; | 145 return value; |
| 149 | 146 |
| 150 return WebString(); | 147 return WebString(); |
| 151 } | 148 } |
| 152 | 149 |
| 153 } // namespace content | 150 } // namespace content |
| OLD | NEW |