Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(160)

Side by Side Diff: content/renderer/savable_resources.cc

Issue 598453004: Replace some hard coded schemes with the constants in /url/url_constants.h. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address the comment. Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « content/renderer/render_frame_impl.cc ('k') | content/shell/renderer/test_runner/web_test_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698