OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/devtools/protocol/page_handler.h" | 5 #include "content/browser/devtools/protocol/page_handler.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/base64.h" | 9 #include "base/base64.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
139 void PageHandler::SetClient(std::unique_ptr<Client> client) { | 139 void PageHandler::SetClient(std::unique_ptr<Client> client) { |
140 client_.swap(client); | 140 client_.swap(client); |
141 } | 141 } |
142 | 142 |
143 void PageHandler::Detached() { | 143 void PageHandler::Detached() { |
144 Disable(); | 144 Disable(); |
145 } | 145 } |
146 | 146 |
147 void PageHandler::OnSwapCompositorFrame( | 147 void PageHandler::OnSwapCompositorFrame( |
148 const cc::CompositorFrameMetadata& frame_metadata) { | 148 const cc::CompositorFrameMetadata& frame_metadata) { |
149 last_compositor_frame_metadata_ = frame_metadata; | 149 last_compositor_frame_metadata_ = cc::CompositorFrameMetadata(frame_metadata); |
danakj
2016/06/24 18:35:11
dittos
Fady Samuel
2016/06/24 20:00:24
Done.
| |
150 has_compositor_frame_metadata_ = true; | 150 has_compositor_frame_metadata_ = true; |
151 | 151 |
152 if (screencast_enabled_) | 152 if (screencast_enabled_) |
153 InnerSwapCompositorFrame(); | 153 InnerSwapCompositorFrame(); |
154 color_picker_->OnSwapCompositorFrame(); | 154 color_picker_->OnSwapCompositorFrame(); |
155 } | 155 } |
156 | 156 |
157 void PageHandler::OnSynchronousSwapCompositorFrame( | 157 void PageHandler::OnSynchronousSwapCompositorFrame( |
158 const cc::CompositorFrameMetadata& frame_metadata) { | 158 const cc::CompositorFrameMetadata& frame_metadata) { |
159 last_compositor_frame_metadata_ = has_compositor_frame_metadata_ ? | 159 last_compositor_frame_metadata_ = |
160 next_compositor_frame_metadata_ : frame_metadata; | 160 has_compositor_frame_metadata_ |
161 next_compositor_frame_metadata_ = frame_metadata; | 161 ? cc::CompositorFrameMetadata(next_compositor_frame_metadata_) |
danakj
2016/06/24 18:35:11
dittos
Fady Samuel
2016/06/24 20:00:24
Done.
| |
162 : cc::CompositorFrameMetadata(frame_metadata); | |
163 next_compositor_frame_metadata_ = cc::CompositorFrameMetadata(frame_metadata); | |
danakj
2016/06/24 18:35:11
A copy needs to be made here tho, so if you make i
Fady Samuel
2016/06/24 20:00:24
I made the above Clone() and using std::move on ht
| |
162 has_compositor_frame_metadata_ = true; | 164 has_compositor_frame_metadata_ = true; |
163 | 165 |
164 if (screencast_enabled_) | 166 if (screencast_enabled_) |
165 InnerSwapCompositorFrame(); | 167 InnerSwapCompositorFrame(); |
166 color_picker_->OnSwapCompositorFrame(); | 168 color_picker_->OnSwapCompositorFrame(); |
167 } | 169 } |
168 | 170 |
169 void PageHandler::Observe(int type, | 171 void PageHandler::Observe(int type, |
170 const NotificationSource& source, | 172 const NotificationSource& source, |
171 const NotificationDetails& details) { | 173 const NotificationDetails& details) { |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
514 | 516 |
515 void PageHandler::OnColorPicked(int r, int g, int b, int a) { | 517 void PageHandler::OnColorPicked(int r, int g, int b, int a) { |
516 scoped_refptr<dom::RGBA> color = | 518 scoped_refptr<dom::RGBA> color = |
517 dom::RGBA::Create()->set_r(r)->set_g(g)->set_b(b)->set_a(a); | 519 dom::RGBA::Create()->set_r(r)->set_g(g)->set_b(b)->set_a(a); |
518 client_->ColorPicked(ColorPickedParams::Create()->set_color(color)); | 520 client_->ColorPicked(ColorPickedParams::Create()->set_color(color)); |
519 } | 521 } |
520 | 522 |
521 } // namespace page | 523 } // namespace page |
522 } // namespace devtools | 524 } // namespace devtools |
523 } // namespace content | 525 } // namespace content |
OLD | NEW |