| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
| 7 #include "base/shared_memory.h" | 7 #include "base/shared_memory.h" |
| 8 #include "base/timer.h" | 8 #include "base/timer.h" |
| 9 #include "content/browser/browser_thread_impl.h" | 9 #include "content/browser/browser_thread_impl.h" |
| 10 #include "content/browser/renderer_host/backing_store.h" | 10 #include "content/browser/renderer_host/backing_store.h" |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 | 89 |
| 90 if (!current_update_buf_) | 90 if (!current_update_buf_) |
| 91 current_update_buf_ = TransportDIB::Create(pixel_size, 0); | 91 current_update_buf_ = TransportDIB::Create(pixel_size, 0); |
| 92 params->bitmap = current_update_buf_->id(); | 92 params->bitmap = current_update_buf_->id(); |
| 93 params->bitmap_rect = gfx::Rect(0, 0, w, h); | 93 params->bitmap_rect = gfx::Rect(0, 0, w, h); |
| 94 params->dx = 0; | 94 params->dx = 0; |
| 95 params->dy = 0; | 95 params->dy = 0; |
| 96 params->copy_rects.push_back(params->bitmap_rect); | 96 params->copy_rects.push_back(params->bitmap_rect); |
| 97 params->view_size = gfx::Size(w, h); | 97 params->view_size = gfx::Size(w, h); |
| 98 params->flags = update_msg_reply_flags_; | 98 params->flags = update_msg_reply_flags_; |
| 99 params->needs_ack = true; |
| 99 } | 100 } |
| 100 | 101 |
| 101 bool RenderWidgetHostProcess::WaitForUpdateMsg(int render_widget_id, | 102 bool RenderWidgetHostProcess::WaitForUpdateMsg(int render_widget_id, |
| 102 const base::TimeDelta& max_delay, | 103 const base::TimeDelta& max_delay, |
| 103 IPC::Message* msg) { | 104 IPC::Message* msg) { |
| 104 if (!update_msg_should_reply_) | 105 if (!update_msg_should_reply_) |
| 105 return false; | 106 return false; |
| 106 | 107 |
| 107 // Construct a fake update reply. | 108 // Construct a fake update reply. |
| 108 ViewHostMsg_UpdateRect_Params params; | 109 ViewHostMsg_UpdateRect_Params params; |
| (...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 740 // Start it again to ensure it still works. | 741 // Start it again to ensure it still works. |
| 741 EXPECT_FALSE(host_->unresponsive_timer_fired()); | 742 EXPECT_FALSE(host_->unresponsive_timer_fired()); |
| 742 host_->StartHangMonitorTimeout(TimeDelta::FromMilliseconds(10)); | 743 host_->StartHangMonitorTimeout(TimeDelta::FromMilliseconds(10)); |
| 743 | 744 |
| 744 // Wait long enough for first timeout and see if it fired. | 745 // Wait long enough for first timeout and see if it fired. |
| 745 MessageLoop::current()->PostDelayedTask(FROM_HERE, | 746 MessageLoop::current()->PostDelayedTask(FROM_HERE, |
| 746 new MessageLoop::QuitTask(), 40); | 747 new MessageLoop::QuitTask(), 40); |
| 747 MessageLoop::current()->Run(); | 748 MessageLoop::current()->Run(); |
| 748 EXPECT_TRUE(host_->unresponsive_timer_fired()); | 749 EXPECT_TRUE(host_->unresponsive_timer_fired()); |
| 749 } | 750 } |
| OLD | NEW |