~ubuntu-branches/ubuntu/jaunty/openjdk-6/jaunty-security

« back to all changes in this revision

Viewing changes to plugin/icedtea/sun/applet/PluginStreamHandler.java

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose, Edward Nevill, Matthias Klose
  • Date: 2009-03-02 16:18:01 UTC
  • Revision ID: james.westby@ubuntu.com-20090302161801-rubk3yhm8j0au4y1
Tags: 6b14-0ubuntu17
[ Edward Nevill ]
* Remove VFP from asm loop
* Disble the mauve testsuite for armel.

[Matthias Klose]
* Update IcedTea (20090302).

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
import java.util.Date;
53
53
import java.util.LinkedList;
54
54
 
 
55
import javax.swing.SwingUtilities;
 
56
 
55
57
 
56
58
public class PluginStreamHandler {
57
59
 
60
62
    private BufferedWriter pluginOutputWriter;
61
63
    
62
64
    private RequestQueue queue = new RequestQueue();
 
65
    
 
66
    private JavaConsole console = new JavaConsole();
63
67
 
64
68
        LinkedList<String> writeQueue = new LinkedList<String>();
65
69
 
362
366
        try {
363
367
                message = pluginInputReader.readLine();
364
368
                PluginDebug.debug("  PIPE: appletviewer read: " + message);
 
369
 
 
370
            if (message == null || message.equals("shutdown")) {
 
371
                synchronized(shuttingDown) {
 
372
                    shuttingDown = true;
 
373
                }
 
374
                try {
 
375
                    // Close input/output channels to plugin.
 
376
                    pluginInputReader.close();
 
377
                    pluginOutputWriter.close();
 
378
                } catch (IOException exception) {
 
379
                    // Deliberately ignore IOException caused by broken
 
380
                    // pipe since plugin may have already detached.
 
381
                }
 
382
                AppletSecurityContextManager.dumpStore(0);
 
383
                PluginDebug.debug("APPLETVIEWER: exiting appletviewer");
 
384
                System.exit(0);
 
385
            } else if (message.equals("showconsole")) {
 
386
                showConsole();
 
387
            } else if (message.equals("hideconsole")) {
 
388
                hideConsole();            
 
389
            }
365
390
        } catch (IOException e) {
366
 
 
367
 
                if (message == null || message.equals("shutdown")) {
368
 
                        synchronized(shuttingDown) {
369
 
                                shuttingDown = true;
370
 
                        }
371
 
                        try {
372
 
                                // Close input/output channels to plugin.
373
 
                                pluginInputReader.close();
374
 
                                pluginOutputWriter.close();
375
 
                        } catch (IOException exception) {
376
 
                                // Deliberately ignore IOException caused by broken
377
 
                                // pipe since plugin may have already detached.
378
 
                        }
379
 
                        AppletSecurityContextManager.dumpStore(0);
380
 
                        PluginDebug.debug("APPLETVIEWER: exiting appletviewer");
381
 
                        System.exit(0);
382
 
                }
 
391
               e.printStackTrace();
383
392
        }
384
393
 
385
394
        return message;
426
435
        */
427
436
 
428
437
    }
429
 
    
 
438
 
430
439
    public boolean messageAvailable() {
431
440
        return writeQueue.size() != 0;
432
441
    }
437
446
                return ret;
438
447
        }
439
448
    }
 
449
    
 
450
    private void showConsole() {
 
451
        SwingUtilities.invokeLater(new Runnable() {
 
452
            public void run() {
 
453
                console.showConsole();
 
454
            }
 
455
        });
 
456
    }
 
457
    
 
458
    private void hideConsole() {
 
459
        SwingUtilities.invokeLater(new Runnable() {
 
460
            public void run() {
 
461
                console.hideConsole();
 
462
            }
 
463
        });
 
464
    }
440
465
}