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

Side by Side Diff: third_party/WebKit/Source/modules/fetch/FetchDataConsumerHandle.h

Issue 2172183003: Return unique_ptr<WebDataConsumerHandle::Reader> directly from obtainReader (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gmock_cxx11
Patch Set: rebase Created 4 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #ifndef FetchDataConsumerHandle_h 5 #ifndef FetchDataConsumerHandle_h
6 #define FetchDataConsumerHandle_h 6 #define FetchDataConsumerHandle_h
7 7
8 #include "modules/ModulesExport.h" 8 #include "modules/ModulesExport.h"
9 #include "platform/blob/BlobData.h" 9 #include "platform/blob/BlobData.h"
10 #include "platform/network/EncodedFormData.h" 10 #include "platform/network/EncodedFormData.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 // return a non-null blob handle with unspecified size. 56 // return a non-null blob handle with unspecified size.
57 // The type of the returned handle may not be meaningful. 57 // The type of the returned handle may not be meaningful.
58 virtual PassRefPtr<BlobDataHandle> drainAsBlobDataHandle(BlobSizePolicy = DisallowBlobWithInvalidSize) { return nullptr; } 58 virtual PassRefPtr<BlobDataHandle> drainAsBlobDataHandle(BlobSizePolicy = DisallowBlobWithInvalidSize) { return nullptr; }
59 59
60 // Drains the data as an EncodedFormData. 60 // Drains the data as an EncodedFormData.
61 // This function returns a non-null form data when the handle is made 61 // This function returns a non-null form data when the handle is made
62 // from an EncodedFormData-convertible value. 62 // from an EncodedFormData-convertible value.
63 virtual PassRefPtr<EncodedFormData> drainAsFormData() { return nullptr; } 63 virtual PassRefPtr<EncodedFormData> drainAsFormData() { return nullptr; }
64 }; 64 };
65 65
66 // TODO(yhirano): obtainReader() is currently non-virtual override, and 66 std::unique_ptr<WebDataConsumerHandle::Reader> obtainReader(Client*) final;
67 // will be changed into virtual override when we can use unique_ptr in 67 virtual std::unique_ptr<Reader> obtainFetchDataReader(Client*) = 0;
68 // Blink.
69 std::unique_ptr<Reader> obtainReader(Client* client) { return wrapUnique(obt ainReaderInternal(client)); }
70
71 private:
72 Reader* obtainReaderInternal(Client*) override = 0;
73 }; 68 };
74 69
75 } // namespace blink 70 } // namespace blink
76 71
77 #endif // FetchDataConsumerHandle_h 72 #endif // FetchDataConsumerHandle_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698