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

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

Issue 794223003: Cheaper thread-safe atomic initialization of static references. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add type check for initial value Created 5 years, 11 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 "bindings/core/v8/ScriptWrappable.h" 8 #include "bindings/core/v8/ScriptWrappable.h"
9 #include "core/dom/DOMArrayBufferDeallocationObserver.h" 9 #include "core/dom/DOMArrayBufferDeallocationObserver.h"
10 #include "wtf/ArrayBuffer.h" 10 #include "wtf/ArrayBuffer.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 PassRefPtr<DOMArrayBuffer> slice(int begin, int end) const 48 PassRefPtr<DOMArrayBuffer> slice(int begin, int end) const
49 { 49 {
50 return create(buffer()->slice(begin, end)); 50 return create(buffer()->slice(begin, end));
51 } 51 }
52 PassRefPtr<DOMArrayBuffer> slice(int begin) const 52 PassRefPtr<DOMArrayBuffer> slice(int begin) const
53 { 53 {
54 return create(buffer()->slice(begin)); 54 return create(buffer()->slice(begin));
55 } 55 }
56 bool transfer(WTF::ArrayBufferContents& result) { return buffer()->transfer( result); } 56 bool transfer(WTF::ArrayBufferContents& result) { return buffer()->transfer( result); }
57 bool isNeutered() { return buffer()->isNeutered(); } 57 bool isNeutered() { return buffer()->isNeutered(); }
58 void setDeallocationObserver(DOMArrayBufferDeallocationObserver* observer) 58 void setDeallocationObserver(DOMArrayBufferDeallocationObserver& observer)
59 { 59 {
60 buffer()->setDeallocationObserver(observer); 60 buffer()->setDeallocationObserver(observer);
61 } 61 }
62 62
63 virtual v8::Handle<v8::Object> wrap(v8::Handle<v8::Object> creationContext, v8::Isolate*) override; 63 virtual v8::Handle<v8::Object> wrap(v8::Handle<v8::Object> creationContext, v8::Isolate*) override;
64 virtual v8::Handle<v8::Object> associateWithWrapper(v8::Isolate*, const Wrap perTypeInfo*, v8::Handle<v8::Object> wrapper) override; 64 virtual v8::Handle<v8::Object> associateWithWrapper(v8::Isolate*, const Wrap perTypeInfo*, v8::Handle<v8::Object> wrapper) override;
65 65
66 private: 66 private:
67 explicit DOMArrayBuffer(PassRefPtr<WTF::ArrayBuffer> buffer) 67 explicit DOMArrayBuffer(PassRefPtr<WTF::ArrayBuffer> buffer)
68 : m_buffer(buffer) 68 : m_buffer(buffer)
69 { 69 {
70 ASSERT(m_buffer); 70 ASSERT(m_buffer);
71 } 71 }
72 72
73 RefPtr<WTF::ArrayBuffer> m_buffer; 73 RefPtr<WTF::ArrayBuffer> m_buffer;
74 }; 74 };
75 75
76 } // namespace blink 76 } // namespace blink
77 77
78 #endif // DOMArrayBuffer_h 78 #endif // DOMArrayBuffer_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698