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

Side by Side Diff: third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h

Issue 2023603003: Fix content scripts that use WebGL. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@yukishiino-v8privateproperty-fix
Patch Set: Rebased. Created 4 years, 6 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 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution. 11 * documentation and/or other materials provided with the distribution.
12 * 12 *
13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */ 24 */
25 25
26 #ifndef WebGLRenderingContextBase_h 26 #ifndef WebGLRenderingContextBase_h
27 #define WebGLRenderingContextBase_h 27 #define WebGLRenderingContextBase_h
28 28
29 #include "bindings/core/v8/Nullable.h" 29 #include "bindings/core/v8/Nullable.h"
30 #include "bindings/core/v8/ScopedPersistent.h"
31 #include "bindings/core/v8/ScriptState.h" 30 #include "bindings/core/v8/ScriptState.h"
32 #include "bindings/core/v8/ScriptValue.h" 31 #include "bindings/core/v8/ScriptValue.h"
33 #include "bindings/core/v8/ScriptWrappable.h" 32 #include "bindings/core/v8/ScriptWrappable.h"
33 #include "bindings/core/v8/V8PrivateProperty.h"
34 #include "core/CoreExport.h" 34 #include "core/CoreExport.h"
35 #include "core/dom/DOMTypedArray.h" 35 #include "core/dom/DOMTypedArray.h"
36 #include "core/dom/TypedFlexibleArrayBufferView.h" 36 #include "core/dom/TypedFlexibleArrayBufferView.h"
37 #include "core/html/canvas/CanvasRenderingContext.h" 37 #include "core/html/canvas/CanvasRenderingContext.h"
38 #include "core/layout/ContentChangeType.h" 38 #include "core/layout/ContentChangeType.h"
39 #include "modules/webgl/WebGLContextAttributes.h" 39 #include "modules/webgl/WebGLContextAttributes.h"
40 #include "modules/webgl/WebGLExtensionName.h" 40 #include "modules/webgl/WebGLExtensionName.h"
41 #include "modules/webgl/WebGLTexture.h" 41 #include "modules/webgl/WebGLTexture.h"
42 #include "modules/webgl/WebGLVertexArrayObjectBase.h" 42 #include "modules/webgl/WebGLVertexArrayObjectBase.h"
43 #include "platform/Timer.h" 43 #include "platform/Timer.h"
(...skipping 985 matching lines...) Expand 10 before | Expand all | Expand 10 after
1029 void setBackDrawBuffer(GLenum); 1029 void setBackDrawBuffer(GLenum);
1030 void setFramebuffer(GLenum, WebGLFramebuffer*); 1030 void setFramebuffer(GLenum, WebGLFramebuffer*);
1031 1031
1032 virtual void restoreCurrentFramebuffer(); 1032 virtual void restoreCurrentFramebuffer();
1033 void restoreCurrentTexture2D(); 1033 void restoreCurrentTexture2D();
1034 1034
1035 void findNewMaxNonDefaultTextureUnit(); 1035 void findNewMaxNonDefaultTextureUnit();
1036 1036
1037 virtual void renderbufferStorageImpl(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, const char* functionName); 1037 virtual void renderbufferStorageImpl(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, const char* functionName);
1038 1038
1039 // Ensures that the JavaScript wrappers for objects that are
1040 // latched into the context's state, or which are implicitly
1041 // linked together (like programs and their attached shaders), are
1042 // not garbage collected before they should be.
1043 ScopedPersistent<v8::Array> m_2DTextureWrappers;
1044 ScopedPersistent<v8::Array> m_2DArrayTextureWrappers;
1045 ScopedPersistent<v8::Array> m_3DTextureWrappers;
1046 ScopedPersistent<v8::Array> m_cubeMapTextureWrappers;
1047 ScopedPersistent<v8::Array> m_extensionWrappers;
1048
1049 // The "catch-all" array for the rest of the preserved object 1039 // The "catch-all" array for the rest of the preserved object
1050 // wrappers. The enum below defines how the indices in this array 1040 // wrappers. The enum below defines how the indices in this array
1051 // are used. 1041 // are used.
1052 enum PreservedWrapperIndex { 1042 enum PreservedWrapperIndex {
1053 PreservedArrayBuffer, 1043 PreservedArrayBuffer,
1054 PreservedElementArrayBuffer, 1044 PreservedElementArrayBuffer,
1055 PreservedFramebuffer, 1045 PreservedFramebuffer,
1056 PreservedProgram, 1046 PreservedProgram,
1057 PreservedRenderbuffer, 1047 PreservedRenderbuffer,
1058 PreservedDefaultVAO, 1048 PreservedDefaultVAO,
1059 PreservedVAO, 1049 PreservedVAO,
1060 PreservedTransformFeedback, 1050 PreservedTransformFeedback,
1061 }; 1051 };
1062 ScopedPersistent<v8::Array> m_miscWrappers;
1063 1052
1064 static void preserveObjectWrapper(ScriptState*, ScriptWrappable* sourceObjec t, v8::Local<v8::String> hiddenValueName, ScopedPersistent<v8::Array>* persisten tCache, uint32_t index, ScriptWrappable* targetObject); 1053 static void preserveObjectWrapper(ScriptState*, ScriptWrappable* sourceObjec t, const V8PrivateProperty::Symbol& privateSymbol, uint32_t index, ScriptWrappab le* targetObject);
1065 1054
1066 // Called to lazily instantiate the wrapper for the default VAO 1055 // Called to lazily instantiate the wrapper for the default VAO
1067 // during calls to bindBuffer and vertexAttribPointer (from 1056 // during calls to bindBuffer and vertexAttribPointer (from
1068 // JavaScript). 1057 // JavaScript).
1069 void maybePreserveDefaultVAOObjectWrapper(ScriptState*); 1058 void maybePreserveDefaultVAOObjectWrapper(ScriptState*);
1070 1059
1071 virtual bool transformFeedbackActive() const { return false; } 1060 virtual bool transformFeedbackActive() const { return false; }
1072 virtual bool transformFeedbackPaused() const { return false; } 1061 virtual bool transformFeedbackPaused() const { return false; }
1073 1062
1074 friend class WebGLStateRestorer; 1063 friend class WebGLStateRestorer;
(...skipping 18 matching lines...) Expand all
1093 static PassOwnPtr<WebGraphicsContext3DProvider> createContextProviderInterna l(HTMLCanvasElement*, ScriptState*, WebGLContextAttributes, unsigned); 1082 static PassOwnPtr<WebGraphicsContext3DProvider> createContextProviderInterna l(HTMLCanvasElement*, ScriptState*, WebGLContextAttributes, unsigned);
1094 }; 1083 };
1095 1084
1096 DEFINE_TYPE_CASTS(WebGLRenderingContextBase, CanvasRenderingContext, context, co ntext->is3d(), context.is3d()); 1085 DEFINE_TYPE_CASTS(WebGLRenderingContextBase, CanvasRenderingContext, context, co ntext->is3d(), context.is3d());
1097 1086
1098 } // namespace blink 1087 } // namespace blink
1099 1088
1100 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(blink::WebGLRenderingContextB ase::TextureUnitState); 1089 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(blink::WebGLRenderingContextB ase::TextureUnitState);
1101 1090
1102 #endif // WebGLRenderingContextBase_h 1091 #endif // WebGLRenderingContextBase_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698