| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 // This class is created and destructed on the main thread, but live most | 52 // This class is created and destructed on the main thread, but live most |
| 53 // of its time as a resident of the worker thread. | 53 // of its time as a resident of the worker thread. |
| 54 // All methods other than its ctor/dtor are called on the worker thread. | 54 // All methods other than its ctor/dtor are called on the worker thread. |
| 55 // | 55 // |
| 56 // This implements WebServiceWorkerContextProxy, which connects ServiceWorker's | 56 // This implements WebServiceWorkerContextProxy, which connects ServiceWorker's |
| 57 // WorkerGlobalScope and embedder/chrome, and implements ServiceWorker-specific | 57 // WorkerGlobalScope and embedder/chrome, and implements ServiceWorker-specific |
| 58 // events/upcall methods that are to be called by embedder/chromium, | 58 // events/upcall methods that are to be called by embedder/chromium, |
| 59 // e.g. onfetch. | 59 // e.g. onfetch. |
| 60 // | 60 // |
| 61 // An instance of this class is supposed to outlive until | 61 // An instance of this class is supposed to outlive until |
| 62 // workerThreadTerminated() is called by its corresponding | 62 // workerScriptTerminated() is called by its corresponding |
| 63 // WorkerGlobalScope. | 63 // WorkerGlobalScope. |
| 64 class ServiceWorkerGlobalScopeProxy final | 64 class ServiceWorkerGlobalScopeProxy final |
| 65 : public NoBaseWillBeGarbageCollectedFinalized<ServiceWorkerGlobalScopeProxy
> | 65 : public NoBaseWillBeGarbageCollectedFinalized<ServiceWorkerGlobalScopeProxy
> |
| 66 , public WebServiceWorkerContextProxy | 66 , public WebServiceWorkerContextProxy |
| 67 , public WorkerReportingProxy { | 67 , public WorkerReportingProxy { |
| 68 WTF_MAKE_NONCOPYABLE(ServiceWorkerGlobalScopeProxy); | 68 WTF_MAKE_NONCOPYABLE(ServiceWorkerGlobalScopeProxy); |
| 69 USING_FAST_MALLOC_WILL_BE_REMOVED(ServiceWorkerGlobalScopeProxy); | 69 USING_FAST_MALLOC_WILL_BE_REMOVED(ServiceWorkerGlobalScopeProxy); |
| 70 public: | 70 public: |
| 71 static PassOwnPtrWillBeRawPtr<ServiceWorkerGlobalScopeProxy> create(WebEmbed
dedWorkerImpl&, Document&, WebServiceWorkerContextClient&); | 71 static PassOwnPtrWillBeRawPtr<ServiceWorkerGlobalScopeProxy> create(WebEmbed
dedWorkerImpl&, Document&, WebServiceWorkerContextClient&); |
| 72 ~ServiceWorkerGlobalScopeProxy() override; | 72 ~ServiceWorkerGlobalScopeProxy() override; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 90 // WorkerReportingProxy overrides: | 90 // WorkerReportingProxy overrides: |
| 91 void reportException(const String& errorMessage, int lineNumber, int columnN
umber, const String& sourceURL, int exceptionId) override; | 91 void reportException(const String& errorMessage, int lineNumber, int columnN
umber, const String& sourceURL, int exceptionId) override; |
| 92 void reportConsoleMessage(PassRefPtrWillBeRawPtr<ConsoleMessage>) override; | 92 void reportConsoleMessage(PassRefPtrWillBeRawPtr<ConsoleMessage>) override; |
| 93 void postMessageToPageInspector(const String&) override; | 93 void postMessageToPageInspector(const String&) override; |
| 94 void postWorkerConsoleAgentEnabled() override { } | 94 void postWorkerConsoleAgentEnabled() override { } |
| 95 void didEvaluateWorkerScript(bool success) override; | 95 void didEvaluateWorkerScript(bool success) override; |
| 96 void didInitializeWorkerContext() override; | 96 void didInitializeWorkerContext() override; |
| 97 void workerGlobalScopeStarted(WorkerGlobalScope*) override; | 97 void workerGlobalScopeStarted(WorkerGlobalScope*) override; |
| 98 void workerGlobalScopeClosed() override; | 98 void workerGlobalScopeClosed() override; |
| 99 void willDestroyWorkerGlobalScope() override; | 99 void willDestroyWorkerGlobalScope() override; |
| 100 void workerThreadTerminated() override; | 100 void workerScriptTerminated() override; |
| 101 | 101 |
| 102 DECLARE_TRACE(); | 102 DECLARE_TRACE(); |
| 103 | 103 |
| 104 // Detach this proxy object entirely from the outside world, | 104 // Detach this proxy object entirely from the outside world, |
| 105 // clearing out all references. | 105 // clearing out all references. |
| 106 // | 106 // |
| 107 // It is called during WebEmbeddedWorkerImpl finalization _after_ | 107 // It is called during WebEmbeddedWorkerImpl finalization _after_ |
| 108 // the worker thread using the proxy has been terminated. | 108 // the worker thread using the proxy has been terminated. |
| 109 void detach(); | 109 void detach(); |
| 110 | 110 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 124 KURL m_documentURL; | 124 KURL m_documentURL; |
| 125 | 125 |
| 126 WebServiceWorkerContextClient* m_client; | 126 WebServiceWorkerContextClient* m_client; |
| 127 | 127 |
| 128 RawPtrWillBeMember<ServiceWorkerGlobalScope> m_workerGlobalScope; | 128 RawPtrWillBeMember<ServiceWorkerGlobalScope> m_workerGlobalScope; |
| 129 }; | 129 }; |
| 130 | 130 |
| 131 } // namespace blink | 131 } // namespace blink |
| 132 | 132 |
| 133 #endif // ServiceWorkerGlobalScopeProxy_h | 133 #endif // ServiceWorkerGlobalScopeProxy_h |
| OLD | NEW |