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

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

Issue 2909613002: Replaced usage of RefPtr::Release with std::move wraps. (Closed)
Patch Set: Created 3 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
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/Response.h" 5 #include "modules/fetch/Response.h"
6 6
7 #include <memory> 7 #include <memory>
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 "bindings/core/v8/V8ArrayBuffer.h" 10 #include "bindings/core/v8/V8ArrayBuffer.h"
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 script_state, new FormDataBytesConsumer(array_buffer_view)); 162 script_state, new FormDataBytesConsumer(array_buffer_view));
163 } else if (V8FormData::hasInstance(body, isolate)) { 163 } else if (V8FormData::hasInstance(body, isolate)) {
164 RefPtr<EncodedFormData> form_data = 164 RefPtr<EncodedFormData> form_data =
165 V8FormData::toImpl(body.As<v8::Object>())->EncodeMultiPartFormData(); 165 V8FormData::toImpl(body.As<v8::Object>())->EncodeMultiPartFormData();
166 // Here we handle formData->boundary() as a C-style string. See 166 // Here we handle formData->boundary() as a C-style string. See
167 // FormDataEncoder::generateUniqueBoundaryString. 167 // FormDataEncoder::generateUniqueBoundaryString.
168 content_type = AtomicString("multipart/form-data; boundary=") + 168 content_type = AtomicString("multipart/form-data; boundary=") +
169 form_data->Boundary().data(); 169 form_data->Boundary().data();
170 body_buffer = new BodyStreamBuffer( 170 body_buffer = new BodyStreamBuffer(
171 script_state, 171 script_state,
172 new FormDataBytesConsumer(execution_context, form_data.Release())); 172 new FormDataBytesConsumer(execution_context, std::move(form_data)));
173 } else if (V8URLSearchParams::hasInstance(body, isolate)) { 173 } else if (V8URLSearchParams::hasInstance(body, isolate)) {
174 RefPtr<EncodedFormData> form_data = 174 RefPtr<EncodedFormData> form_data =
175 V8URLSearchParams::toImpl(body.As<v8::Object>())->ToEncodedFormData(); 175 V8URLSearchParams::toImpl(body.As<v8::Object>())->ToEncodedFormData();
176 body_buffer = new BodyStreamBuffer( 176 body_buffer = new BodyStreamBuffer(
177 script_state, 177 script_state,
178 new FormDataBytesConsumer(execution_context, form_data.Release())); 178 new FormDataBytesConsumer(execution_context, std::move(form_data)));
179 content_type = "application/x-www-form-urlencoded;charset=UTF-8"; 179 content_type = "application/x-www-form-urlencoded;charset=UTF-8";
180 } else if (ReadableStreamOperations::IsReadableStream(script_state, 180 } else if (ReadableStreamOperations::IsReadableStream(script_state,
181 body_value)) { 181 body_value)) {
182 UseCounter::Count(execution_context, 182 UseCounter::Count(execution_context,
183 UseCounter::kFetchResponseConstructionWithStream); 183 UseCounter::kFetchResponseConstructionWithStream);
184 body_buffer = new BodyStreamBuffer(script_state, body_value); 184 body_buffer = new BodyStreamBuffer(script_state, body_value);
185 } else { 185 } else {
186 String string = ToUSVString(isolate, body, exception_state); 186 String string = ToUSVString(isolate, body, exception_state);
187 if (exception_state.HadException()) 187 if (exception_state.HadException())
188 return nullptr; 188 return nullptr;
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 .Set(response.As<v8::Object>(), body_buffer); 465 .Set(response.As<v8::Object>(), body_buffer);
466 } 466 }
467 467
468 DEFINE_TRACE(Response) { 468 DEFINE_TRACE(Response) {
469 Body::Trace(visitor); 469 Body::Trace(visitor);
470 visitor->Trace(response_); 470 visitor->Trace(response_);
471 visitor->Trace(headers_); 471 visitor->Trace(headers_);
472 } 472 }
473 473
474 } // namespace blink 474 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/fetch/RequestInit.cpp ('k') | third_party/WebKit/Source/modules/indexeddb/IDBCursor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698