Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(188)

Side by Side Diff: chrome/worker/worker_thread.h

Issue 126086: Switch child threads so that current() only works on the correct thread and t... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/renderer/render_thread_unittest.cc ('k') | chrome/worker/worker_thread.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "base/thread.h" 8 #include "base/thread.h"
9 #include "chrome/common/child_thread.h" 9 #include "chrome/common/child_thread.h"
10 10
11 class GURL; 11 class GURL;
12 class WorkerWebKitClientImpl; 12 class WorkerWebKitClientImpl;
13 13
14 class WorkerThread : public ChildThread { 14 class WorkerThread : public ChildThread {
15 public: 15 public:
16 WorkerThread(); 16 WorkerThread();
17 ~WorkerThread(); 17 ~WorkerThread();
18 18
19 // Returns the one worker thread. 19 // Returns the one worker thread.
20 static WorkerThread* current() { 20 static WorkerThread* current();
21 return static_cast<WorkerThread*>(ChildThread::current());
22 }
23 21
24 private: 22 private:
25 virtual void OnControlMessageReceived(const IPC::Message& msg); 23 virtual void OnControlMessageReceived(const IPC::Message& msg);
26 24
27 // Called by the thread base class 25 // Called by the thread base class
28 virtual void Init(); 26 virtual void Init();
29 virtual void CleanUp(); 27 virtual void CleanUp();
30 28
31 void OnCreateWorker(const GURL& url, int route_id); 29 void OnCreateWorker(const GURL& url, int route_id);
32 30
33 scoped_ptr<WorkerWebKitClientImpl> webkit_client_; 31 scoped_ptr<WorkerWebKitClientImpl> webkit_client_;
34 32
35 DISALLOW_COPY_AND_ASSIGN(WorkerThread); 33 DISALLOW_COPY_AND_ASSIGN(WorkerThread);
36 }; 34 };
37 35
38 #endif // CHROME_WORKER_WORKER_THREAD_H_ 36 #endif // CHROME_WORKER_WORKER_THREAD_H_
OLDNEW
« no previous file with comments | « chrome/renderer/render_thread_unittest.cc ('k') | chrome/worker/worker_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698