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

Unified Diff: content/renderer/render_frame_impl.h

Issue 176883012: Set the original url correctly if the frame is loaded via loadData (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 10 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 | « no previous file | content/renderer/render_frame_impl.cc » ('j') | content/renderer/render_frame_impl.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_frame_impl.h
diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h
index bfcb092bf96f5b63cad8961c82116408a94788dd..59e90b539582b6c25741661e647bea96294a7b4f 100644
--- a/content/renderer/render_frame_impl.h
+++ b/content/renderer/render_frame_impl.h
@@ -341,6 +341,12 @@ class CONTENT_EXPORT RenderFrameImpl
friend class RenderFrameObserver;
FRIEND_TEST_ALL_PREFIXES(RenderFrameImplTest,
ShouldUpdateSelectionTextFromContextMenuParams);
+ FRIEND_TEST_ALL_PREFIXES(RenderFrameImplTest,
+ GetOriginalRequestUrlViaLoadData);
+ FRIEND_TEST_ALL_PREFIXES(RenderFrameImplTest,
+ GetOriginalRequestUrlViaLoadUrlWithoutRedirects);
+ FRIEND_TEST_ALL_PREFIXES(RenderFrameImplTest,
+ GetOriginalRequestUrlViaLoadUrlWithRedirects);
typedef std::map<GURL, double> HostZoomLevels;
@@ -371,6 +377,11 @@ class CONTENT_EXPORT RenderFrameImpl
const gfx::Range& selection_range,
const ContextMenuParams& params);
+ // Returns the original request url. If there is no redirect, the original
+ // url is the same as ds->request()->url(). If the WebDataSource belongs to a
+ // frame was loaded by loadData, the original url will be ds->unreachableURL()
+ static const GURL GetOriginalRequestUrl(const blink::WebDataSource* ds);
+
// Stores the WebFrame we are associated with.
blink::WebFrame* frame_;
« no previous file with comments | « no previous file | content/renderer/render_frame_impl.cc » ('j') | content/renderer/render_frame_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698