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

Unified Diff: Source/platform/exported/WebURLRequest.cpp

Issue 339593005: Set the target type when creating the request for main resource (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Made the setter method private Created 6 years, 6 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
Index: Source/platform/exported/WebURLRequest.cpp
diff --git a/Source/platform/exported/WebURLRequest.cpp b/Source/platform/exported/WebURLRequest.cpp
index f74541315816c78cb0be49ab80c035cb613f5eae..a65887f97ee59c04d2edb656c4826b3c0ab109a3 100644
--- a/Source/platform/exported/WebURLRequest.cpp
+++ b/Source/platform/exported/WebURLRequest.cpp
@@ -71,6 +71,15 @@ public:
m_resourceRequest = &m_resourceRequestAllocation;
}
+ WebURLRequestPrivateImpl(const WebURL& url, bool isMainResource, bool isMainFrame)
+ {
+ if (isMainResource)
+ m_resourceRequestAllocation = ResourceRequest::createMainResourceRequest(url, isMainFrame);
+ else
+ m_resourceRequestAllocation.setURL(url);
+ m_resourceRequest = &m_resourceRequestAllocation;
+ }
+
WebURLRequestPrivateImpl(const WebURLRequestPrivate* p)
: m_resourceRequestAllocation(*p->m_resourceRequest)
{
@@ -85,6 +94,12 @@ private:
ResourceRequest m_resourceRequestAllocation;
};
+WebURLRequest::WebURLRequest(const WebURL& url, bool isMainResource, bool isMainFrame)
+ : m_private(0)
+{
+ assign(new WebURLRequestPrivateImpl(url, isMainResource, isMainFrame));
+}
+
void WebURLRequest::initialize()
{
assign(new WebURLRequestPrivateImpl());

Powered by Google App Engine
This is Rietveld 408576698