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