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

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

Issue 1265133002: [1/3 blink] Support redirect option of Request and "opaqueredirect" response type. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 5 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
« no previous file with comments | « Source/modules/fetch/RequestInit.h ('k') | Source/modules/fetch/Response.cpp » ('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 "modules/fetch/RequestInit.h" 6 #include "modules/fetch/RequestInit.h"
7 7
8 #include "bindings/core/v8/Dictionary.h" 8 #include "bindings/core/v8/Dictionary.h"
9 #include "bindings/core/v8/V8ArrayBuffer.h" 9 #include "bindings/core/v8/V8ArrayBuffer.h"
10 #include "bindings/core/v8/V8ArrayBufferView.h" 10 #include "bindings/core/v8/V8ArrayBufferView.h"
(...skipping 13 matching lines...) Expand all
24 DictionaryHelper::get(options, "headers", headers); 24 DictionaryHelper::get(options, "headers", headers);
25 if (!headers) { 25 if (!headers) {
26 Vector<Vector<String>> headersVector; 26 Vector<Vector<String>> headersVector;
27 if (DictionaryHelper::get(options, "headers", headersVector, exceptionSt ate)) 27 if (DictionaryHelper::get(options, "headers", headersVector, exceptionSt ate))
28 headers = Headers::create(headersVector, exceptionState); 28 headers = Headers::create(headersVector, exceptionState);
29 else 29 else
30 DictionaryHelper::get(options, "headers", headersDictionary); 30 DictionaryHelper::get(options, "headers", headersDictionary);
31 } 31 }
32 DictionaryHelper::get(options, "mode", mode); 32 DictionaryHelper::get(options, "mode", mode);
33 DictionaryHelper::get(options, "credentials", credentials); 33 DictionaryHelper::get(options, "credentials", credentials);
34 DictionaryHelper::get(options, "redirect", redirect);
34 35
35 v8::Local<v8::Value> body; 36 v8::Local<v8::Value> body;
36 if (!DictionaryHelper::get(options, "body", body) || body->IsUndefined() || body->IsNull()) 37 if (!DictionaryHelper::get(options, "body", body) || body->IsUndefined() || body->IsNull())
37 return; 38 return;
38 OwnPtr<BlobData> blobData = BlobData::create(); 39 OwnPtr<BlobData> blobData = BlobData::create();
39 v8::Isolate* isolate = toIsolate(context); 40 v8::Isolate* isolate = toIsolate(context);
40 if (body->IsArrayBuffer()) { 41 if (body->IsArrayBuffer()) {
41 DOMArrayBuffer* arrayBuffer = V8ArrayBuffer::toImpl(v8::Local<v8::Object >::Cast(body)); 42 DOMArrayBuffer* arrayBuffer = V8ArrayBuffer::toImpl(v8::Local<v8::Object >::Cast(body));
42 ASSERT(arrayBuffer); 43 ASSERT(arrayBuffer);
43 blobData->appendBytes(arrayBuffer->data(), arrayBuffer->byteLength()); 44 blobData->appendBytes(arrayBuffer->data(), arrayBuffer->byteLength());
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 blobData->appendText(stringValue, false); 82 blobData->appendText(stringValue, false);
82 blobData->setContentType("text/plain;charset=UTF-8"); 83 blobData->setContentType("text/plain;charset=UTF-8");
83 } else { 84 } else {
84 return; 85 return;
85 } 86 }
86 const long long blobSize = blobData->length(); 87 const long long blobSize = blobData->length();
87 bodyBlobHandle = BlobDataHandle::create(blobData.release(), blobSize); 88 bodyBlobHandle = BlobDataHandle::create(blobData.release(), blobSize);
88 } 89 }
89 90
90 } 91 }
OLDNEW
« no previous file with comments | « Source/modules/fetch/RequestInit.h ('k') | Source/modules/fetch/Response.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698