OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CONTENT_UTILITY_UTILITY_THREAD_H_ | 5 #ifndef CONTENT_UTILITY_UTILITY_THREAD_H_ |
6 #define CONTENT_UTILITY_UTILITY_THREAD_H_ | 6 #define CONTENT_UTILITY_UTILITY_THREAD_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
14 #include "base/string16.h" | 14 #include "base/string16.h" |
15 #include "content/common/child_thread.h" | 15 #include "content/common/child_thread.h" |
| 16 #include "content/common/content_export.h" |
16 | 17 |
17 class IndexedDBKey; | 18 class IndexedDBKey; |
18 class SerializedScriptValue; | 19 class SerializedScriptValue; |
19 | 20 |
20 namespace webkit_glue { | 21 namespace webkit_glue { |
21 class WebKitPlatformSupportImpl; | 22 class WebKitPlatformSupportImpl; |
22 } | 23 } |
23 | 24 |
24 // This class represents the background thread where the utility task runs. | 25 // This class represents the background thread where the utility task runs. |
25 class UtilityThread : public ChildThread { | 26 class UtilityThread : public ChildThread { |
26 public: | 27 public: |
27 UtilityThread(); | 28 UtilityThread(); |
28 virtual ~UtilityThread(); | 29 virtual ~UtilityThread(); |
29 | 30 |
30 // Releases the process if we are not (or no longer) in batch mode. | 31 // Releases the process if we are not (or no longer) in batch mode. |
31 void ReleaseProcessIfNeeded(); | 32 CONTENT_EXPORT void ReleaseProcessIfNeeded(); |
32 | 33 |
33 // Returns the one utility thread. | 34 // Returns the one utility thread. |
34 static UtilityThread* current() { | 35 static UtilityThread* current() { |
35 return static_cast<UtilityThread*>(ChildThread::current()); | 36 return static_cast<UtilityThread*>(ChildThread::current()); |
36 } | 37 } |
37 | 38 |
38 private: | 39 private: |
39 // ChildThread implementation. | 40 // ChildThread implementation. |
40 virtual bool OnControlMessageReceived(const IPC::Message& msg) OVERRIDE; | 41 virtual bool OnControlMessageReceived(const IPC::Message& msg) OVERRIDE; |
41 | 42 |
(...skipping 10 matching lines...) Expand all Loading... |
52 | 53 |
53 // True when we're running in batch mode. | 54 // True when we're running in batch mode. |
54 bool batch_mode_; | 55 bool batch_mode_; |
55 | 56 |
56 scoped_ptr<webkit_glue::WebKitPlatformSupportImpl> webkit_platform_support_; | 57 scoped_ptr<webkit_glue::WebKitPlatformSupportImpl> webkit_platform_support_; |
57 | 58 |
58 DISALLOW_COPY_AND_ASSIGN(UtilityThread); | 59 DISALLOW_COPY_AND_ASSIGN(UtilityThread); |
59 }; | 60 }; |
60 | 61 |
61 #endif // CONTENT_UTILITY_UTILITY_THREAD_H_ | 62 #endif // CONTENT_UTILITY_UTILITY_THREAD_H_ |
OLD | NEW |