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

Side by Side Diff: third_party/WebKit/Source/core/dom/DOMArrayBuffer.h

Issue 2282413002: Replaced PassRefPtr copies with moves in Source/core. (Closed)
Patch Set: rebased Created 4 years, 3 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 #ifndef DOMArrayBuffer_h 5 #ifndef DOMArrayBuffer_h
6 #define DOMArrayBuffer_h 6 #define DOMArrayBuffer_h
7 7
8 #include "core/CoreExport.h" 8 #include "core/CoreExport.h"
9 #include "core/dom/DOMArrayBufferBase.h" 9 #include "core/dom/DOMArrayBufferBase.h"
10 #include "wtf/typed_arrays/ArrayBuffer.h" 10 #include "wtf/typed_arrays/ArrayBuffer.h"
11 11
12 namespace blink { 12 namespace blink {
13 13
14 class CORE_EXPORT DOMArrayBuffer final : public DOMArrayBufferBase { 14 class CORE_EXPORT DOMArrayBuffer final : public DOMArrayBufferBase {
15 DEFINE_WRAPPERTYPEINFO(); 15 DEFINE_WRAPPERTYPEINFO();
16 public: 16 public:
17 static DOMArrayBuffer* create(PassRefPtr<WTF::ArrayBuffer> buffer) 17 static DOMArrayBuffer* create(PassRefPtr<WTF::ArrayBuffer> buffer)
18 { 18 {
19 return new DOMArrayBuffer(buffer); 19 return new DOMArrayBuffer(std::move(buffer));
20 } 20 }
21 static DOMArrayBuffer* create(unsigned numElements, unsigned elementByteSize ) 21 static DOMArrayBuffer* create(unsigned numElements, unsigned elementByteSize )
22 { 22 {
23 return create(WTF::ArrayBuffer::create(numElements, elementByteSize)); 23 return create(WTF::ArrayBuffer::create(numElements, elementByteSize));
24 } 24 }
25 static DOMArrayBuffer* create(const void* source, unsigned byteLength) 25 static DOMArrayBuffer* create(const void* source, unsigned byteLength)
26 { 26 {
27 return create(WTF::ArrayBuffer::create(source, byteLength)); 27 return create(WTF::ArrayBuffer::create(source, byteLength));
28 } 28 }
29 static DOMArrayBuffer* create(WTF::ArrayBufferContents& contents) 29 static DOMArrayBuffer* create(WTF::ArrayBufferContents& contents)
(...skipping 14 matching lines...) Expand all
44 } 44 }
45 DOMArrayBuffer* slice(int begin) const 45 DOMArrayBuffer* slice(int begin) const
46 { 46 {
47 return create(buffer()->slice(begin)); 47 return create(buffer()->slice(begin));
48 } 48 }
49 49
50 v8::Local<v8::Object> wrap(v8::Isolate*, v8::Local<v8::Object> creationConte xt) override; 50 v8::Local<v8::Object> wrap(v8::Isolate*, v8::Local<v8::Object> creationConte xt) override;
51 51
52 private: 52 private:
53 explicit DOMArrayBuffer(PassRefPtr<WTF::ArrayBuffer> buffer) 53 explicit DOMArrayBuffer(PassRefPtr<WTF::ArrayBuffer> buffer)
54 : DOMArrayBufferBase(buffer) 54 : DOMArrayBufferBase(std::move(buffer))
55 { 55 {
56 } 56 }
57 }; 57 };
58 58
59 } // namespace blink 59 } // namespace blink
60 60
61 #endif // DOMArrayBuffer_h 61 #endif // DOMArrayBuffer_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/resolver/FontBuilder.cpp ('k') | third_party/WebKit/Source/core/dom/DOMDataView.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698