/*this method and releaseTailFrame() won't be called concurrently,
so non-atomic on volatile is safe
499975
void saveFrame(ByteBuf frame) {
    if (upstreamFrameRefCnt == 0) {
      upstreamFrameRefCnt = frame.refCnt();
    }

    int frameSize = frame.readableBytes();
    long availableSize = cacheLimit - cacheSize;
    while (availableSize < frameSize) {
      ByteBuf cachedFrame = cachedFrames.poll();
      if (cachedFrame != null) {
        availableSize += releaseTailFrame(cachedFrame);
      } else {
        break;
      }
    }
    if (availableSize >= frameSize) {
      cachedFrames.offer(frame.retain());
      cacheSize += frameSize;
    } else {
      position += frameSize;
    }
  }
181934
@Override
    public void enterInterrupt(Dim.StackFrame lastFrame,
                               String threadTitle,
                               String alertMessage) {
        if (SwingUtilities.isEventDispatchThread()) {
            enterInterruptImpl(lastFrame, threadTitle, alertMessage);
        } else {
            RunProxy proxy = new RunProxy(this, RunProxy.ENTER_INTERRUPT);
            proxy.lastFrame = lastFrame;
            proxy.threadTitle = threadTitle;
            proxy.alertMessage = alertMessage;
            SwingUtilities.invokeLater(proxy);
        }
    }
690643
protected void synchronizeOutlinePage(INode element) {
		// TODO: don't search for mutexes
		if (element instanceof AMutexSyncDefinition)
			return;
		if (element instanceof ABlockSimpleBlockStm)
			return;

		try {
			synchronizeOutlinePage(element, false);// true
		} catch (Exception e) {

		}
	}
795835
public static void releaseDataFrame(Http2SourceHandler http2SourceHandler, Http2DataFrame dataFrame) {
        int streamId = dataFrame.getStreamId();
        HttpCarbonMessage sourceReqCMsg = http2SourceHandler.getStreamIdRequestMap().get(streamId);
        if (sourceReqCMsg != null) {
            sourceReqCMsg.addHttpContent(new DefaultLastHttpContent());
            http2SourceHandler.getStreamIdRequestMap().remove(streamId);
        }
        dataFrame.getData().release();
    }
1176640
@Override
    public ChannelFuture close(Channel channel, CloseWebSocketFrame frame, ChannelPromise promise) {
        return channel.writeAndFlush(frame, promise);
    }
668317
@Override
    public void release() throws IOException
    {
        if (includeLevel.in != null && end != cursor)
        {
            if (end % size < cursor % size)
            {
                buffer2.position(0);
                buffer2.limit((int)(end % size));
                buffer1.position((int)(cursor % size));
                buffer1.limit(size);
            }
            else
            {
                buffer2.position((int)(cursor % size));
                buffer2.limit((int)(end % size));
                buffer1.position(size);
            }
            if (features.contains(UsePushback))
            {
                if (includeLevel.in instanceof Pushbackable)
                {
                    Pushbackable p = (Pushbackable) includeLevel.in;
                    p.pushback(array2);
                }
                else
                {
                    unread(includeLevel.in);
                }
            }
            else
            {
                if (includeLevel.in instanceof Rewindable)
                {
                    Rewindable rewindable = (Rewindable) includeLevel.in;
                    rewindable.rewind((int)(end-cursor));
                }
                else
                {
                    unread(includeLevel.in);
                }
            }
            buffer1.clear();
            buffer2.clear();
            end = cursor;
        }
    }
1311629
public synchronized void release() {
        Enumeration ptdE=threadData.keys();
        while( ptdE.hasMoreElements() ) {
            PerThreadData ptd=(PerThreadData)ptdE.nextElement();
            for (int i=ptd.current; i>=0; i--) {
                if( ptd.handlers != null && ptd.handlers[i]!=null )
                    ptd.handlers[i].release();
            }
        }
    }
697960
public Component release ()
    {
        _comp.removeMouseMotionListener(_motionCatcher);

        for (int ii=0; ii < _mls.length; ii++) {
            _comp.addMouseListener(_mls[ii]);
        }
        _mls = null;

        for (int ii=0; ii < _mmls.length; ii++) {
            // fake the last movement
            if (_lastMotion != null) {
                _mmls[ii].mouseMoved(_lastMotion);
            }
            _comp.addMouseMotionListener(_mmls[ii]);
        }
        _mmls = null;

        return _comp;
    }
513237
@Override
    public void visitFrame(int type, int numLocals, Object[] locals, int stackSize, Object[] stack) {
        if (!isVisitFrameRequired())
            return;

        super.visitFrame(type, numLocals, locals, stackSize, stack);
    }
48251
@Override
    public void doFrame(long timestampNanoseconds) {
        long frameIntervalNanoseconds = timestampNanoseconds - lastTimestampNanoseconds;

        // To detect a dropped frame, we need to know the interval between two frame callbacks.
        // If this is the first, wait for the second.
        if (lastTimestampNanoseconds != NEVER) {
            // With no dropped frames, frame intervals will roughly equal the hardware interval.
            // 2x the hardware interval means we definitely dropped one frame.
            // So our measuring stick is 1.5x.
            double droppedFrameIntervalSeconds = hardwareFrameIntervalSeconds * 1.5;

            double frameIntervalSeconds = frameIntervalNanoseconds / 1_000_000_000.0;

            if (droppedFrameIntervalSeconds < frameIntervalSeconds) {
                playTickSound();

                if (areHapticsEnabled) {
                    playTickHaptics();
                }
            }
        }

        lastTimestampNanoseconds = timestampNanoseconds;
        Choreographer.getInstance().postFrameCallback(this);
    }
232334
public synchronized void nextFrame() {
        currentFrame++;
        if(currentFrame >= frames.size()) {
            currentFrame = 0;
        }
        super.setLines(frames.get(currentFrame));
        invalidate();
    }
452299
protected void release() {
        Log.d(TAG, "release");
        releaseObjects();

        if (this.mediaPlayer != null) {
            this.mediaPlayer.setOnBufferingUpdateListener(null);
            this.mediaPlayer.setOnPreparedListener(null);
            this.mediaPlayer.setOnErrorListener(null);
            this.mediaPlayer.setOnSeekCompleteListener(null);
            this.mediaPlayer.setOnCompletionListener(null);
            this.mediaPlayer.setOnInfoListener(null);
            this.mediaPlayer.setOnVideoSizeChangedListener(null);
            this.mediaPlayer.release();
            this.mediaPlayer = null;
        }

        this.currentState = State.END;
    }
1145836
@Override
	public synchronized boolean fireEventAndWait(Eventable eventable)
			throws ElementNotVisibleException, NoSuchElementException, InterruptedException {
		try {

			boolean handleChanged = false;
			boolean result = false;

			if (eventable.getRelatedFrame() != null && !eventable.getRelatedFrame().equals("")) {
				LOGGER.debug("switching to frame: " + eventable.getRelatedFrame());
				try {

					switchToFrame(eventable.getRelatedFrame());
				} catch (NoSuchFrameException e) {
					LOGGER.debug("Frame not found, possibly while back-tracking..", e);
					// TODO Stefan, This exception is caught to prevent stopping
					// from working
					// This was the case on the Gmail case; find out if not switching
					// (catching)
					// Results in good performance...
				}
				handleChanged = true;
			}

			WebElement webElement =
					browser.findElement(eventable.getIdentification().getWebDriverBy());

			if (webElement != null) {
				result = fireEventWait(webElement, eventable);
			}

			if (handleChanged) {
				browser.switchTo().defaultContent();
			}
			return result;
		} catch (ElementNotVisibleException | NoSuchElementException e) {
			throw e;
		} catch (WebDriverException e) {
			throwIfConnectionException(e);
			return false;
		}
	}
1193442
function oncePerAnimationFrame(fn) {
  let animationId = null;
  let argsToPass = null;
  return function(...args) {
    argsToPass = args;
    if (animationId !== null) {
      return;
    }

    animationId = requestAnimationFrame(() => {
      fn.call(this, ...argsToPass);
      animationId = null;
      argsToPass = null;
    });
  };
}
1309958
function() {
    var maxWait, swfProtocol, previousState = _flashState.sandboxed;
    if (!_isBrowserSupported()) {
      _flashState.ready = false;
      ZeroClipboard.emit({
        type: "error",
        name: "browser-unsupported"
      });
      return;
    }
    _detectSandbox();
    if (typeof _flashState.ready !== "boolean") {
      _flashState.ready = false;
    }
    if (_flashState.sandboxed !== previousState && _flashState.sandboxed === true) {
      _flashState.ready = false;
      ZeroClipboard.emit({
        type: "error",
        name: "flash-sandboxed"
      });
    } else if (!ZeroClipboard.isFlashUnusable() && _flashState.bridge === null) {
      swfProtocol = _getSwfPathProtocol();
      if (swfProtocol && swfProtocol !== _window.location.protocol) {
        ZeroClipboard.emit({
          type: "error",
          name: "flash-insecure"
        });
      } else {
        maxWait = _globalConfig.flashLoadTimeout;
        if (typeof maxWait === "number" && maxWait >= 0) {
          _flashCheckTimeout = _setTimeout(function() {
            if (typeof _flashState.deactivated !== "boolean") {
              _flashState.deactivated = true;
            }
            if (_flashState.deactivated === true) {
              ZeroClipboard.emit({
                type: "error",
                name: "flash-deactivated"
              });
            }
          }, maxWait);
        }
        _flashState.overdue = false;
        _embedSwf();
      }
    }
  }
634836
@Override
    public void free() {
        try {
        if(hasCoreConnection()) {
            this.getCoreConnection().close();
        }
        this.fireConnectionFreed();
        this.boundThreadId= Thread.currentThread().getId();

    } finally {
        this.setClosed(true);
        // state may be important for State-Listener, so its set after the listener did their work
        setTransactionalData(false);

        // re-opem is not possible
        // this.connection=null;
        this.releaseThreadBinding();
    }

    }
92343
function(){
					if(_isActive) return;

					_hash = _getWindowHash();

					//thought about branching/overloading hasher.init() to avoid checking multiple times but
					//don't think worth doing it since it probably won't be called multiple times.
					if(_isHashChangeSupported){
						_addListener(window, 'hashchange', _checkHistory);
					}else {
						if(_isLegacyIE){
							if(! _frame){
								_createFrame();
							}
							_updateFrame();
						}
						_checkInterval = setInterval(_checkHistory, POOL_INTERVAL);
					}

					_isActive = true;
					hasher.initialized.dispatch(_trimHash(_hash));
				}