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

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

Issue 2957513002: Removed calls to RefPtr::Release in return statements with auto move. (Closed)
Patch Set: rebased Created 3 years, 5 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/FormDataBytesConsumer.h" 5 #include "modules/fetch/FormDataBytesConsumer.h"
6 6
7 #include "core/dom/DOMArrayBuffer.h" 7 #include "core/dom/DOMArrayBuffer.h"
8 #include "core/dom/DOMArrayBufferView.h" 8 #include "core/dom/DOMArrayBufferView.h"
9 #include "modules/fetch/BlobBytesConsumer.h" 9 #include "modules/fetch/BlobBytesConsumer.h"
10 #include "platform/blob/BlobData.h" 10 #include "platform/blob/BlobData.h"
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 } 170 }
171 Result EndRead(size_t read_size) override { 171 Result EndRead(size_t read_size) override {
172 return blob_bytes_consumer_->EndRead(read_size); 172 return blob_bytes_consumer_->EndRead(read_size);
173 } 173 }
174 PassRefPtr<BlobDataHandle> DrainAsBlobDataHandle( 174 PassRefPtr<BlobDataHandle> DrainAsBlobDataHandle(
175 BlobSizePolicy policy) override { 175 BlobSizePolicy policy) override {
176 RefPtr<BlobDataHandle> handle = 176 RefPtr<BlobDataHandle> handle =
177 blob_bytes_consumer_->DrainAsBlobDataHandle(policy); 177 blob_bytes_consumer_->DrainAsBlobDataHandle(policy);
178 if (handle) 178 if (handle)
179 form_data_ = nullptr; 179 form_data_ = nullptr;
180 return handle.Release(); 180 return handle;
181 } 181 }
182 PassRefPtr<EncodedFormData> DrainAsFormData() override { 182 PassRefPtr<EncodedFormData> DrainAsFormData() override {
183 if (!form_data_) 183 if (!form_data_)
184 return nullptr; 184 return nullptr;
185 blob_bytes_consumer_->Cancel(); 185 blob_bytes_consumer_->Cancel();
186 return form_data_.Release(); 186 return form_data_.Release();
187 } 187 }
188 void SetClient(BytesConsumer::Client* client) override { 188 void SetClient(BytesConsumer::Client* client) override {
189 blob_bytes_consumer_->SetClient(client); 189 blob_bytes_consumer_->SetClient(client);
190 } 190 }
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 BytesConsumer* consumer) 236 BytesConsumer* consumer)
237 : impl_(IsSimple(form_data.Get()) 237 : impl_(IsSimple(form_data.Get())
238 ? static_cast<BytesConsumer*>( 238 ? static_cast<BytesConsumer*>(
239 new SimpleFormDataBytesConsumer(std::move(form_data))) 239 new SimpleFormDataBytesConsumer(std::move(form_data)))
240 : static_cast<BytesConsumer*>( 240 : static_cast<BytesConsumer*>(
241 new ComplexFormDataBytesConsumer(execution_context, 241 new ComplexFormDataBytesConsumer(execution_context,
242 std::move(form_data), 242 std::move(form_data),
243 consumer))) {} 243 consumer))) {}
244 244
245 } // namespace blink 245 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/fetch/BodyStreamBuffer.cpp ('k') | third_party/WebKit/Source/platform/SharedBuffer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698