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

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

Issue 1526183004: Prevent SharedArrayBuffer views from being used in bindings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: some tests Created 3 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
« no previous file with comments | « third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 FlexibleArrayBufferView_h 5 #ifndef FlexibleArrayBufferView_h
6 #define FlexibleArrayBufferView_h 6 #define FlexibleArrayBufferView_h
7 7
8 #include "core/CoreExport.h" 8 #include "core/CoreExport.h"
9 #include "core/dom/DOMArrayBufferView.h" 9 #include "core/dom/DOMArrayBufferView.h"
10 #include "platform/heap/Handle.h" 10 #include "platform/heap/Handle.h"
(...skipping 15 matching lines...) Expand all
26 } 26 }
27 27
28 void clear() { 28 void clear() {
29 m_full = nullptr; 29 m_full = nullptr;
30 m_smallData = nullptr; 30 m_smallData = nullptr;
31 m_smallLength = 0; 31 m_smallLength = 0;
32 } 32 }
33 33
34 bool isEmpty() const { return !m_full && !m_smallData; } 34 bool isEmpty() const { return !m_full && !m_smallData; }
35 bool isFull() const { return m_full; } 35 bool isFull() const { return m_full; }
36 bool isShared() const { return m_full && m_full->isShared(); }
36 37
37 DOMArrayBufferView* full() const { 38 DOMArrayBufferView* full() const {
38 DCHECK(isFull()); 39 DCHECK(isFull());
39 return m_full; 40 return m_full;
40 } 41 }
41 42
42 // WARNING: The pointer returned by baseAddressMaybeOnStack() may point to 43 // WARNING: The pointer returned by baseAddressMaybeOnStack() may point to
43 // temporary storage that is only valid during the life-time of the 44 // temporary storage that is only valid during the life-time of the
44 // FlexibleArrayBufferView object. 45 // FlexibleArrayBufferView object.
45 void* baseAddressMaybeOnStack() const { 46 void* baseAddressMaybeOnStack() const {
(...skipping 16 matching lines...) Expand all
62 private: 63 private:
63 Member<DOMArrayBufferView> m_full; 64 Member<DOMArrayBufferView> m_full;
64 65
65 void* m_smallData; 66 void* m_smallData;
66 size_t m_smallLength; 67 size_t m_smallLength;
67 }; 68 };
68 69
69 } // namespace blink 70 } // namespace blink
70 71
71 #endif // FlexibleArrayBufferView_h 72 #endif // FlexibleArrayBufferView_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698