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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/V8Binding.h

Issue 2815793002: [SharedArrayBuffer] Add "AllowShared" extended attribute, used for WebGL (Closed)
Patch Set: Created 3 years, 8 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 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * Copyright (C) 2012 Ericsson AB. All rights reserved. 3 * Copyright (C) 2012 Ericsson AB. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 29 matching lines...) Expand all
40 #include "bindings/core/v8/ScriptState.h" 40 #include "bindings/core/v8/ScriptState.h"
41 #include "bindings/core/v8/ScriptValue.h" 41 #include "bindings/core/v8/ScriptValue.h"
42 #include "bindings/core/v8/ScriptWrappable.h" 42 #include "bindings/core/v8/ScriptWrappable.h"
43 #include "bindings/core/v8/V8BindingMacros.h" 43 #include "bindings/core/v8/V8BindingMacros.h"
44 #include "bindings/core/v8/V8PerIsolateData.h" 44 #include "bindings/core/v8/V8PerIsolateData.h"
45 #include "bindings/core/v8/V8ScriptRunner.h" 45 #include "bindings/core/v8/V8ScriptRunner.h"
46 #include "bindings/core/v8/V8StringResource.h" 46 #include "bindings/core/v8/V8StringResource.h"
47 #include "bindings/core/v8/V8ThrowException.h" 47 #include "bindings/core/v8/V8ThrowException.h"
48 #include "bindings/core/v8/V8ValueCache.h" 48 #include "bindings/core/v8/V8ValueCache.h"
49 #include "core/CoreExport.h" 49 #include "core/CoreExport.h"
50 #include "core/dom/MaybeShared.h"
50 #include "core/dom/NotShared.h" 51 #include "core/dom/NotShared.h"
51 #include "platform/heap/Handle.h" 52 #include "platform/heap/Handle.h"
52 #include "platform/wtf/text/AtomicString.h" 53 #include "platform/wtf/text/AtomicString.h"
53 #include "platform/wtf/text/StringView.h" 54 #include "platform/wtf/text/StringView.h"
54 #include "v8/include/v8.h" 55 #include "v8/include/v8.h"
55 56
56 namespace blink { 57 namespace blink {
57 58
58 class DOMWindow; 59 class DOMWindow;
59 class EventListener; 60 class EventListener;
(...skipping 1129 matching lines...) Expand 10 before | Expand all | Expand 10 after
1189 DOMTypedArray* dom_typed_array = 1190 DOMTypedArray* dom_typed_array =
1190 V8TypeOf<DOMTypedArray>::Type::toImplWithTypeCheck(isolate, value); 1191 V8TypeOf<DOMTypedArray>::Type::toImplWithTypeCheck(isolate, value);
1191 if (dom_typed_array && dom_typed_array->IsShared()) { 1192 if (dom_typed_array && dom_typed_array->IsShared()) {
1192 exception_state.ThrowTypeError( 1193 exception_state.ThrowTypeError(
1193 "The provided ArrayBufferView value must not be shared."); 1194 "The provided ArrayBufferView value must not be shared.");
1194 return NotSharedType(); 1195 return NotSharedType();
1195 } 1196 }
1196 return NotSharedType(dom_typed_array); 1197 return NotSharedType(dom_typed_array);
1197 } 1198 }
1198 1199
1200 // Wrap a typed array value in MaybeShared<>, to signify that it may be backed
1201 // by a SharedArrayBuffer.
1202 template <typename MaybeSharedType>
1203 MaybeSharedType ToMaybeShared(v8::Isolate* isolate,
1204 v8::Local<v8::Value> value,
1205 ExceptionState& exception_state) {
1206 using DOMTypedArray = typename MaybeSharedType::TypedArrayType;
1207 DOMTypedArray* dom_typed_array =
1208 V8TypeOf<DOMTypedArray>::Type::toImplWithTypeCheck(isolate, value);
1209 return MaybeSharedType(dom_typed_array);
1210 }
1211
1199 } // namespace blink 1212 } // namespace blink
1200 1213
1201 #endif // V8Binding_h 1214 #endif // V8Binding_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698