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

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

Issue 2811623002: Fetch API: Add Request#cache attribute (Closed)
Patch Set: address comments Created 3 years, 8 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 "modules/fetch/RequestInit.h" 5 #include "modules/fetch/RequestInit.h"
6 6
7 #include "bindings/core/v8/Dictionary.h" 7 #include "bindings/core/v8/Dictionary.h"
8 #include "bindings/core/v8/V8ArrayBuffer.h" 8 #include "bindings/core/v8/V8ArrayBuffer.h"
9 #include "bindings/core/v8/V8ArrayBufferView.h" 9 #include "bindings/core/v8/V8ArrayBufferView.h"
10 #include "bindings/core/v8/V8Binding.h" 10 #include "bindings/core/v8/V8Binding.h"
(...skipping 27 matching lines...) Expand all
38 if (DictionaryHelper::Get(options, "headers", headers_vector, 38 if (DictionaryHelper::Get(options, "headers", headers_vector,
39 exception_state)) { 39 exception_state)) {
40 headers = Headers::Create(headers_vector, exception_state); 40 headers = Headers::Create(headers_vector, exception_state);
41 are_any_members_set = true; 41 are_any_members_set = true;
42 } else { 42 } else {
43 are_any_members_set |= 43 are_any_members_set |=
44 DictionaryHelper::Get(options, "headers", headers_dictionary); 44 DictionaryHelper::Get(options, "headers", headers_dictionary);
45 } 45 }
46 } 46 }
47 are_any_members_set |= DictionaryHelper::Get(options, "mode", mode); 47 are_any_members_set |= DictionaryHelper::Get(options, "mode", mode);
48 if (RuntimeEnabledFeatures::fetchRequestCacheEnabled())
49 are_any_members_set |= DictionaryHelper::Get(options, "cache", cache);
50
48 are_any_members_set |= DictionaryHelper::Get(options, "redirect", redirect); 51 are_any_members_set |= DictionaryHelper::Get(options, "redirect", redirect);
49 AtomicString referrer_string; 52 AtomicString referrer_string;
50 bool is_referrer_string_set = DictionaryHelper::GetWithUndefinedCheck( 53 bool is_referrer_string_set = DictionaryHelper::GetWithUndefinedCheck(
51 options, "referrer", referrer_string); 54 options, "referrer", referrer_string);
52 are_any_members_set |= is_referrer_string_set; 55 are_any_members_set |= is_referrer_string_set;
53 are_any_members_set |= DictionaryHelper::Get(options, "integrity", integrity); 56 are_any_members_set |= DictionaryHelper::Get(options, "integrity", integrity);
54 AtomicString referrer_policy_string; 57 AtomicString referrer_policy_string;
55 bool is_referrer_policy_set = 58 bool is_referrer_policy_set =
56 DictionaryHelper::Get(options, "referrerPolicy", referrer_policy_string); 59 DictionaryHelper::Get(options, "referrerPolicy", referrer_policy_string);
57 are_any_members_set |= is_referrer_policy_set; 60 are_any_members_set |= is_referrer_policy_set;
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 AtomicString("application/x-www-form-urlencoded;charset=UTF-8"); 154 AtomicString("application/x-www-form-urlencoded;charset=UTF-8");
152 body = new FormDataBytesConsumer(context, form_data.Release()); 155 body = new FormDataBytesConsumer(context, form_data.Release());
153 } else if (v8_body->IsString()) { 156 } else if (v8_body->IsString()) {
154 content_type = "text/plain;charset=UTF-8"; 157 content_type = "text/plain;charset=UTF-8";
155 body = new FormDataBytesConsumer( 158 body = new FormDataBytesConsumer(
156 ToUSVString(isolate, v8_body, exception_state)); 159 ToUSVString(isolate, v8_body, exception_state));
157 } 160 }
158 } 161 }
159 162
160 } // namespace blink 163 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/fetch/RequestInit.h ('k') | third_party/WebKit/Source/platform/RuntimeEnabledFeatures.json5 » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698