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

Side by Side Diff: Source/modules/serviceworkers/FetchRequestData.cpp

Issue 610403002: [ServiceWorker] Plumbing the request credentials mode to the ServiceWorker. [1/2 blink] (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: incorporated mkwst's comment Created 6 years, 2 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 | « no previous file | Source/platform/exported/WebServiceWorkerRequest.cpp » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "config.h" 5 #include "config.h"
6 #include "FetchRequestData.h" 6 #include "FetchRequestData.h"
7 7
8 #include "core/dom/Document.h" 8 #include "core/dom/Document.h"
9 #include "core/dom/ExecutionContext.h" 9 #include "core/dom/ExecutionContext.h"
10 #include "core/fetch/ResourceLoaderOptions.h" 10 #include "core/fetch/ResourceLoaderOptions.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 request->setMode(FetchRequestData::SameOriginMode); 45 request->setMode(FetchRequestData::SameOriginMode);
46 break; 46 break;
47 case WebURLRequest::FetchRequestModeNoCORS: 47 case WebURLRequest::FetchRequestModeNoCORS:
48 request->setMode(FetchRequestData::NoCORSMode); 48 request->setMode(FetchRequestData::NoCORSMode);
49 break; 49 break;
50 case WebURLRequest::FetchRequestModeCORS: 50 case WebURLRequest::FetchRequestModeCORS:
51 request->setMode(FetchRequestData::CORSMode); 51 request->setMode(FetchRequestData::CORSMode);
52 break; 52 break;
53 case WebURLRequest::FetchRequestModeCORSWithForcedPreflight: 53 case WebURLRequest::FetchRequestModeCORSWithForcedPreflight:
54 request->setMode(FetchRequestData::CORSWithForcedPreflight); 54 request->setMode(FetchRequestData::CORSWithForcedPreflight);
55 }
56 switch (webRequest.credentialsMode()) {
57 case WebURLRequest::FetchCredentialsModeOmit:
58 request->setCredentials(FetchRequestData::OmitCredentials);
55 break; 59 break;
56 default: 60 case WebURLRequest::FetchCredentialsModeSameOrigin:
57 ASSERT_NOT_REACHED(); 61 request->setCredentials(FetchRequestData::SameOriginCredentials);
62 break;
63 case WebURLRequest::FetchCredentialsModeInclude:
64 request->setCredentials(FetchRequestData::IncludeCredentials);
58 break; 65 break;
59 } 66 }
60 return request; 67 return request;
61 } 68 }
62 69
63 FetchRequestData* FetchRequestData::createRestrictedCopy(ExecutionContext* conte xt, PassRefPtr<SecurityOrigin> origin) const 70 FetchRequestData* FetchRequestData::createRestrictedCopy(ExecutionContext* conte xt, PassRefPtr<SecurityOrigin> origin) const
64 { 71 {
65 // "To make a restricted copy of a request |request|, run these steps: 72 // "To make a restricted copy of a request |request|, run these steps:
66 // 1. Let |r| be a new request whose url is |request|'s url, method is 73 // 1. Let |r| be a new request whose url is |request|'s url, method is
67 // |request|'s method, header list is a copy of |request|'s header list, 74 // |request|'s method, header list is a copy of |request|'s header list,
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 , m_responseTainting(BasicTainting) 126 , m_responseTainting(BasicTainting)
120 { 127 {
121 } 128 }
122 129
123 void FetchRequestData::trace(Visitor* visitor) 130 void FetchRequestData::trace(Visitor* visitor)
124 { 131 {
125 visitor->trace(m_headerList); 132 visitor->trace(m_headerList);
126 } 133 }
127 134
128 } // namespace blink 135 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/platform/exported/WebServiceWorkerRequest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698