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