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/public/test/browser_test_utils.h" | 5 #include "content/public/test/browser_test_utils.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <tuple> | 8 #include <tuple> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 1151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1162 last_metadata_ = metadata; | 1162 last_metadata_ = metadata; |
1163 if (frames_to_wait_ == 0) | 1163 if (frames_to_wait_ == 0) |
1164 quit_.Run(); | 1164 quit_.Run(); |
1165 } | 1165 } |
1166 | 1166 |
1167 bool FrameWatcher::OnMessageReceived(const IPC::Message& message) { | 1167 bool FrameWatcher::OnMessageReceived(const IPC::Message& message) { |
1168 if (message.type() == ViewHostMsg_SwapCompositorFrame::ID) { | 1168 if (message.type() == ViewHostMsg_SwapCompositorFrame::ID) { |
1169 ViewHostMsg_SwapCompositorFrame::Param param; | 1169 ViewHostMsg_SwapCompositorFrame::Param param; |
1170 if (!ViewHostMsg_SwapCompositorFrame::Read(&message, ¶m)) | 1170 if (!ViewHostMsg_SwapCompositorFrame::Read(&message, ¶m)) |
1171 return false; | 1171 return false; |
1172 std::unique_ptr<cc::CompositorFrame> frame(new cc::CompositorFrame); | 1172 std::unique_ptr<cc::CompositorFrame> frame(std::move(std::get<1>(param))); |
1173 std::get<1>(param).AssignTo(frame.get()); | |
1174 | 1173 |
1175 BrowserThread::PostTask( | 1174 BrowserThread::PostTask( |
1176 BrowserThread::UI, FROM_HERE, | 1175 BrowserThread::UI, FROM_HERE, |
1177 base::Bind(&FrameWatcher::ReceivedFrameSwap, this, frame->metadata)); | 1176 base::Bind(&FrameWatcher::ReceivedFrameSwap, this, frame->metadata)); |
1178 } | 1177 } |
1179 return false; | 1178 return false; |
1180 } | 1179 } |
1181 | 1180 |
1182 void FrameWatcher::AttachTo(WebContents* web_contents) { | 1181 void FrameWatcher::AttachTo(WebContents* web_contents) { |
1183 DCHECK(web_contents); | 1182 DCHECK(web_contents); |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1274 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 1273 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
1275 if (ack_result_ != INPUT_EVENT_ACK_STATE_UNKNOWN) | 1274 if (ack_result_ != INPUT_EVENT_ACK_STATE_UNKNOWN) |
1276 return ack_result_; | 1275 return ack_result_; |
1277 base::RunLoop run_loop; | 1276 base::RunLoop run_loop; |
1278 base::AutoReset<base::Closure> reset_quit(&quit_, run_loop.QuitClosure()); | 1277 base::AutoReset<base::Closure> reset_quit(&quit_, run_loop.QuitClosure()); |
1279 run_loop.Run(); | 1278 run_loop.Run(); |
1280 return ack_result_; | 1279 return ack_result_; |
1281 } | 1280 } |
1282 | 1281 |
1283 } // namespace content | 1282 } // namespace content |
OLD | NEW |