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

Side by Side Diff: third_party/WebKit/Source/platform/image-decoders/SegmentReader.cpp

Issue 2761693002: Wrapped PassRefPtrs in move where passed to RefPtr constructor. (Closed)
Patch Set: Added move wraps for multiple instances in 1 line. Created 3 years, 9 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 "platform/image-decoders/SegmentReader.h" 5 #include "platform/image-decoders/SegmentReader.h"
6 6
7 #include "platform/SharedBuffer.h" 7 #include "platform/SharedBuffer.h"
8 #include "third_party/skia/include/core/SkData.h" 8 #include "third_party/skia/include/core/SkData.h"
9 #include "wtf/Assertions.h" 9 #include "wtf/Assertions.h"
10 #include "wtf/Noncopyable.h" 10 #include "wtf/Noncopyable.h"
(...skipping 14 matching lines...) Expand all
25 size_t size() const override; 25 size_t size() const override;
26 size_t getSomeData(const char*& data, size_t position) const override; 26 size_t getSomeData(const char*& data, size_t position) const override;
27 sk_sp<SkData> getAsSkData() const override; 27 sk_sp<SkData> getAsSkData() const override;
28 28
29 private: 29 private:
30 RefPtr<SharedBuffer> m_sharedBuffer; 30 RefPtr<SharedBuffer> m_sharedBuffer;
31 }; 31 };
32 32
33 SharedBufferSegmentReader::SharedBufferSegmentReader( 33 SharedBufferSegmentReader::SharedBufferSegmentReader(
34 PassRefPtr<SharedBuffer> buffer) 34 PassRefPtr<SharedBuffer> buffer)
35 : m_sharedBuffer(buffer) {} 35 : m_sharedBuffer(std::move(buffer)) {}
36 36
37 size_t SharedBufferSegmentReader::size() const { 37 size_t SharedBufferSegmentReader::size() const {
38 return m_sharedBuffer->size(); 38 return m_sharedBuffer->size();
39 } 39 }
40 40
41 size_t SharedBufferSegmentReader::getSomeData(const char*& data, 41 size_t SharedBufferSegmentReader::getSomeData(const char*& data,
42 size_t position) const { 42 size_t position) const {
43 return m_sharedBuffer->getSomeData(data, position); 43 return m_sharedBuffer->getSomeData(data, position);
44 } 44 }
45 45
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 PassRefPtr<SegmentReader> SegmentReader::createFromSkData(sk_sp<SkData> data) { 189 PassRefPtr<SegmentReader> SegmentReader::createFromSkData(sk_sp<SkData> data) {
190 return adoptRef(new DataSegmentReader(std::move(data))); 190 return adoptRef(new DataSegmentReader(std::move(data)));
191 } 191 }
192 192
193 PassRefPtr<SegmentReader> SegmentReader::createFromSkROBuffer( 193 PassRefPtr<SegmentReader> SegmentReader::createFromSkROBuffer(
194 sk_sp<SkROBuffer> buffer) { 194 sk_sp<SkROBuffer> buffer) {
195 return adoptRef(new ROBufferSegmentReader(std::move(buffer))); 195 return adoptRef(new ROBufferSegmentReader(std::move(buffer)));
196 } 196 }
197 197
198 } // namespace blink 198 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698