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

Unified Diff: Source/modules/serviceworkers/Request.cpp

Issue 721103003: [ServiceWorker] Serialize request.referrer to "about:client" when it's client. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 6 years, 1 month 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 | « Source/modules/serviceworkers/FetchRequestData.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/serviceworkers/Request.cpp
diff --git a/Source/modules/serviceworkers/Request.cpp b/Source/modules/serviceworkers/Request.cpp
index 57c9f730f04444487104fe51d9ae5490500d3f98..58761229e47df4aa028435ebdea68449c2913e59 100644
--- a/Source/modules/serviceworkers/Request.cpp
+++ b/Source/modules/serviceworkers/Request.cpp
@@ -142,7 +142,7 @@ Request* Request::create(ExecutionContext* context, const String& input, const D
{
// "2. Let |request| be |input|'s associated request, if |input| is a
// Request object, and a new request otherwise."
- FetchRequestData* request(FetchRequestData::create(context));
+ FetchRequestData* request(FetchRequestData::create());
// "3. Set |request| to a restricted copy of itself."
request = request->createRestrictedCopy(context, SecurityOrigin::create(context->url()));
// "6. If |input| is a string, run these substeps:"
@@ -254,8 +254,12 @@ String Request::url() const
String Request::referrer() const
{
// "The referrer attribute's getter must return the empty string if
- // request's referrer is none, and request's referrer, serialized,
- // otherwise."
+ // request's referrer is no referrer, "about:client" if request's referrer
+ // is client and request's referrer, serialized, otherwise."
+ if (m_request->referrer().isNoReferrer())
+ return String();
+ if (m_request->referrer().isClient())
+ return String("about:client");
return m_request->referrer().referrer().referrer;
}
« no previous file with comments | « Source/modules/serviceworkers/FetchRequestData.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698