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

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

Issue 475533005: [ServiceWorker] Add support of FetchEvent's request.body. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 6 years, 4 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 "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 19 matching lines...) Expand all
30 return request.release(); 30 return request.release();
31 } 31 }
32 32
33 PassRefPtrWillBeRawPtr<FetchRequestData> FetchRequestData::create(const WebServi ceWorkerRequest& webRequest) 33 PassRefPtrWillBeRawPtr<FetchRequestData> FetchRequestData::create(const WebServi ceWorkerRequest& webRequest)
34 { 34 {
35 RefPtrWillBeRawPtr<FetchRequestData> request = FetchRequestData::create(); 35 RefPtrWillBeRawPtr<FetchRequestData> request = FetchRequestData::create();
36 request->m_url = webRequest.url(); 36 request->m_url = webRequest.url();
37 request->m_method = webRequest.method(); 37 request->m_method = webRequest.method();
38 for (HTTPHeaderMap::const_iterator it = webRequest.headers().begin(); it != webRequest.headers().end(); ++it) 38 for (HTTPHeaderMap::const_iterator it = webRequest.headers().begin(); it != webRequest.headers().end(); ++it)
39 request->m_headerList->append(it->key, it->value); 39 request->m_headerList->append(it->key, it->value);
40 request->m_blobDataHandle = webRequest.blobDataHandle();
40 request->m_referrer.setURL(webRequest.referrer()); 41 request->m_referrer.setURL(webRequest.referrer());
41 return request.release(); 42 return request.release();
42 } 43 }
43 44
44 PassRefPtrWillBeRawPtr<FetchRequestData> FetchRequestData::createRestrictedCopy( ExecutionContext* context, PassRefPtr<SecurityOrigin> origin) const 45 PassRefPtrWillBeRawPtr<FetchRequestData> FetchRequestData::createRestrictedCopy( ExecutionContext* context, PassRefPtr<SecurityOrigin> origin) const
45 { 46 {
46 // "To make a restricted copy of a request |request|, run these steps: 47 // "To make a restricted copy of a request |request|, run these steps:
47 // 1. Let |r| be a new request whose url is |request|'s url, method is 48 // 1. Let |r| be a new request whose url is |request|'s url, method is
48 // |request|'s method, header list is a copy of |request|'s header list, 49 // |request|'s method, header list is a copy of |request|'s header list,
49 // body is a tee of |request|'s body, client is entry settings object's 50 // body is a tee of |request|'s body, client is entry settings object's
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 , m_responseTainting(BasicTainting) 101 , m_responseTainting(BasicTainting)
101 { 102 {
102 } 103 }
103 104
104 void FetchRequestData::trace(Visitor* visitor) 105 void FetchRequestData::trace(Visitor* visitor)
105 { 106 {
106 visitor->trace(m_headerList); 107 visitor->trace(m_headerList);
107 } 108 }
108 109
109 } // namespace blink 110 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/serviceworkers/FetchRequestData.h ('k') | Source/modules/serviceworkers/Request.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698