Changeset 127426 in webkit
- Timestamp:
- Sep 3, 2012 9:09:54 AM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r127425 r127426 1 2012-09-03 Andrey Adaikin <aandrey@chromium.org> 2 3 Web Inspector: [WebGL] Make the injected __resourceObject property non-enumerable 4 https://bugs.webkit.org/show_bug.cgi?id=95682 5 6 Reviewed by Pavel Feldman. 7 8 Make the injected auxiliary property __resourceObject non-enumerable to hide it from for..in iterations. 9 Ideally this property should be completely hidden from the user's code. 10 Drive-by: Fix couple of small FIXME's. 11 12 * inspector/InjectedScriptWebGLModuleSource.js: 13 (.): 14 1 15 2012-09-03 Tommy Widenflycht <tommyw@google.com> 2 16 -
trunk/Source/WebCore/inspector/InjectedScriptWebGLModuleSource.js
r127243 r127426 650 650 651 651 /** 652 * @param { Object} object652 * @param {!Object} object 653 653 */ 654 654 _bindObjectToResource: function(object) 655 655 { 656 object["__resourceObject"] = this; 656 Object.defineProperty(object, "__resourceObject", { 657 value: this, 658 writable: false, 659 enumerable: false, 660 configurable: true 661 }); 657 662 } 658 663 } … … 1439 1444 set: function(value) 1440 1445 { 1446 console.error("ASSERT_NOT_REACHED: We assume all WebGLRenderingContext attributes are readonly. Trying to mutate " + property); 1441 1447 gl[property] = value; 1442 1448 } … … 1448 1454 processProperty(property); 1449 1455 1456 this._bindObjectToResource(proxy); 1450 1457 return proxy; 1451 1458 }, … … 1859 1866 wrapWebGLContext: function(glContext) 1860 1867 { 1861 var resource = Resource.forObject(glContext) || new WebGLRenderingContextResource(glContext, this._construct ReplayContext.bind(this, glContext));1868 var resource = Resource.forObject(glContext) || new WebGLRenderingContextResource(glContext, this._constructWebGLReplayContext.bind(this, glContext)); 1862 1869 this._manager.registerResource(resource); 1863 1870 var proxy = resource.proxyObject(); … … 1952 1959 * @return {WebGLRenderingContext} 1953 1960 */ 1954 _construct ReplayContext: function(originalGlContext)1961 _constructWebGLReplayContext: function(originalGlContext) 1955 1962 { 1956 1963 var replayContext = originalGlContext["__replayContext"]; 1957 1964 if (!replayContext) { 1958 1965 var canvas = originalGlContext.canvas.cloneNode(true); 1959 // FIXME: Pass original context id instead of "experimental-webgl". 1960 // FIXME: Pass original ContextAttributes to the getContext() method. 1961 replayContext = /** @type {WebGLRenderingContext} */ Resource.wrappedObject(canvas.getContext("experimental-webgl")); 1962 originalGlContext["__replayContext"] = replayContext; 1966 var attributes = originalGlContext.getContextAttributes(); 1967 var contextIds = ["experimental-webgl", "webkit-3d", "3d"]; 1968 for (var i = 0, contextId; contextId = contextIds[i]; ++i) { 1969 replayContext = canvas.getContext(contextId, attributes); 1970 if (replayContext) { 1971 replayContext = /** @type {WebGLRenderingContext} */ Resource.wrappedObject(replayContext); 1972 break; 1973 } 1974 } 1975 Object.defineProperty(originalGlContext, "__replayContext", { 1976 value: replayContext, 1977 writable: false, 1978 enumerable: false, 1979 configurable: true 1980 }); 1963 1981 this._replayContext = replayContext; 1964 1982 } else {
Note: See TracChangeset
for help on using the changeset viewer.