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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <list> | 9 #include <list> |
10 | 10 |
11 #include "content/common/content_export.h" | 11 #include "content/common/content_export.h" |
12 #include "content/public/common/process_type.h" | 12 #include "content/public/common/process_type.h" |
13 | 13 |
14 class BrowserChildProcessHost; | 14 class BrowserChildProcessHostImpl; |
15 | 15 |
16 namespace IPC { | 16 namespace IPC { |
17 class Message; | 17 class Message; |
18 } | 18 } |
19 | 19 |
20 namespace content { | 20 namespace content { |
21 | 21 |
22 class BrowserChildProcessHostDelegate; | 22 class BrowserChildProcessHostDelegate; |
23 struct ChildProcessData; | 23 struct ChildProcessData; |
24 | 24 |
(...skipping 10 matching lines...) Expand all Loading... |
35 // Done() returns false. | 35 // Done() returns false. |
36 bool operator++(); | 36 bool operator++(); |
37 bool Done(); | 37 bool Done(); |
38 const ChildProcessData& GetData(); | 38 const ChildProcessData& GetData(); |
39 bool Send(IPC::Message* message); | 39 bool Send(IPC::Message* message); |
40 BrowserChildProcessHostDelegate* GetDelegate(); | 40 BrowserChildProcessHostDelegate* GetDelegate(); |
41 | 41 |
42 private: | 42 private: |
43 bool all_; | 43 bool all_; |
44 content::ProcessType type_; | 44 content::ProcessType type_; |
45 std::list<BrowserChildProcessHost*>::iterator iterator_; | 45 std::list<BrowserChildProcessHostImpl*>::iterator iterator_; |
46 }; | 46 }; |
47 | 47 |
48 // Helper class so that subclasses of BrowserChildProcessHostDelegate can be | 48 // Helper class so that subclasses of BrowserChildProcessHostDelegate can be |
49 // iterated with no casting needing. Note that because of the components build, | 49 // iterated with no casting needing. Note that because of the components build, |
50 // this class can only be used by BCPHD implementations that live in content, | 50 // this class can only be used by BCPHD implementations that live in content, |
51 // otherwise link errors will result. | 51 // otherwise link errors will result. |
52 template <class T> | 52 template <class T> |
53 class CONTENT_EXPORT BrowserChildProcessHostTypeIterator | 53 class CONTENT_EXPORT BrowserChildProcessHostTypeIterator |
54 : public BrowserChildProcessHostIterator { | 54 : public BrowserChildProcessHostIterator { |
55 public: | 55 public: |
56 explicit BrowserChildProcessHostTypeIterator(content::ProcessType type) | 56 explicit BrowserChildProcessHostTypeIterator(content::ProcessType type) |
57 : BrowserChildProcessHostIterator(type) {} | 57 : BrowserChildProcessHostIterator(type) {} |
58 T* operator->() { | 58 T* operator->() { |
59 return static_cast<T*>(GetDelegate()); | 59 return static_cast<T*>(GetDelegate()); |
60 } | 60 } |
61 T* operator*() { | 61 T* operator*() { |
62 return static_cast<T*>(GetDelegate()); | 62 return static_cast<T*>(GetDelegate()); |
63 } | 63 } |
64 }; | 64 }; |
65 | 65 |
66 }; // namespace content | 66 }; // namespace content |
67 | 67 |
68 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_CHILD_PROCESS_HOST_ITERATOR_H_ | 68 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_CHILD_PROCESS_HOST_ITERATOR_H_ |
OLD | NEW |