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

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

Issue 564773004: Fix conversion to WebServiceWorkerResponse headers. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added xhr end-to-end test Created 6 years, 3 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 "Response.h" 6 #include "Response.h"
7 7
8 #include "bindings/core/v8/Dictionary.h" 8 #include "bindings/core/v8/Dictionary.h"
9 #include "bindings/core/v8/ExceptionState.h" 9 #include "bindings/core/v8/ExceptionState.h"
10 #include "core/fileapi/Blob.h" 10 #include "core/fileapi/Blob.h"
(...skipping 18 matching lines...) Expand all
29 response->setURL(webResponse.url()); 29 response->setURL(webResponse.url());
30 response->setStatus(webResponse.status()); 30 response->setStatus(webResponse.status());
31 response->setStatusMessage(webResponse.statusText()); 31 response->setStatusMessage(webResponse.statusText());
32 return response; 32 return response;
33 } 33 }
34 34
35 Headers* createHeadersFromWebResponse(const WebServiceWorkerResponse& webRespons e) 35 Headers* createHeadersFromWebResponse(const WebServiceWorkerResponse& webRespons e)
36 { 36 {
37 Headers* headers = Headers::create(); 37 Headers* headers = Headers::create();
38 TrackExceptionState exceptionState; 38 TrackExceptionState exceptionState;
39 for (HashMap<String, String>::const_iterator i = webResponse.headers().begin (), end = webResponse.headers().end(); i != end; ++i) { 39 for (HTTPHeaderMap::const_iterator i = webResponse.headers().begin(), end = webResponse.headers().end(); i != end; ++i) {
40 headers->append(i->key, i->value, exceptionState); 40 headers->append(i->key, i->value, exceptionState);
41 if (exceptionState.hadException()) 41 if (exceptionState.hadException())
42 return 0; 42 return 0;
43 } 43 }
44 return headers; 44 return headers;
45 } 45 }
46 46
47 } 47 }
48 48
49 Response* Response::create(ExecutionContext* context, Blob* body, const Dictiona ry& responseInit, ExceptionState& exceptionState) 49 Response* Response::create(ExecutionContext* context, Blob* body, const Dictiona ry& responseInit, ExceptionState& exceptionState)
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 } 239 }
240 240
241 void Response::trace(Visitor* visitor) 241 void Response::trace(Visitor* visitor)
242 { 242 {
243 Body::trace(visitor); 243 Body::trace(visitor);
244 visitor->trace(m_response); 244 visitor->trace(m_response);
245 visitor->trace(m_headers); 245 visitor->trace(m_headers);
246 } 246 }
247 247
248 } // namespace blink 248 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/serviceworkers/FetchResponseData.cpp ('k') | Source/platform/exported/WebServiceWorkerResponse.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698