| 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_RENDERER_SERVICE_WORKER_EMBEDDED_WORKER_CONTEXT_CLIENT_H_ | 5 #ifndef CONTENT_RENDERER_SERVICE_WORKER_EMBEDDED_WORKER_CONTEXT_CLIENT_H_ |
| 6 #define CONTENT_RENDERER_SERVICE_WORKER_EMBEDDED_WORKER_CONTEXT_CLIENT_H_ | 6 #define CONTENT_RENDERER_SERVICE_WORKER_EMBEDDED_WORKER_CONTEXT_CLIENT_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 createServiceWorkerNetworkProvider(blink::WebDataSource* data_source); | 95 createServiceWorkerNetworkProvider(blink::WebDataSource* data_source); |
| 96 virtual void postMessageToClient( | 96 virtual void postMessageToClient( |
| 97 int client_id, | 97 int client_id, |
| 98 const blink::WebString& message, | 98 const blink::WebString& message, |
| 99 blink::WebMessagePortChannelArray* channels); | 99 blink::WebMessagePortChannelArray* channels); |
| 100 | 100 |
| 101 // TODO: Implement DevTools related method overrides. | 101 // TODO: Implement DevTools related method overrides. |
| 102 | 102 |
| 103 int embedded_worker_id() const { return embedded_worker_id_; } | 103 int embedded_worker_id() const { return embedded_worker_id_; } |
| 104 base::MessageLoopProxy* main_thread_proxy() const { | 104 base::MessageLoopProxy* main_thread_proxy() const { |
| 105 return main_thread_proxy_; | 105 return main_thread_proxy_.get(); |
| 106 } | 106 } |
| 107 ThreadSafeSender* thread_safe_sender() { return sender_; } | 107 ThreadSafeSender* thread_safe_sender() { return sender_.get(); } |
| 108 | 108 |
| 109 private: | 109 private: |
| 110 void OnMessageToWorker(int thread_id, | 110 void OnMessageToWorker(int thread_id, |
| 111 int embedded_worker_id, | 111 int embedded_worker_id, |
| 112 const IPC::Message& message); | 112 const IPC::Message& message); |
| 113 void SendWorkerStarted(); | 113 void SendWorkerStarted(); |
| 114 | 114 |
| 115 const int embedded_worker_id_; | 115 const int embedded_worker_id_; |
| 116 const int64 service_worker_version_id_; | 116 const int64 service_worker_version_id_; |
| 117 const GURL service_worker_scope_; | 117 const GURL service_worker_scope_; |
| 118 const GURL script_url_; | 118 const GURL script_url_; |
| 119 const int worker_devtools_agent_route_id_; | 119 const int worker_devtools_agent_route_id_; |
| 120 scoped_refptr<ThreadSafeSender> sender_; | 120 scoped_refptr<ThreadSafeSender> sender_; |
| 121 scoped_refptr<base::MessageLoopProxy> main_thread_proxy_; | 121 scoped_refptr<base::MessageLoopProxy> main_thread_proxy_; |
| 122 scoped_refptr<base::TaskRunner> worker_task_runner_; | 122 scoped_refptr<base::TaskRunner> worker_task_runner_; |
| 123 | 123 |
| 124 scoped_ptr<ServiceWorkerScriptContext> script_context_; | 124 scoped_ptr<ServiceWorkerScriptContext> script_context_; |
| 125 | 125 |
| 126 base::WeakPtrFactory<EmbeddedWorkerContextClient> weak_factory_; | 126 base::WeakPtrFactory<EmbeddedWorkerContextClient> weak_factory_; |
| 127 | 127 |
| 128 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerContextClient); | 128 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerContextClient); |
| 129 }; | 129 }; |
| 130 | 130 |
| 131 } // namespace content | 131 } // namespace content |
| 132 | 132 |
| 133 #endif // CONTENT_RENDERER_SERVICE_WORKER_EMBEDDED_WORKER_CONTEXT_CLIENT_H_ | 133 #endif // CONTENT_RENDERER_SERVICE_WORKER_EMBEDDED_WORKER_CONTEXT_CLIENT_H_ |
| OLD | NEW |