src/wtf/trace/providers/webglprovider.js
function wrapLoseContextExtension(ctx, proto) {
    /**
     * @param {string} signature Event signature.
     * @param {Function=} opt_generator Generator function.
     */
    function wrapLoseContextMethod(signature, opt_generator) {
      wrapMethod(
          proto, 'WebGLLoseContext',
          signature, opt_generator);
    };

    // http://www.khronos.org/registry/webgl/extensions/WEBGL_lose_context/

    wrapLoseContextMethod(
        'loseContext()',
        function(fn, eventType) {
          return function loseContext() {
            setCurrentContext(ctx);
            var scope = eventType.apply(this, arguments);
            return leaveScope(scope, fn.apply(this, arguments));
          };
        });
    wrapLoseContextMethod(
        'restoreContext()',
        function(fn, eventType) {
          return function restoreContext() {
            setCurrentContext(ctx);
            var scope = eventType.apply(this, arguments);
            return leaveScope(scope, fn.apply(this, arguments));
          };
        });
  }
function wrapLoseContextExtension(ctx, proto) {
    /**
     * @param {string} signature Event signature.
     * @param {Function=} opt_generator Generator function.
     */
    function wrapLoseContextMethod(signature, opt_generator) {
      wrapMethod(
          proto, 'WebGLLoseContext',
          signature, opt_generator);
    };

    // http://www.khronos.org/registry/webgl/extensions/WEBGL_lose_context/

    wrapLoseContextMethod(
        'loseContext()',
        function(fn, eventType) {
          return function loseContext() {
            setCurrentContext(ctx);
            var scope = eventType.apply(this, arguments);
            return leaveScope(scope, fn.apply(this, arguments));
          };
        });
    wrapLoseContextMethod(
        'restoreContext()',
        function(fn, eventType) {
          return function restoreContext() {
            setCurrentContext(ctx);
            var scope = eventType.apply(this, arguments);
            return leaveScope(scope, fn.apply(this, arguments));
          };
        });
  }
function wrapLoseContextExtension ( ctx , proto ) { /**
     * @param {string} signature Event signature.
     * @param {Function=} opt_generator Generator function.
     */ function wrapLoseContextMethod ( signature , opt_generator ) { wrapMethod ( proto , 'WebGLLoseContext' , signature , opt_generator ) ; } ; // http://www.khronos.org/registry/webgl/extensions/WEBGL_lose_context/ wrapLoseContextMethod ( 'loseContext()' , function ( fn , eventType ) { return function loseContext ( ) { setCurrentContext ( ctx ) ; var scope = eventType . apply ( this , arguments ) ; return leaveScope ( scope , fn . apply ( this , arguments ) ) ; } ; } ) ; wrapLoseContextMethod ( 'restoreContext()' , function ( fn , eventType ) { return function restoreContext ( ) { setCurrentContext ( ctx ) ; var scope = eventType . apply ( this , arguments ) ; return leaveScope ( scope , fn . apply ( this , arguments ) ) ; } ; } ) ; }
Wraps the WebGLLoseContext extension object.
@param {!WebGLRenderingContext} ctx Target context.
@param {!Object} proto Prototype object.
Wraps the WebGLLoseContext extension object .