| 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 "public/platform/WebCommon.h" | 34 #include "public/platform/WebCommon.h" |
| 35 #include "public/platform/WebMessagePortChannel.h" | 35 #include "public/platform/WebMessagePortChannel.h" |
| 36 #include "public/platform/WebString.h" | 36 #include "public/platform/WebString.h" |
| 37 #include "public/platform/WebURL.h" | 37 #include "public/platform/WebURL.h" |
| 38 #include "public/platform/WebVector.h" | 38 #include "public/platform/WebVector.h" |
| 39 #include "public/platform/modules/serviceworker/WebServiceWorkerState.h" | 39 #include "public/platform/modules/serviceworker/WebServiceWorkerState.h" |
| 40 | 40 |
| 41 namespace blink { | 41 namespace blink { |
| 42 | 42 |
| 43 class WebServiceWorkerProvider; |
| 43 class WebServiceWorkerProxy; | 44 class WebServiceWorkerProxy; |
| 44 typedef WebVector<class WebMessagePortChannel*> WebMessagePortChannelArray; | 45 typedef WebVector<class WebMessagePortChannel*> WebMessagePortChannelArray; |
| 45 | 46 |
| 46 class WebServiceWorker { | 47 class WebServiceWorker { |
| 47 public: | 48 public: |
| 48 // The handle interface that retains a reference to the implementation of | 49 // The handle interface that retains a reference to the implementation of |
| 49 // WebServiceWorker in the embedder and is owned by ServiceWorker object in | 50 // WebServiceWorker in the embedder and is owned by ServiceWorker object in |
| 50 // Blink. The embedder must keep the service worker representation while | 51 // Blink. The embedder must keep the service worker representation while |
| 51 // Blink is owning this handle. | 52 // Blink is owning this handle. |
| 52 class Handle { | 53 class Handle { |
| 53 public: | 54 public: |
| 54 virtual ~Handle() {} | 55 virtual ~Handle() {} |
| 55 virtual WebServiceWorker* serviceWorker() { return nullptr; } | 56 virtual WebServiceWorker* serviceWorker() { return nullptr; } |
| 56 }; | 57 }; |
| 57 | 58 |
| 58 virtual ~WebServiceWorker() { } | 59 virtual ~WebServiceWorker() { } |
| 59 | 60 |
| 60 // Sets ServiceWorkerProxy, with which callee can start making upcalls | 61 // Sets ServiceWorkerProxy, with which callee can start making upcalls |
| 61 // to the ServiceWorker object via the client. This doesn't pass the | 62 // to the ServiceWorker object via the client. This doesn't pass the |
| 62 // ownership to the callee, and the proxy's lifetime is same as that of | 63 // ownership to the callee, and the proxy's lifetime is same as that of |
| 63 // WebServiceWorker. | 64 // WebServiceWorker. |
| 64 virtual void setProxy(WebServiceWorkerProxy*) { } | 65 virtual void setProxy(WebServiceWorkerProxy*) { } |
| 65 virtual WebServiceWorkerProxy* proxy() { return nullptr; } | 66 virtual WebServiceWorkerProxy* proxy() { return nullptr; } |
| 66 | 67 |
| 67 virtual WebURL url() const { return WebURL(); } | 68 virtual WebURL url() const { return WebURL(); } |
| 68 virtual WebServiceWorkerState state() const { return WebServiceWorkerStateUn
known; } | 69 virtual WebServiceWorkerState state() const { return WebServiceWorkerStateUn
known; } |
| 69 | 70 |
| 70 // Callee receives ownership of the passed vector. | 71 // Callee receives ownership of the passed vector. |
| 71 // FIXME: Blob refs should be passed to maintain ref counts. crbug.com/35175
3 | 72 // FIXME: Blob refs should be passed to maintain ref counts. crbug.com/35175
3 |
| 72 virtual void postMessage(const WebString&, WebMessagePortChannelArray*) { BL
INK_ASSERT_NOT_REACHED(); } | 73 virtual void postMessage(WebServiceWorkerProvider*, const WebString&, WebMes
sagePortChannelArray*) { BLINK_ASSERT_NOT_REACHED(); } |
| 73 | 74 |
| 74 virtual void terminate() { } | 75 virtual void terminate() { } |
| 75 }; | 76 }; |
| 76 | 77 |
| 77 } | 78 } |
| 78 | 79 |
| 79 #endif // WebServiceWorker_h | 80 #endif // WebServiceWorker_h |
| OLD | NEW |