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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 // All methods other than its ctor/dtor are called on the worker thread. | 51 // All methods other than its ctor/dtor are called on the worker thread. |
52 // | 52 // |
53 // This implements WebServiceWorkerContextProxy, which connects ServiceWorker's | 53 // This implements WebServiceWorkerContextProxy, which connects ServiceWorker's |
54 // WorkerGlobalScope and embedder/chrome, and implements ServiceWorker-specific | 54 // WorkerGlobalScope and embedder/chrome, and implements ServiceWorker-specific |
55 // events/upcall methods that are to be called by embedder/chromium, | 55 // events/upcall methods that are to be called by embedder/chromium, |
56 // e.g. onfetch. | 56 // e.g. onfetch. |
57 // | 57 // |
58 // An instance of this class is supposed to outlive until | 58 // An instance of this class is supposed to outlive until |
59 // workerThreadTerminated() is called by its corresponding | 59 // workerThreadTerminated() is called by its corresponding |
60 // WorkerGlobalScope. | 60 // WorkerGlobalScope. |
61 class ServiceWorkerGlobalScopeProxy FINAL | 61 class ServiceWorkerGlobalScopeProxy final |
62 : public WebServiceWorkerContextProxy | 62 : public WebServiceWorkerContextProxy |
63 , public WorkerReportingProxy { | 63 , public WorkerReportingProxy { |
64 WTF_MAKE_NONCOPYABLE(ServiceWorkerGlobalScopeProxy); | 64 WTF_MAKE_NONCOPYABLE(ServiceWorkerGlobalScopeProxy); |
65 public: | 65 public: |
66 static PassOwnPtr<ServiceWorkerGlobalScopeProxy> create(WebEmbeddedWorkerImp
l&, Document&, WebServiceWorkerContextClient&); | 66 static PassOwnPtr<ServiceWorkerGlobalScopeProxy> create(WebEmbeddedWorkerImp
l&, Document&, WebServiceWorkerContextClient&); |
67 virtual ~ServiceWorkerGlobalScopeProxy(); | 67 virtual ~ServiceWorkerGlobalScopeProxy(); |
68 | 68 |
69 // WebServiceWorkerContextProxy overrides: | 69 // WebServiceWorkerContextProxy overrides: |
70 virtual void dispatchActivateEvent(int) OVERRIDE; | 70 virtual void dispatchActivateEvent(int) override; |
71 virtual void dispatchInstallEvent(int) OVERRIDE; | 71 virtual void dispatchInstallEvent(int) override; |
72 virtual void dispatchFetchEvent(int, const WebServiceWorkerRequest&) OVERRID
E; | 72 virtual void dispatchFetchEvent(int, const WebServiceWorkerRequest&) overrid
e; |
73 virtual void dispatchMessageEvent(const WebString& message, const WebMessage
PortChannelArray&) OVERRIDE; | 73 virtual void dispatchMessageEvent(const WebString& message, const WebMessage
PortChannelArray&) override; |
74 virtual void dispatchPushEvent(int, const WebString& data) OVERRIDE; | 74 virtual void dispatchPushEvent(int, const WebString& data) override; |
75 virtual void dispatchSyncEvent(int) OVERRIDE; | 75 virtual void dispatchSyncEvent(int) override; |
76 | 76 |
77 // WorkerReportingProxy overrides: | 77 // WorkerReportingProxy overrides: |
78 virtual void reportException(const String& errorMessage, int lineNumber, int
columnNumber, const String& sourceURL) OVERRIDE; | 78 virtual void reportException(const String& errorMessage, int lineNumber, int
columnNumber, const String& sourceURL) override; |
79 virtual void reportConsoleMessage(PassRefPtrWillBeRawPtr<ConsoleMessage>) OV
ERRIDE; | 79 virtual void reportConsoleMessage(PassRefPtrWillBeRawPtr<ConsoleMessage>) ov
erride; |
80 virtual void postMessageToPageInspector(const String&) OVERRIDE; | 80 virtual void postMessageToPageInspector(const String&) override; |
81 virtual void updateInspectorStateCookie(const String&) OVERRIDE; | 81 virtual void updateInspectorStateCookie(const String&) override; |
82 virtual void workerGlobalScopeStarted(WorkerGlobalScope*) OVERRIDE; | 82 virtual void workerGlobalScopeStarted(WorkerGlobalScope*) override; |
83 virtual void workerGlobalScopeClosed() OVERRIDE; | 83 virtual void workerGlobalScopeClosed() override; |
84 virtual void willDestroyWorkerGlobalScope() OVERRIDE; | 84 virtual void willDestroyWorkerGlobalScope() override; |
85 virtual void workerThreadTerminated() OVERRIDE; | 85 virtual void workerThreadTerminated() override; |
86 | 86 |
87 private: | 87 private: |
88 ServiceWorkerGlobalScopeProxy(WebEmbeddedWorkerImpl&, Document&, WebServiceW
orkerContextClient&); | 88 ServiceWorkerGlobalScopeProxy(WebEmbeddedWorkerImpl&, Document&, WebServiceW
orkerContextClient&); |
89 | 89 |
90 WebEmbeddedWorkerImpl& m_embeddedWorker; | 90 WebEmbeddedWorkerImpl& m_embeddedWorker; |
91 Document& m_document; | 91 Document& m_document; |
92 | 92 |
93 WebServiceWorkerContextClient& m_client; | 93 WebServiceWorkerContextClient& m_client; |
94 | 94 |
95 WorkerGlobalScope* m_workerGlobalScope; | 95 WorkerGlobalScope* m_workerGlobalScope; |
96 }; | 96 }; |
97 | 97 |
98 } // namespace blink | 98 } // namespace blink |
99 | 99 |
100 #endif // ServiceWorkerGlobalScopeProxy_h | 100 #endif // ServiceWorkerGlobalScopeProxy_h |
OLD | NEW |