| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 22 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 #include "WebWorkerPermissionClientProxy.h" | 34 #include "WebWorkerPermissionClientProxy.h" |
| 35 | 35 |
| 36 namespace blink { | 36 namespace blink { |
| 37 | 37 |
| 38 class WebString; | 38 class WebString; |
| 39 class WebServiceWorkerContextProxy; | 39 class WebServiceWorkerContextProxy; |
| 40 | 40 |
| 41 // This interface is implemented by the client. It is suppoed to be created | 41 // This interface is implemented by the client. It is suppoed to be created |
| 42 // on the main thread and then passed on to the worker thread to be owned | 42 // on the main thread and then passed on to the worker thread to be owned |
| 43 // by a newly created WorkerGlobalScope. All methods of this class are | 43 // by a newly created WorkerGlobalScope. All methods of this class, except |
| 44 // called on the worker thread. | 44 // for workerContextFailedToStart(), are called on the worker thread. |
| 45 class WebServiceWorkerContextClient { | 45 class WebServiceWorkerContextClient { |
| 46 public: | 46 public: |
| 47 virtual ~WebServiceWorkerContextClient() { } |
| 48 |
| 47 // A new WorkerGlobalScope is created and started to run on the | 49 // A new WorkerGlobalScope is created and started to run on the |
| 48 // worker thread. | 50 // worker thread. |
| 49 // This also gives back a proxy to the client to talk to the | 51 // This also gives back a proxy to the client to talk to the |
| 50 // newly created WorkerGlobalScope. The proxy is held by WorkerGlobalScope | 52 // newly created WorkerGlobalScope. The proxy is held by WorkerGlobalScope |
| 51 // and should not be held by the caller. No proxy methods should be called | 53 // and should not be held by the caller. No proxy methods should be called |
| 52 // after workerContextDestroyed() is called. | 54 // after workerContextDestroyed() is called. |
| 53 virtual void workerContextStarted(WebServiceWorkerContextProxy*) { } | 55 virtual void workerContextStarted(WebServiceWorkerContextProxy*) { } |
| 54 | 56 |
| 55 // WorkerGlobalScope.close() is called. | |
| 56 virtual void workerContextClosed() { } | |
| 57 | |
| 58 // WorkerGlobalScope is destroyed. The client should clear the | 57 // WorkerGlobalScope is destroyed. The client should clear the |
| 59 // WebServiceWorkerGlobalScopeProxy when this is called. | 58 // WebServiceWorkerGlobalScopeProxy when this is called. |
| 60 virtual void workerContextDestroyed() { } | 59 virtual void workerContextDestroyed() { } |
| 61 | 60 |
| 61 // Starting worker context is failed. This could happen when loading |
| 62 // worker script fails, or is asked to terminated before the context starts. |
| 63 // This is called on the main thread. |
| 64 virtual void workerContextFailedToStart() { } |
| 65 |
| 62 virtual void dispatchDevToolsMessage(const WebString&) { } | 66 virtual void dispatchDevToolsMessage(const WebString&) { } |
| 63 virtual void saveDevToolsAgentState(const WebString&) { } | 67 virtual void saveDevToolsAgentState(const WebString&) { } |
| 64 }; | 68 }; |
| 65 | 69 |
| 66 } // namespace blink | 70 } // namespace blink |
| 67 | 71 |
| 68 #endif // WebWorkerContextClient_h | 72 #endif // WebWorkerContextClient_h |
| OLD | NEW |