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

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

Issue 304233017: ServiceWorker: Add layout tests for fetch event response (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: patch for landing Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/modules/serviceworkers/Response.h ('k') | Source/modules/serviceworkers/Response.idl » ('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 "Response.h" 6 #include "Response.h"
7 7
8 #include "bindings/v8/Dictionary.h" 8 #include "bindings/v8/Dictionary.h"
9 #include "core/fileapi/Blob.h" 9 #include "core/fileapi/Blob.h"
10 #include "modules/serviceworkers/ResponseInit.h" 10 #include "modules/serviceworkers/ResponseInit.h"
11 #include "platform/NotImplemented.h" 11 #include "platform/NotImplemented.h"
12 #include "public/platform/WebServiceWorkerResponse.h" 12 #include "public/platform/WebServiceWorkerResponse.h"
13 13
14 namespace WebCore { 14 namespace WebCore {
15 15
16 // FIXME: Remove this legacy function when the required Chromium-side patch land s.
17 PassRefPtr<Response> Response::create(const Dictionary& responseInit)
18 {
19 return create(nullptr, responseInit);
20 }
21
22 PassRefPtr<Response> Response::create(Blob* body, const Dictionary& responseInit ) 16 PassRefPtr<Response> Response::create(Blob* body, const Dictionary& responseInit )
23 { 17 {
24 RefPtr<BlobDataHandle> blobDataHandle = body ? body->blobDataHandle() : null ptr; 18 RefPtr<BlobDataHandle> blobDataHandle = body ? body->blobDataHandle() : null ptr;
25 19
26 // FIXME: Maybe append or override content-length and content-type headers u sing the blob. The spec will clarify what to do: 20 // FIXME: Maybe append or override content-length and content-type headers u sing the blob. The spec will clarify what to do:
27 // https://github.com/slightlyoff/ServiceWorker/issues/192 21 // https://github.com/slightlyoff/ServiceWorker/issues/192
28 return adoptRef(new Response(blobDataHandle.release(), ResponseInit(response Init))); 22 return adoptRef(new Response(blobDataHandle.release(), ResponseInit(response Init)));
29 } 23 }
30 24
31 PassRefPtr<HeaderMap> Response::headers() const 25 PassRefPtr<HeaderMap> Response::headers() const
(...skipping 16 matching lines...) Expand all
48 , m_headers(responseInit.headers) 42 , m_headers(responseInit.headers)
49 , m_blobDataHandle(blobDataHandle) 43 , m_blobDataHandle(blobDataHandle)
50 { 44 {
51 ScriptWrappable::init(this); 45 ScriptWrappable::init(this);
52 46
53 if (!m_headers) 47 if (!m_headers)
54 m_headers = HeaderMap::create(); 48 m_headers = HeaderMap::create();
55 } 49 }
56 50
57 } // namespace WebCore 51 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/modules/serviceworkers/Response.h ('k') | Source/modules/serviceworkers/Response.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698