view plugin/icedtea/sun/applet/RequestQueue.java @ 1066:358cb21c4730

More refactoring -- the last big one in the forseeable future. Implemented proper sandbox for liveconnect calls. Added error detection in the plugin, so it doesn't loop forever if Java side encounters an error.
author Deepak Bhole <dbhole@redhat.com>
date Wed, 01 Oct 2008 16:40:56 -0400
parents
children
line wrap: on
line source

package sun.applet;


public class RequestQueue {
    PluginCallRequest head = null;
    PluginCallRequest tail = null;
    private int size = 0;

    public void post(PluginCallRequest request) {
    	System.err.println("Securitymanager=" + System.getSecurityManager());
        if (head == null) {
            head = tail = request;
            tail.setNext(null);
        } else {
            tail.setNext(request);
            tail = request;
            tail.setNext(null);
        }
        
        size++;
    }

    public PluginCallRequest pop() {
        if (head == null)
            return null;

        PluginCallRequest ret = head;
        head = head.getNext();
        ret.setNext(null);

        size--;
        
        return ret;
    }
    
    public int size() {
    	return size;
    }
}