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

Unified Diff: content/renderer/savable_resources.cc

Issue 2622693002: Cleanup of static lists of schemes & origins that are created at startup. (Closed)
Patch Set: merge Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/savable_resources.h ('k') | content/renderer/savable_resources_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/savable_resources.cc
diff --git a/content/renderer/savable_resources.cc b/content/renderer/savable_resources.cc
index c1a702bd0fc5909b9bb4f46897c92e5b83a239d6..cb21161472ae07c949dcd4ab368624cf360a23ba 100644
--- a/content/renderer/savable_resources.cc
+++ b/content/renderer/savable_resources.cc
@@ -9,6 +9,7 @@
#include "base/compiler_specific.h"
#include "base/logging.h"
#include "base/strings/string_util.h"
+#include "content/public/common/url_utils.h"
#include "content/renderer/web_frame_utils.h"
#include "third_party/WebKit/public/platform/WebString.h"
#include "third_party/WebKit/public/platform/WebVector.h"
@@ -96,8 +97,7 @@ void GetSavableResourceLinkForElement(
} // namespace
bool GetSavableResourceLinksForFrame(WebFrame* current_frame,
- SavableResourcesResult* result,
- const char** savable_schemes) {
+ SavableResourcesResult* result) {
// Get current frame's URL.
GURL current_frame_url = current_frame->document().url();
@@ -106,14 +106,7 @@ bool GetSavableResourceLinksForFrame(WebFrame* current_frame,
return false;
// If url of current frame is not a savable protocol, ignore it.
- bool is_valid_protocol = false;
- for (int i = 0; savable_schemes[i] != NULL; ++i) {
- if (current_frame_url.SchemeIs(savable_schemes[i])) {
- is_valid_protocol = true;
- break;
- }
- }
- if (!is_valid_protocol)
+ if (!IsSavableURL(current_frame_url))
return false;
// Get current using document.
« no previous file with comments | « content/renderer/savable_resources.h ('k') | content/renderer/savable_resources_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698