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 #include "content/browser/renderer_host/render_widget_host_impl.h" | 5 #include "content/browser/renderer_host/render_widget_host_impl.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 #include <set> | 8 #include <set> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 | 117 |
118 // Implements the RenderWidgetHostIterator interface. It keeps a list of | 118 // Implements the RenderWidgetHostIterator interface. It keeps a list of |
119 // RenderWidgetHosts, and makes sure it returns a live RenderWidgetHost at each | 119 // RenderWidgetHosts, and makes sure it returns a live RenderWidgetHost at each |
120 // iteration (or NULL if there isn't any left). | 120 // iteration (or NULL if there isn't any left). |
121 class RenderWidgetHostIteratorImpl : public RenderWidgetHostIterator { | 121 class RenderWidgetHostIteratorImpl : public RenderWidgetHostIterator { |
122 public: | 122 public: |
123 RenderWidgetHostIteratorImpl() | 123 RenderWidgetHostIteratorImpl() |
124 : current_index_(0) { | 124 : current_index_(0) { |
125 } | 125 } |
126 | 126 |
127 virtual ~RenderWidgetHostIteratorImpl() { | 127 ~RenderWidgetHostIteratorImpl() override {} |
128 } | |
129 | 128 |
130 void Add(RenderWidgetHost* host) { | 129 void Add(RenderWidgetHost* host) { |
131 hosts_.push_back(RenderWidgetHostID(host->GetProcess()->GetID(), | 130 hosts_.push_back(RenderWidgetHostID(host->GetProcess()->GetID(), |
132 host->GetRoutingID())); | 131 host->GetRoutingID())); |
133 } | 132 } |
134 | 133 |
135 // RenderWidgetHostIterator: | 134 // RenderWidgetHostIterator: |
136 virtual RenderWidgetHost* GetNextHost() override { | 135 RenderWidgetHost* GetNextHost() override { |
137 RenderWidgetHost* host = NULL; | 136 RenderWidgetHost* host = NULL; |
138 while (current_index_ < hosts_.size() && !host) { | 137 while (current_index_ < hosts_.size() && !host) { |
139 RenderWidgetHostID id = hosts_[current_index_]; | 138 RenderWidgetHostID id = hosts_[current_index_]; |
140 host = RenderWidgetHost::FromID(id.first, id.second); | 139 host = RenderWidgetHost::FromID(id.first, id.second); |
141 ++current_index_; | 140 ++current_index_; |
142 } | 141 } |
143 return host; | 142 return host; |
144 } | 143 } |
145 | 144 |
146 private: | 145 private: |
(...skipping 2250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2397 } | 2396 } |
2398 #endif | 2397 #endif |
2399 | 2398 |
2400 SkColorType RenderWidgetHostImpl::PreferredReadbackFormat() { | 2399 SkColorType RenderWidgetHostImpl::PreferredReadbackFormat() { |
2401 if (view_) | 2400 if (view_) |
2402 return view_->PreferredReadbackFormat(); | 2401 return view_->PreferredReadbackFormat(); |
2403 return kN32_SkColorType; | 2402 return kN32_SkColorType; |
2404 } | 2403 } |
2405 | 2404 |
2406 } // namespace content | 2405 } // namespace content |
OLD | NEW |