| 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 21 matching lines...) Expand all Loading... |
| 32 #define WebServiceWorkerContextProxy_h | 32 #define WebServiceWorkerContextProxy_h |
| 33 | 33 |
| 34 #include "public/platform/WebMessagePortChannel.h" | 34 #include "public/platform/WebMessagePortChannel.h" |
| 35 #include "public/platform/modules/serviceworker/WebServiceWorker.h" | 35 #include "public/platform/modules/serviceworker/WebServiceWorker.h" |
| 36 #include "public/platform/modules/serviceworker/WebServiceWorkerRegistration.h" | 36 #include "public/platform/modules/serviceworker/WebServiceWorkerRegistration.h" |
| 37 | 37 |
| 38 #include <memory> | 38 #include <memory> |
| 39 | 39 |
| 40 namespace blink { | 40 namespace blink { |
| 41 | 41 |
| 42 struct WebBackgroundFetchSettledFetch; |
| 42 class WebDataConsumerHandle; | 43 class WebDataConsumerHandle; |
| 43 class WebServiceWorkerRequest; | 44 class WebServiceWorkerRequest; |
| 44 class WebString; | 45 class WebString; |
| 45 struct WebNotificationData; | 46 struct WebNotificationData; |
| 46 struct WebPaymentAppRequest; | 47 struct WebPaymentAppRequest; |
| 47 struct WebServiceWorkerClientInfo; | 48 struct WebServiceWorkerClientInfo; |
| 48 struct WebServiceWorkerError; | 49 struct WebServiceWorkerError; |
| 49 class WebURLResponse; | 50 class WebURLResponse; |
| 50 | 51 |
| 51 // A proxy interface to talk to the worker's GlobalScope implementation. | 52 // A proxy interface to talk to the worker's GlobalScope implementation. |
| 52 // All methods of this class must be called on the worker thread. | 53 // All methods of this class must be called on the worker thread. |
| 53 class WebServiceWorkerContextProxy { | 54 class WebServiceWorkerContextProxy { |
| 54 public: | 55 public: |
| 55 virtual ~WebServiceWorkerContextProxy() {} | 56 virtual ~WebServiceWorkerContextProxy() {} |
| 56 | 57 |
| 57 virtual void setRegistration( | 58 virtual void setRegistration( |
| 58 std::unique_ptr<WebServiceWorkerRegistration::Handle>) = 0; | 59 std::unique_ptr<WebServiceWorkerRegistration::Handle>) = 0; |
| 59 | 60 |
| 60 virtual void dispatchActivateEvent(int eventID) = 0; | 61 virtual void dispatchActivateEvent(int eventID) = 0; |
| 61 | 62 |
| 62 enum class BackgroundFetchState { Pending, Succeeded, Failed }; | 63 enum class BackgroundFetchState { Pending, Succeeded, Failed }; |
| 63 | 64 |
| 64 virtual void dispatchBackgroundFetchAbortEvent(int eventID, | 65 virtual void dispatchBackgroundFetchAbortEvent(int eventID, |
| 65 const WebString& tag) = 0; | 66 const WebString& tag) = 0; |
| 66 virtual void dispatchBackgroundFetchClickEvent( | 67 virtual void dispatchBackgroundFetchClickEvent( |
| 67 int eventID, | 68 int eventID, |
| 68 const WebString& tag, | 69 const WebString& tag, |
| 69 BackgroundFetchState status) = 0; | 70 BackgroundFetchState status) = 0; |
| 70 | 71 virtual void dispatchBackgroundFetchFailEvent( |
| 72 int eventID, |
| 73 const WebString& tag, |
| 74 const WebVector<WebBackgroundFetchSettledFetch>& fetches) = 0; |
| 75 virtual void dispatchBackgroundFetchedEvent( |
| 76 int eventID, |
| 77 const WebString& tag, |
| 78 const WebVector<WebBackgroundFetchSettledFetch>& fetches) = 0; |
| 71 virtual void dispatchExtendableMessageEvent( | 79 virtual void dispatchExtendableMessageEvent( |
| 72 int eventID, | 80 int eventID, |
| 73 const WebString& message, | 81 const WebString& message, |
| 74 const WebSecurityOrigin& sourceOrigin, | 82 const WebSecurityOrigin& sourceOrigin, |
| 75 WebMessagePortChannelArray, | 83 WebMessagePortChannelArray, |
| 76 const WebServiceWorkerClientInfo&) = 0; | 84 const WebServiceWorkerClientInfo&) = 0; |
| 77 virtual void dispatchExtendableMessageEvent( | 85 virtual void dispatchExtendableMessageEvent( |
| 78 int eventID, | 86 int eventID, |
| 79 const WebString& message, | 87 const WebString& message, |
| 80 const WebSecurityOrigin& sourceOrigin, | 88 const WebSecurityOrigin& sourceOrigin, |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 std::unique_ptr<WebURLResponse>, | 123 std::unique_ptr<WebURLResponse>, |
| 116 std::unique_ptr<WebDataConsumerHandle>) = 0; | 124 std::unique_ptr<WebDataConsumerHandle>) = 0; |
| 117 virtual void onNavigationPreloadError( | 125 virtual void onNavigationPreloadError( |
| 118 int fetchEventID, | 126 int fetchEventID, |
| 119 std::unique_ptr<WebServiceWorkerError>) = 0; | 127 std::unique_ptr<WebServiceWorkerError>) = 0; |
| 120 }; | 128 }; |
| 121 | 129 |
| 122 } // namespace blink | 130 } // namespace blink |
| 123 | 131 |
| 124 #endif // WebServiceWorkerContextProxy_h | 132 #endif // WebServiceWorkerContextProxy_h |
| OLD | NEW |