OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |