[content shell] implement testRunner.overridePreference
[chromium-blink-merge.git] / content / worker / worker_thread.h
blobaaa78a30eaaa860e98892b5a63285a3f3c8f114a
1 // Copyright (c) 2012 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.
5 #ifndef CONTENT_WORKER_WORKER_THREAD_H_
6 #define CONTENT_WORKER_WORKER_THREAD_H_
8 #include <set>
10 #include "content/common/child_thread.h"
12 struct WorkerProcessMsg_CreateWorker_Params;
14 namespace content {
15 class AppCacheDispatcher;
16 class DBMessageFilter;
17 class IndexedDBMessageFilter;
18 class WebDatabaseObserverImpl;
19 class WebSharedWorkerStub;
20 class WorkerWebKitPlatformSupportImpl;
22 class WorkerThread : public ChildThread {
23 public:
24 WorkerThread();
25 virtual ~WorkerThread();
27 // Returns the one worker thread.
28 static WorkerThread* current();
30 // Invoked from stub constructors/destructors. Stubs own themselves.
31 void AddWorkerStub(WebSharedWorkerStub* stub);
32 void RemoveWorkerStub(WebSharedWorkerStub* stub);
34 AppCacheDispatcher* appcache_dispatcher() {
35 return appcache_dispatcher_.get();
38 private:
39 virtual bool OnControlMessageReceived(const IPC::Message& msg) OVERRIDE;
40 virtual void OnChannelError() OVERRIDE;
42 void OnCreateWorker(const WorkerProcessMsg_CreateWorker_Params& params);
44 scoped_ptr<WorkerWebKitPlatformSupportImpl> webkit_platform_support_;
45 scoped_ptr<AppCacheDispatcher> appcache_dispatcher_;
46 scoped_ptr<WebDatabaseObserverImpl> web_database_observer_impl_;
47 scoped_refptr<DBMessageFilter> db_message_filter_;
48 scoped_refptr<IndexedDBMessageFilter> indexed_db_message_filter_;
50 typedef std::set<WebSharedWorkerStub*> WorkerStubsList;
51 WorkerStubsList worker_stubs_;
53 DISALLOW_COPY_AND_ASSIGN(WorkerThread);
56 } // namespace content
58 #endif // CONTENT_WORKER_WORKER_THREAD_H_