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

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

Issue 2837603002: Content API changes to improve DOM stitching in ThreatDetails code. (Closed)
Patch Set: Use explicitly-sized int types in IPC definition Created 3 years, 7 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
« no previous file with comments | « content/renderer/render_frame_impl.cc ('k') | content/renderer/web_frame_utils.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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"
11 #include "base/strings/string_util.h" 11 #include "base/strings/string_util.h"
12 #include "content/public/common/url_utils.h" 12 #include "content/public/common/url_utils.h"
13 #include "content/renderer/web_frame_utils.h" 13 #include "content/renderer/render_frame_impl.h"
14 #include "third_party/WebKit/public/platform/WebString.h" 14 #include "third_party/WebKit/public/platform/WebString.h"
15 #include "third_party/WebKit/public/platform/WebVector.h" 15 #include "third_party/WebKit/public/platform/WebVector.h"
16 #include "third_party/WebKit/public/web/WebDocument.h" 16 #include "third_party/WebKit/public/web/WebDocument.h"
17 #include "third_party/WebKit/public/web/WebElement.h" 17 #include "third_party/WebKit/public/web/WebElement.h"
18 #include "third_party/WebKit/public/web/WebElementCollection.h" 18 #include "third_party/WebKit/public/web/WebElementCollection.h"
19 #include "third_party/WebKit/public/web/WebInputElement.h" 19 #include "third_party/WebKit/public/web/WebInputElement.h"
20 #include "third_party/WebKit/public/web/WebLocalFrame.h" 20 #include "third_party/WebKit/public/web/WebLocalFrame.h"
21 #include "third_party/WebKit/public/web/WebNode.h" 21 #include "third_party/WebKit/public/web/WebNode.h"
22 #include "third_party/WebKit/public/web/WebView.h" 22 #include "third_party/WebKit/public/web/WebView.h"
23 23
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 SavableResourcesResult* result) { 64 SavableResourcesResult* result) {
65 // Get absolute URL. 65 // Get absolute URL.
66 WebString link_attribute_value = GetSubResourceLinkFromElement(element); 66 WebString link_attribute_value = GetSubResourceLinkFromElement(element);
67 GURL element_url = current_doc.CompleteURL(link_attribute_value); 67 GURL element_url = current_doc.CompleteURL(link_attribute_value);
68 68
69 // See whether to report this element as a subframe. 69 // See whether to report this element as a subframe.
70 WebFrame* web_frame = WebFrame::FromFrameOwnerElement(element); 70 WebFrame* web_frame = WebFrame::FromFrameOwnerElement(element);
71 if (web_frame && DoesFrameContainHtmlDocument(*web_frame, element)) { 71 if (web_frame && DoesFrameContainHtmlDocument(*web_frame, element)) {
72 SavableSubframe subframe; 72 SavableSubframe subframe;
73 subframe.original_url = element_url; 73 subframe.original_url = element_url;
74 subframe.routing_id = GetRoutingIdForFrameOrProxy(web_frame); 74 subframe.routing_id = RenderFrame::GetRoutingIdForWebFrame(web_frame);
75 result->subframes->push_back(subframe); 75 result->subframes->push_back(subframe);
76 return; 76 return;
77 } 77 }
78 78
79 // Check whether the node has sub resource URL or not. 79 // Check whether the node has sub resource URL or not.
80 if (link_attribute_value.IsNull()) 80 if (link_attribute_value.IsNull())
81 return; 81 return;
82 82
83 // Ignore invalid URL. 83 // Ignore invalid URL.
84 if (!element_url.is_valid()) 84 if (!element_url.is_valid())
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 // otherwise return NULL. 165 // otherwise return NULL.
166 if (!value.IsNull() && !value.IsEmpty() && 166 if (!value.IsNull() && !value.IsEmpty() &&
167 !base::StartsWith(value.Utf8(), 167 !base::StartsWith(value.Utf8(),
168 "javascript:", base::CompareCase::INSENSITIVE_ASCII)) 168 "javascript:", base::CompareCase::INSENSITIVE_ASCII))
169 return value; 169 return value;
170 170
171 return WebString(); 171 return WebString();
172 } 172 }
173 173
174 } // namespace content 174 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_frame_impl.cc ('k') | content/renderer/web_frame_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698