| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef ServiceWorkerClient_h | 5 #ifndef ServiceWorkerClient_h |
| 6 #define ServiceWorkerClient_h | 6 #define ServiceWorkerClient_h |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include "bindings/core/v8/ScriptPromise.h" | 9 #include "bindings/core/v8/ScriptPromise.h" |
| 10 #include "bindings/core/v8/ScriptWrappable.h" | 10 #include "bindings/core/v8/ScriptWrappable.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 using WebType = std::unique_ptr<WebServiceWorkerClientInfo>; | 29 using WebType = std::unique_ptr<WebServiceWorkerClientInfo>; |
| 30 | 30 |
| 31 static ServiceWorkerClient* Take(ScriptPromiseResolver*, | 31 static ServiceWorkerClient* Take(ScriptPromiseResolver*, |
| 32 std::unique_ptr<WebServiceWorkerClientInfo>); | 32 std::unique_ptr<WebServiceWorkerClientInfo>); |
| 33 static ServiceWorkerClient* Create(const WebServiceWorkerClientInfo&); | 33 static ServiceWorkerClient* Create(const WebServiceWorkerClientInfo&); |
| 34 | 34 |
| 35 virtual ~ServiceWorkerClient(); | 35 virtual ~ServiceWorkerClient(); |
| 36 | 36 |
| 37 // Client.idl | 37 // Client.idl |
| 38 String url() const { return url_; } | 38 String url() const { return url_; } |
| 39 String type() const; |
| 39 String frameType() const; | 40 String frameType() const; |
| 40 String id() const { return uuid_; } | 41 String id() const { return uuid_; } |
| 41 void postMessage(ScriptState*, | 42 void postMessage(ScriptState*, |
| 42 PassRefPtr<SerializedScriptValue> message, | 43 PassRefPtr<SerializedScriptValue> message, |
| 43 const MessagePortArray&, | 44 const MessagePortArray&, |
| 44 ExceptionState&); | 45 ExceptionState&); |
| 45 | 46 |
| 46 static bool CanTransferArrayBuffersAndImageBitmaps() { return false; } | 47 static bool CanTransferArrayBuffersAndImageBitmaps() { return false; } |
| 47 | 48 |
| 48 DEFINE_INLINE_VIRTUAL_TRACE() {} | 49 DEFINE_INLINE_VIRTUAL_TRACE() {} |
| 49 | 50 |
| 50 protected: | 51 protected: |
| 51 explicit ServiceWorkerClient(const WebServiceWorkerClientInfo&); | 52 explicit ServiceWorkerClient(const WebServiceWorkerClientInfo&); |
| 52 | 53 |
| 53 String Uuid() const { return uuid_; } | 54 String Uuid() const { return uuid_; } |
| 54 | 55 |
| 55 private: | 56 private: |
| 56 String uuid_; | 57 String uuid_; |
| 57 String url_; | 58 String url_; |
| 59 WebServiceWorkerClientType type_; |
| 58 WebURLRequest::FrameType frame_type_; | 60 WebURLRequest::FrameType frame_type_; |
| 59 }; | 61 }; |
| 60 | 62 |
| 61 } // namespace blink | 63 } // namespace blink |
| 62 | 64 |
| 63 #endif // ServiceWorkerClient_h | 65 #endif // ServiceWorkerClient_h |
| OLD | NEW |