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

Side by Side Diff: chrome/utility/utility_thread.h

Issue 155944: Switch the first thread in a child process to be the main thread... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: sync Created 11 years, 5 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
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_UTILITY_UTILITY_THREAD_H_ 5 #ifndef CHROME_UTILITY_UTILITY_THREAD_H_
6 #define CHROME_UTILITY_UTILITY_THREAD_H_ 6 #define CHROME_UTILITY_UTILITY_THREAD_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/thread.h"
11 #include "chrome/common/child_thread.h" 10 #include "chrome/common/child_thread.h"
12 11
13 class GURL; 12 class GURL;
14 13
15 // This class represents the background thread where the utility task runs. 14 // This class represents the background thread where the utility task runs.
16 class UtilityThread : public ChildThread { 15 class UtilityThread : public ChildThread {
17 public: 16 public:
18 UtilityThread(); 17 UtilityThread();
19 ~UtilityThread(); 18 ~UtilityThread();
20 19
21 // Returns the one utility thread. 20 // Returns the one utility thread.
22 static UtilityThread* current() { 21 static UtilityThread* current() {
23 return static_cast<UtilityThread*>(ChildThread::current()); 22 return static_cast<UtilityThread*>(ChildThread::current());
24 } 23 }
25 24
26 private: 25 private:
27 // IPC messages 26 // IPC messages
28 virtual void OnControlMessageReceived(const IPC::Message& msg); 27 virtual void OnControlMessageReceived(const IPC::Message& msg);
29 void OnUnpackExtension(const FilePath& extension_path); 28 void OnUnpackExtension(const FilePath& extension_path);
30 29
31 // IPC messages for web resource service. 30 // IPC messages for web resource service.
32 void OnUnpackWebResource(const std::string& resource_data); 31 void OnUnpackWebResource(const std::string& resource_data);
33 32
34 // Called by the thread base class
35 virtual void Init();
36 virtual void CleanUp();
37
38 DISALLOW_COPY_AND_ASSIGN(UtilityThread); 33 DISALLOW_COPY_AND_ASSIGN(UtilityThread);
39 }; 34 };
40 35
41 #endif // CHROME_UTILITY_UTILITY_THREAD_H_ 36 #endif // CHROME_UTILITY_UTILITY_THREAD_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698