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

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: Reintroduced persistent caches. 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
(...skipping 13 matching lines...) Expand all
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" 30 #include "bindings/core/v8/ScopedPersistent.h"
31 #include "bindings/core/v8/ScriptState.h" 31 #include "bindings/core/v8/ScriptState.h"
32 #include "bindings/core/v8/ScriptValue.h" 32 #include "bindings/core/v8/ScriptValue.h"
33 #include "bindings/core/v8/ScriptWrappable.h" 33 #include "bindings/core/v8/ScriptWrappable.h"
34 #include "bindings/core/v8/V8PrivateProperty.h"
34 #include "core/CoreExport.h" 35 #include "core/CoreExport.h"
35 #include "core/dom/DOMTypedArray.h" 36 #include "core/dom/DOMTypedArray.h"
36 #include "core/dom/TypedFlexibleArrayBufferView.h" 37 #include "core/dom/TypedFlexibleArrayBufferView.h"
37 #include "core/html/canvas/CanvasRenderingContext.h" 38 #include "core/html/canvas/CanvasRenderingContext.h"
38 #include "core/layout/ContentChangeType.h" 39 #include "core/layout/ContentChangeType.h"
39 #include "modules/webgl/WebGLContextAttributes.h" 40 #include "modules/webgl/WebGLContextAttributes.h"
40 #include "modules/webgl/WebGLExtensionName.h" 41 #include "modules/webgl/WebGLExtensionName.h"
41 #include "modules/webgl/WebGLTexture.h" 42 #include "modules/webgl/WebGLTexture.h"
42 #include "modules/webgl/WebGLVertexArrayObjectBase.h" 43 #include "modules/webgl/WebGLVertexArrayObjectBase.h"
43 #include "platform/Timer.h" 44 #include "platform/Timer.h"
(...skipping 985 matching lines...) Expand 10 before | Expand all | Expand 10 after
1029 void setBackDrawBuffer(GLenum); 1030 void setBackDrawBuffer(GLenum);
1030 void setFramebuffer(GLenum, WebGLFramebuffer*); 1031 void setFramebuffer(GLenum, WebGLFramebuffer*);
1031 1032
1032 virtual void restoreCurrentFramebuffer(); 1033 virtual void restoreCurrentFramebuffer();
1033 void restoreCurrentTexture2D(); 1034 void restoreCurrentTexture2D();
1034 1035
1035 void findNewMaxNonDefaultTextureUnit(); 1036 void findNewMaxNonDefaultTextureUnit();
1036 1037
1037 virtual void renderbufferStorageImpl(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, const char* functionName); 1038 virtual void renderbufferStorageImpl(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, const char* functionName);
1038 1039
1039 // Ensures that the JavaScript wrappers for objects that are 1040 // For optimization purposes when in the main world.
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; 1041 ScopedPersistent<v8::Array> m_2DTextureWrappers;
1044 ScopedPersistent<v8::Array> m_2DArrayTextureWrappers; 1042 ScopedPersistent<v8::Array> m_2DArrayTextureWrappers;
1045 ScopedPersistent<v8::Array> m_3DTextureWrappers; 1043 ScopedPersistent<v8::Array> m_3DTextureWrappers;
1046 ScopedPersistent<v8::Array> m_cubeMapTextureWrappers; 1044 ScopedPersistent<v8::Array> m_cubeMapTextureWrappers;
1047 ScopedPersistent<v8::Array> m_extensionWrappers; 1045 ScopedPersistent<v8::Array> m_extensionWrappers;
1048 1046
1049 // The "catch-all" array for the rest of the preserved object 1047 // The "catch-all" array for the rest of the preserved object
1050 // wrappers. The enum below defines how the indices in this array 1048 // wrappers. The enum below defines how the indices in this array
1051 // are used. 1049 // are used.
1052 enum PreservedWrapperIndex { 1050 enum PreservedWrapperIndex {
1053 PreservedArrayBuffer, 1051 PreservedArrayBuffer,
1054 PreservedElementArrayBuffer, 1052 PreservedElementArrayBuffer,
1055 PreservedFramebuffer, 1053 PreservedFramebuffer,
1056 PreservedProgram, 1054 PreservedProgram,
1057 PreservedRenderbuffer, 1055 PreservedRenderbuffer,
1058 PreservedDefaultVAO, 1056 PreservedDefaultVAO,
1059 PreservedVAO, 1057 PreservedVAO,
1060 PreservedTransformFeedback, 1058 PreservedTransformFeedback,
1061 }; 1059 };
1062 ScopedPersistent<v8::Array> m_miscWrappers; 1060 ScopedPersistent<v8::Array> m_miscWrappers;
1063 1061
1064 static void preserveObjectWrapper(ScriptState*, ScriptWrappable* sourceObjec t, v8::Local<v8::String> hiddenValueName, ScopedPersistent<v8::Array>* persisten tCache, uint32_t index, ScriptWrappable* targetObject); 1062 static void preserveObjectWrapper(ScriptState*, ScriptWrappable* sourceObjec t, const V8PrivateProperty::Symbol& privateSymbol, ScopedPersistent<v8::Array>* persistentCache, uint32_t index, ScriptWrappable* targetObject);
1065 1063
1066 // Called to lazily instantiate the wrapper for the default VAO 1064 // Called to lazily instantiate the wrapper for the default VAO
1067 // during calls to bindBuffer and vertexAttribPointer (from 1065 // during calls to bindBuffer and vertexAttribPointer (from
1068 // JavaScript). 1066 // JavaScript).
1069 void maybePreserveDefaultVAOObjectWrapper(ScriptState*); 1067 void maybePreserveDefaultVAOObjectWrapper(ScriptState*);
1070 1068
1071 virtual bool transformFeedbackActive() const { return false; } 1069 virtual bool transformFeedbackActive() const { return false; }
1072 virtual bool transformFeedbackPaused() const { return false; } 1070 virtual bool transformFeedbackPaused() const { return false; }
1073 1071
1074 friend class WebGLStateRestorer; 1072 friend class WebGLStateRestorer;
(...skipping 18 matching lines...) Expand all
1093 static PassOwnPtr<WebGraphicsContext3DProvider> createContextProviderInterna l(HTMLCanvasElement*, ScriptState*, WebGLContextAttributes, unsigned); 1091 static PassOwnPtr<WebGraphicsContext3DProvider> createContextProviderInterna l(HTMLCanvasElement*, ScriptState*, WebGLContextAttributes, unsigned);
1094 }; 1092 };
1095 1093
1096 DEFINE_TYPE_CASTS(WebGLRenderingContextBase, CanvasRenderingContext, context, co ntext->is3d(), context.is3d()); 1094 DEFINE_TYPE_CASTS(WebGLRenderingContextBase, CanvasRenderingContext, context, co ntext->is3d(), context.is3d());
1097 1095
1098 } // namespace blink 1096 } // namespace blink
1099 1097
1100 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(blink::WebGLRenderingContextB ase::TextureUnitState); 1098 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(blink::WebGLRenderingContextB ase::TextureUnitState);
1101 1099
1102 #endif // WebGLRenderingContextBase_h 1100 #endif // WebGLRenderingContextBase_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698