OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 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 27 matching lines...) Expand all Loading... | |
38 #include "public/platform/WebServiceWorkerClientsInfo.h" | 38 #include "public/platform/WebServiceWorkerClientsInfo.h" |
39 #include "public/platform/WebServiceWorkerEventResult.h" | 39 #include "public/platform/WebServiceWorkerEventResult.h" |
40 #include "wtf/Forward.h" | 40 #include "wtf/Forward.h" |
41 #include "wtf/Noncopyable.h" | 41 #include "wtf/Noncopyable.h" |
42 | 42 |
43 namespace blink { | 43 namespace blink { |
44 | 44 |
45 class ExecutionContext; | 45 class ExecutionContext; |
46 class Response; | 46 class Response; |
47 class WebServiceWorkerCacheStorage; | 47 class WebServiceWorkerCacheStorage; |
48 class WebServiceWorkerResponse; | |
48 class WebURL; | 49 class WebURL; |
49 class WorkerClients; | 50 class WorkerClients; |
50 | 51 |
51 class ServiceWorkerGlobalScopeClient : public WillBeHeapSupplement<WorkerClients > { | 52 class ServiceWorkerGlobalScopeClient : public WillBeHeapSupplement<WorkerClients > { |
52 WTF_MAKE_NONCOPYABLE(ServiceWorkerGlobalScopeClient); | 53 WTF_MAKE_NONCOPYABLE(ServiceWorkerGlobalScopeClient); |
53 public: | 54 public: |
54 virtual ~ServiceWorkerGlobalScopeClient() { } | 55 virtual ~ServiceWorkerGlobalScopeClient() { } |
55 | 56 |
56 virtual void getClients(WebServiceWorkerClientsCallbacks*) = 0; | 57 virtual void getClients(WebServiceWorkerClientsCallbacks*) = 0; |
57 virtual WebURL scope() const = 0; | 58 virtual WebURL scope() const = 0; |
58 virtual WebServiceWorkerCacheStorage* cacheStorage() const = 0; | 59 virtual WebServiceWorkerCacheStorage* cacheStorage() const = 0; |
59 | 60 |
60 virtual void didHandleActivateEvent(int eventID, WebServiceWorkerEventResult ) = 0; | 61 virtual void didHandleActivateEvent(int eventID, WebServiceWorkerEventResult ) = 0; |
61 virtual void didHandleInstallEvent(int installEventID, WebServiceWorkerEvent Result) = 0; | 62 virtual void didHandleInstallEvent(int installEventID, WebServiceWorkerEvent Result) = 0; |
62 // A null response means no valid response was provided by the service worke r, so fallback to native. | 63 // Calling didHandleFetchEvent without response means no response was provid ed by the service worker in the fetch events, so fallback to native. |
63 virtual void didHandleFetchEvent(int fetchEventID, Response* = 0) = 0; | 64 virtual void didHandleFetchEvent(int fetchEventID) = 0; |
65 virtual void didHandleFetchEvent(int fetchEventID, const WebServiceWorkerRes ponse&) = 0; | |
Mike West
2014/09/16 11:01:38
This is much cleaner, thanks!
| |
64 virtual void didHandleSyncEvent(int syncEventID) = 0; | 66 virtual void didHandleSyncEvent(int syncEventID) = 0; |
65 virtual void postMessageToClient(int clientID, const WebString& message, Pas sOwnPtr<WebMessagePortChannelArray>) = 0; | 67 virtual void postMessageToClient(int clientID, const WebString& message, Pas sOwnPtr<WebMessagePortChannelArray>) = 0; |
66 | 68 |
67 static const char* supplementName(); | 69 static const char* supplementName(); |
68 static ServiceWorkerGlobalScopeClient* from(ExecutionContext*); | 70 static ServiceWorkerGlobalScopeClient* from(ExecutionContext*); |
69 | 71 |
70 protected: | 72 protected: |
71 ServiceWorkerGlobalScopeClient() { } | 73 ServiceWorkerGlobalScopeClient() { } |
72 }; | 74 }; |
73 | 75 |
74 void provideServiceWorkerGlobalScopeClientToWorker(WorkerClients*, PassOwnPtrWil lBeRawPtr<ServiceWorkerGlobalScopeClient>); | 76 void provideServiceWorkerGlobalScopeClientToWorker(WorkerClients*, PassOwnPtrWil lBeRawPtr<ServiceWorkerGlobalScopeClient>); |
75 | 77 |
76 } // namespace blink | 78 } // namespace blink |
77 | 79 |
78 #endif // ServiceWorkerGlobalScopeClient_h | 80 #endif // ServiceWorkerGlobalScopeClient_h |
OLD | NEW |