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

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

Issue 1060033002: Implement Request.context for Fetch API (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 8 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
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 "modules/fetch/FetchRequestData.h" 6 #include "modules/fetch/FetchRequestData.h"
7 7
8 #include "core/dom/ExecutionContext.h" 8 #include "core/dom/ExecutionContext.h"
9 #include "core/fetch/ResourceLoaderOptions.h" 9 #include "core/fetch/ResourceLoaderOptions.h"
10 #include "core/loader/ThreadableLoader.h" 10 #include "core/loader/ThreadableLoader.h"
(...skipping 10 matching lines...) Expand all
21 } 21 }
22 22
23 FetchRequestData* FetchRequestData::create(const WebServiceWorkerRequest& webReq uest) 23 FetchRequestData* FetchRequestData::create(const WebServiceWorkerRequest& webReq uest)
24 { 24 {
25 FetchRequestData* request = FetchRequestData::create(); 25 FetchRequestData* request = FetchRequestData::create();
26 request->m_url = webRequest.url(); 26 request->m_url = webRequest.url();
27 request->m_method = webRequest.method(); 27 request->m_method = webRequest.method();
28 for (HTTPHeaderMap::const_iterator it = webRequest.headers().begin(); it != webRequest.headers().end(); ++it) 28 for (HTTPHeaderMap::const_iterator it = webRequest.headers().begin(); it != webRequest.headers().end(); ++it)
29 request->m_headerList->append(it->key, it->value); 29 request->m_headerList->append(it->key, it->value);
30 request->m_blobDataHandle = webRequest.blobDataHandle(); 30 request->m_blobDataHandle = webRequest.blobDataHandle();
31 request->setContext(webRequest.requestContext());
31 request->m_referrer.setURL(webRequest.referrer()); 32 request->m_referrer.setURL(webRequest.referrer());
32 request->setMode(webRequest.mode()); 33 request->setMode(webRequest.mode());
33 request->setCredentials(webRequest.credentialsMode()); 34 request->setCredentials(webRequest.credentialsMode());
34 request->setMIMEType(request->m_headerList->extractMIMEType()); 35 request->setMIMEType(request->m_headerList->extractMIMEType());
35 return request; 36 return request;
36 } 37 }
37 38
38 FetchRequestData* FetchRequestData::clone() const 39 FetchRequestData* FetchRequestData::clone() const
39 { 40 {
40 // TODO(yhirano): This method will be destructive. 41 // TODO(yhirano): This method will be destructive.
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 , m_responseTainting(BasicTainting) 77 , m_responseTainting(BasicTainting)
77 { 78 {
78 } 79 }
79 80
80 DEFINE_TRACE(FetchRequestData) 81 DEFINE_TRACE(FetchRequestData)
81 { 82 {
82 visitor->trace(m_headerList); 83 visitor->trace(m_headerList);
83 } 84 }
84 85
85 } // namespace blink 86 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698