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

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

Issue 2432883002: Replaced PassRefPtr copies with moves in unit tests. (Closed)
Patch Set: Created 4 years, 2 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 DataConsumerHandleTestUtil_h 5 #ifndef DataConsumerHandleTestUtil_h
6 #define DataConsumerHandleTestUtil_h 6 #define DataConsumerHandleTestUtil_h
7 7
8 #include "bindings/core/v8/ScriptState.h" 8 #include "bindings/core/v8/ScriptState.h"
9 #include "core/testing/NullExecutionContext.h" 9 #include "core/testing/NullExecutionContext.h"
10 #include "gin/public/isolate_holder.h" 10 #include "gin/public/isolate_holder.h"
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 const String m_name; 204 const String m_name;
205 RefPtr<Context> m_context; 205 RefPtr<Context> m_context;
206 }; 206 };
207 class DataConsumerHandle final : public WebDataConsumerHandle { 207 class DataConsumerHandle final : public WebDataConsumerHandle {
208 USING_FAST_MALLOC(DataConsumerHandle); 208 USING_FAST_MALLOC(DataConsumerHandle);
209 209
210 public: 210 public:
211 static std::unique_ptr<WebDataConsumerHandle> create( 211 static std::unique_ptr<WebDataConsumerHandle> create(
212 const String& name, 212 const String& name,
213 PassRefPtr<Context> context) { 213 PassRefPtr<Context> context) {
214 return wrapUnique(new DataConsumerHandle(name, context)); 214 return wrapUnique(new DataConsumerHandle(name, std::move(context)));
215 } 215 }
216 216
217 private: 217 private:
218 DataConsumerHandle(const String& name, PassRefPtr<Context> context) 218 DataConsumerHandle(const String& name, PassRefPtr<Context> context)
219 : m_name(name.isolatedCopy()), m_context(context) {} 219 : m_name(name.isolatedCopy()), m_context(context) {}
220 220
221 std::unique_ptr<Reader> obtainReader(Client*) { 221 std::unique_ptr<Reader> obtainReader(Client*) {
222 return WTF::wrapUnique(new ReaderImpl(m_name, m_context)); 222 return WTF::wrapUnique(new ReaderImpl(m_name, m_context));
223 } 223 }
224 const char* debugName() const override { 224 const char* debugName() const override {
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 std::unique_ptr<T> m_handleReader; 514 std::unique_ptr<T> m_handleReader;
515 }; 515 };
516 516
517 static std::unique_ptr<WebDataConsumerHandle> 517 static std::unique_ptr<WebDataConsumerHandle>
518 createWaitingDataConsumerHandle(); 518 createWaitingDataConsumerHandle();
519 }; 519 };
520 520
521 } // namespace blink 521 } // namespace blink
522 522
523 #endif // DataConsumerHandleTestUtil_h 523 #endif // DataConsumerHandleTestUtil_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698