OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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_PUBLIC_BROWSER_BROWSER_CHILD_PROCESS_HOST_ITERATOR_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_BROWSER_CHILD_PROCESS_HOST_ITERATOR_H_ |
6 #define CONTENT_PUBLIC_BROWSER_BROWSER_CHILD_PROCESS_HOST_ITERATOR_H_ | 6 #define CONTENT_PUBLIC_BROWSER_BROWSER_CHILD_PROCESS_HOST_ITERATOR_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 | 9 |
10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
11 | 11 |
12 namespace IPC { | 12 namespace IPC { |
13 class Message; | 13 class Message; |
14 } | 14 } |
15 | 15 |
16 namespace content { | 16 namespace content { |
17 class BrowserChildProcessHostDelegate; | 17 class BrowserChildProcessHostDelegate; |
18 class BrowserChildProcessHostImpl; | 18 class BrowserChildProcessHostImpl; |
19 struct ChildProcessData; | 19 struct ChildProcessData; |
20 | 20 |
21 // This class allows iteration through either all child processes, or ones of a | 21 // This class allows iteration through either all child processes, or ones of a |
22 // specific type, depending on which constructor is used. Note that this should | 22 // specific type, depending on which constructor is used. Note that this should |
23 // be done from the IO thread and that the iterator should not be kept around as | 23 // be done from the IO thread and that the iterator should not be kept around as |
24 // it may be invalidated on subsequent event processing in the event loop. | 24 // it may be invalidated on subsequent event processing in the event loop. |
25 class CONTENT_EXPORT BrowserChildProcessHostIterator { | 25 class CONTENT_EXPORT BrowserChildProcessHostIterator { |
26 public: | 26 public: |
27 BrowserChildProcessHostIterator(); | 27 BrowserChildProcessHostIterator(); |
28 explicit BrowserChildProcessHostIterator(int type); | 28 explicit BrowserChildProcessHostIterator(int type); |
| 29 ~BrowserChildProcessHostIterator(); |
29 | 30 |
30 // These methods work on the current iterator object. Only call them if | 31 // These methods work on the current iterator object. Only call them if |
31 // Done() returns false. | 32 // Done() returns false. |
32 bool operator++(); | 33 bool operator++(); |
33 bool Done(); | 34 bool Done(); |
34 const ChildProcessData& GetData(); | 35 const ChildProcessData& GetData(); |
35 bool Send(IPC::Message* message); | 36 bool Send(IPC::Message* message); |
36 BrowserChildProcessHostDelegate* GetDelegate(); | 37 BrowserChildProcessHostDelegate* GetDelegate(); |
37 | 38 |
38 private: | 39 private: |
(...skipping 16 matching lines...) Expand all Loading... |
55 return static_cast<T*>(GetDelegate()); | 56 return static_cast<T*>(GetDelegate()); |
56 } | 57 } |
57 T* operator*() { | 58 T* operator*() { |
58 return static_cast<T*>(GetDelegate()); | 59 return static_cast<T*>(GetDelegate()); |
59 } | 60 } |
60 }; | 61 }; |
61 | 62 |
62 }; // namespace content | 63 }; // namespace content |
63 | 64 |
64 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_CHILD_PROCESS_HOST_ITERATOR_H_ | 65 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_CHILD_PROCESS_HOST_ITERATOR_H_ |
OLD | NEW |