| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 CHROME_WORKER_WORKER_THREAD_H_ | 5 #ifndef CHROME_WORKER_WORKER_THREAD_H_ |
| 6 #define CHROME_WORKER_WORKER_THREAD_H_ | 6 #define CHROME_WORKER_WORKER_THREAD_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "chrome/common/child_thread.h" | 10 #include "chrome/common/child_thread.h" |
| 11 | 11 |
| 12 class GURL; | 12 class GURL; |
| 13 class AppCacheDispatcher; |
| 13 class DBMessageFilter; | 14 class DBMessageFilter; |
| 14 class WebDatabaseObserverImpl; | 15 class WebDatabaseObserverImpl; |
| 15 class WebWorkerStubBase; | 16 class WebWorkerStubBase; |
| 16 class WorkerWebKitClientImpl; | 17 class WorkerWebKitClientImpl; |
| 18 struct WorkerProcessMsg_CreateWorker_Params; |
| 17 | 19 |
| 18 class WorkerThread : public ChildThread { | 20 class WorkerThread : public ChildThread { |
| 19 public: | 21 public: |
| 20 WorkerThread(); | 22 WorkerThread(); |
| 21 ~WorkerThread(); | 23 ~WorkerThread(); |
| 22 | 24 |
| 23 // Returns the one worker thread. | 25 // Returns the one worker thread. |
| 24 static WorkerThread* current(); | 26 static WorkerThread* current(); |
| 25 | 27 |
| 26 // Invoked from stub constructors/destructors. Stubs own themselves. | 28 // Invoked from stub constructors/destructors. Stubs own themselves. |
| 27 void AddWorkerStub(WebWorkerStubBase* stub); | 29 void AddWorkerStub(WebWorkerStubBase* stub); |
| 28 void RemoveWorkerStub(WebWorkerStubBase* stub); | 30 void RemoveWorkerStub(WebWorkerStubBase* stub); |
| 29 | 31 |
| 32 AppCacheDispatcher* appcache_dispatcher() { |
| 33 return appcache_dispatcher_.get(); |
| 34 } |
| 35 |
| 30 private: | 36 private: |
| 31 scoped_ptr<WebDatabaseObserverImpl> web_database_observer_impl_; | |
| 32 | |
| 33 virtual void OnControlMessageReceived(const IPC::Message& msg); | 37 virtual void OnControlMessageReceived(const IPC::Message& msg); |
| 34 virtual void OnChannelError(); | 38 virtual void OnChannelError(); |
| 35 | 39 |
| 36 void OnCreateWorker( | 40 void OnCreateWorker(const WorkerProcessMsg_CreateWorker_Params& params); |
| 37 const GURL& url, bool is_shared, const string16& name, int route_id); | |
| 38 | 41 |
| 39 scoped_ptr<WorkerWebKitClientImpl> webkit_client_; | 42 scoped_ptr<WorkerWebKitClientImpl> webkit_client_; |
| 40 | 43 scoped_ptr<AppCacheDispatcher> appcache_dispatcher_; |
| 44 scoped_ptr<WebDatabaseObserverImpl> web_database_observer_impl_; |
| 41 scoped_refptr<DBMessageFilter> db_message_filter_; | 45 scoped_refptr<DBMessageFilter> db_message_filter_; |
| 42 | 46 |
| 43 typedef std::set<WebWorkerStubBase*> WorkerStubsList; | 47 typedef std::set<WebWorkerStubBase*> WorkerStubsList; |
| 44 WorkerStubsList worker_stubs_; | 48 WorkerStubsList worker_stubs_; |
| 45 | 49 |
| 46 DISALLOW_COPY_AND_ASSIGN(WorkerThread); | 50 DISALLOW_COPY_AND_ASSIGN(WorkerThread); |
| 47 }; | 51 }; |
| 48 | 52 |
| 49 #endif // CHROME_WORKER_WORKER_THREAD_H_ | 53 #endif // CHROME_WORKER_WORKER_THREAD_H_ |
| OLD | NEW |