| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CONTENT_CHILD_SERVICE_WORKER_WEB_SERVICE_WORKER_IMPL_H_ | 5 #ifndef CONTENT_CHILD_SERVICE_WORKER_WEB_SERVICE_WORKER_IMPL_H_ |
| 6 #define CONTENT_CHILD_SERVICE_WORKER_WEB_SERVICE_WORKER_IMPL_H_ | 6 #define CONTENT_CHILD_SERVICE_WORKER_WEB_SERVICE_WORKER_IMPL_H_ |
| 7 | 7 |
| 8 #include <memory> |
| 8 #include <vector> | 9 #include <vector> |
| 9 | 10 |
| 10 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 11 #include "base/macros.h" | 12 #include "base/macros.h" |
| 12 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 14 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/strings/string16.h" | 15 #include "base/strings/string16.h" |
| 14 #include "content/common/content_export.h" | 16 #include "content/common/content_export.h" |
| 15 #include "third_party/WebKit/public/platform/WebMessagePortChannel.h" | 17 #include "third_party/WebKit/public/platform/WebMessagePortChannel.h" |
| 16 #include "third_party/WebKit/public/platform/WebPassOwnPtr.h" | |
| 17 #include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWor
ker.h" | 18 #include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWor
ker.h" |
| 18 #include "third_party/WebKit/public/web/WebFrame.h" | 19 #include "third_party/WebKit/public/web/WebFrame.h" |
| 19 | 20 |
| 20 namespace blink { | 21 namespace blink { |
| 21 class WebServiceWorkerProxy; | 22 class WebServiceWorkerProxy; |
| 22 } | 23 } |
| 23 | 24 |
| 24 namespace content { | 25 namespace content { |
| 25 | 26 |
| 26 class ServiceWorkerHandleReference; | 27 class ServiceWorkerHandleReference; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 49 blink::WebURL url() const override; | 50 blink::WebURL url() const override; |
| 50 blink::WebServiceWorkerState state() const override; | 51 blink::WebServiceWorkerState state() const override; |
| 51 void postMessage(blink::WebServiceWorkerProvider* provider, | 52 void postMessage(blink::WebServiceWorkerProvider* provider, |
| 52 const blink::WebString& message, | 53 const blink::WebString& message, |
| 53 const blink::WebSecurityOrigin& source_origin, | 54 const blink::WebSecurityOrigin& source_origin, |
| 54 blink::WebMessagePortChannelArray* channels) override; | 55 blink::WebMessagePortChannelArray* channels) override; |
| 55 void terminate() override; | 56 void terminate() override; |
| 56 | 57 |
| 57 // Creates WebServiceWorker::Handle object that owns a reference to the given | 58 // Creates WebServiceWorker::Handle object that owns a reference to the given |
| 58 // WebServiceWorkerImpl object. | 59 // WebServiceWorkerImpl object. |
| 59 static blink::WebPassOwnPtr<blink::WebServiceWorker::Handle> CreateHandle( | 60 static std::unique_ptr<blink::WebServiceWorker::Handle> CreateHandle( |
| 60 const scoped_refptr<WebServiceWorkerImpl>& worker); | 61 const scoped_refptr<WebServiceWorkerImpl>& worker); |
| 61 | 62 |
| 62 private: | 63 private: |
| 63 friend class base::RefCounted<WebServiceWorkerImpl>; | 64 friend class base::RefCounted<WebServiceWorkerImpl>; |
| 64 ~WebServiceWorkerImpl() override; | 65 ~WebServiceWorkerImpl() override; |
| 65 | 66 |
| 66 scoped_ptr<ServiceWorkerHandleReference> handle_ref_; | 67 scoped_ptr<ServiceWorkerHandleReference> handle_ref_; |
| 67 blink::WebServiceWorkerState state_; | 68 blink::WebServiceWorkerState state_; |
| 68 scoped_refptr<ThreadSafeSender> thread_safe_sender_; | 69 scoped_refptr<ThreadSafeSender> thread_safe_sender_; |
| 69 blink::WebServiceWorkerProxy* proxy_; | 70 blink::WebServiceWorkerProxy* proxy_; |
| 70 | 71 |
| 71 DISALLOW_COPY_AND_ASSIGN(WebServiceWorkerImpl); | 72 DISALLOW_COPY_AND_ASSIGN(WebServiceWorkerImpl); |
| 72 }; | 73 }; |
| 73 | 74 |
| 74 } // namespace content | 75 } // namespace content |
| 75 | 76 |
| 76 #endif // CONTENT_CHILD_SERVICE_WORKER_WEB_SERVICE_WORKER_IMPL_H_ | 77 #endif // CONTENT_CHILD_SERVICE_WORKER_WEB_SERVICE_WORKER_IMPL_H_ |
| OLD | NEW |