Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 54 virtual ~WebSharedWorker() {}; | 54 virtual ~WebSharedWorker() {}; |
| 55 | 55 |
| 56 // Returns false if the thread hasn't been started yet (script loading has not taken place). | 56 // Returns false if the thread hasn't been started yet (script loading has not taken place). |
| 57 // FIXME(atwilson): Remove this when we move the initial script loading into the worker process. | 57 // FIXME(atwilson): Remove this when we move the initial script loading into the worker process. |
| 58 virtual bool isStarted() = 0; | 58 virtual bool isStarted() = 0; |
| 59 | 59 |
| 60 virtual void startWorkerContext(const WebURL& scriptURL, | 60 virtual void startWorkerContext(const WebURL& scriptURL, |
| 61 const WebString& name, | 61 const WebString& name, |
| 62 const WebString& userAgent, | 62 const WebString& userAgent, |
| 63 const WebString& sourceCode) = 0; | 63 const WebString& sourceCode) = 0; |
| 64 class ConnectListener { | |
| 65 public: | |
|
jam
2009/11/09 02:53:03
nit: the spacing here should conform to WebKit sty
| |
| 66 // Invoked once the connect event has been sent so the caller can free this object. | |
| 67 virtual void connected() = 0; | |
| 68 }; | |
| 64 | 69 |
| 65 // Sends a connect event to the SharedWorker context. | 70 // Sends a connect event to the SharedWorker context. The listener is invoked when this async operation completes. |
| 66 virtual void connect(WebMessagePortChannel*) = 0; | 71 virtual void connect(WebMessagePortChannel*, ConnectListener*) = 0; |
| 67 | 72 |
| 68 // Invoked to shutdown the worker when there are no more associated documents. | 73 // Invoked to shutdown the worker when there are no more associated documents. |
| 69 virtual void terminateWorkerContext() = 0; | 74 virtual void terminateWorkerContext() = 0; |
| 70 | 75 |
| 71 // Notification when the WebCommonWorkerClient is destroyed. | 76 // Notification when the WebCommonWorkerClient is destroyed. |
| 72 virtual void clientDestroyed() = 0; | 77 virtual void clientDestroyed() = 0; |
| 73 }; | 78 }; |
| 74 | 79 |
| 75 } // namespace WebKit | 80 } // namespace WebKit |
| 76 | 81 |
| 77 #endif | 82 #endif |
| OLD | NEW |