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 |
11 #include "base/auto_reset.h" | 11 #include "base/auto_reset.h" |
12 #include "base/bind.h" | 12 #include "base/bind.h" |
13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
14 #include "base/containers/hash_tables.h" | 14 #include "base/containers/hash_tables.h" |
15 #include "base/i18n/rtl.h" | 15 #include "base/i18n/rtl.h" |
16 #include "base/lazy_instance.h" | 16 #include "base/lazy_instance.h" |
17 #include "base/message_loop/message_loop.h" | 17 #include "base/location.h" |
18 #include "base/metrics/field_trial.h" | 18 #include "base/metrics/field_trial.h" |
19 #include "base/metrics/histogram.h" | 19 #include "base/metrics/histogram.h" |
| 20 #include "base/single_thread_task_runner.h" |
20 #include "base/strings/string_number_conversions.h" | 21 #include "base/strings/string_number_conversions.h" |
21 #include "base/strings/utf_string_conversions.h" | 22 #include "base/strings/utf_string_conversions.h" |
22 #include "base/thread_task_runner_handle.h" | 23 #include "base/thread_task_runner_handle.h" |
23 #include "base/trace_event/trace_event.h" | 24 #include "base/trace_event/trace_event.h" |
24 #include "cc/base/switches.h" | 25 #include "cc/base/switches.h" |
25 #include "cc/output/compositor_frame.h" | 26 #include "cc/output/compositor_frame.h" |
26 #include "cc/output/compositor_frame_ack.h" | 27 #include "cc/output/compositor_frame_ack.h" |
27 #include "content/browser/accessibility/accessibility_mode_helper.h" | 28 #include "content/browser/accessibility/accessibility_mode_helper.h" |
28 #include "content/browser/accessibility/browser_accessibility_state_impl.h" | 29 #include "content/browser/accessibility/browser_accessibility_state_impl.h" |
29 #include "content/browser/bad_message.h" | 30 #include "content/browser/bad_message.h" |
(...skipping 1506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1536 } | 1537 } |
1537 | 1538 |
1538 DCHECK(!params.view_size.IsEmpty()); | 1539 DCHECK(!params.view_size.IsEmpty()); |
1539 | 1540 |
1540 DidUpdateBackingStore(params, paint_start); | 1541 DidUpdateBackingStore(params, paint_start); |
1541 | 1542 |
1542 if (auto_resize_enabled_) { | 1543 if (auto_resize_enabled_) { |
1543 bool post_callback = new_auto_size_.IsEmpty(); | 1544 bool post_callback = new_auto_size_.IsEmpty(); |
1544 new_auto_size_ = params.view_size; | 1545 new_auto_size_ = params.view_size; |
1545 if (post_callback) { | 1546 if (post_callback) { |
1546 base::MessageLoop::current()->PostTask( | 1547 base::ThreadTaskRunnerHandle::Get()->PostTask( |
1547 FROM_HERE, | 1548 FROM_HERE, base::Bind(&RenderWidgetHostImpl::DelayedAutoResized, |
1548 base::Bind(&RenderWidgetHostImpl::DelayedAutoResized, | 1549 weak_factory_.GetWeakPtr())); |
1549 weak_factory_.GetWeakPtr())); | |
1550 } | 1550 } |
1551 } | 1551 } |
1552 | 1552 |
1553 // Log the time delta for processing a paint message. On platforms that don't | 1553 // Log the time delta for processing a paint message. On platforms that don't |
1554 // support asynchronous painting, this is equivalent to | 1554 // support asynchronous painting, this is equivalent to |
1555 // MPArch.RWH_TotalPaintTime. | 1555 // MPArch.RWH_TotalPaintTime. |
1556 TimeDelta delta = TimeTicks::Now() - paint_start; | 1556 TimeDelta delta = TimeTicks::Now() - paint_start; |
1557 UMA_HISTOGRAM_TIMES("MPArch.RWH_OnMsgUpdateRect", delta); | 1557 UMA_HISTOGRAM_TIMES("MPArch.RWH_OnMsgUpdateRect", delta); |
1558 } | 1558 } |
1559 | 1559 |
(...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2120 } | 2120 } |
2121 | 2121 |
2122 #if defined(OS_WIN) | 2122 #if defined(OS_WIN) |
2123 gfx::NativeViewAccessible | 2123 gfx::NativeViewAccessible |
2124 RenderWidgetHostImpl::GetParentNativeViewAccessible() { | 2124 RenderWidgetHostImpl::GetParentNativeViewAccessible() { |
2125 return delegate_ ? delegate_->GetParentNativeViewAccessible() : NULL; | 2125 return delegate_ ? delegate_->GetParentNativeViewAccessible() : NULL; |
2126 } | 2126 } |
2127 #endif | 2127 #endif |
2128 | 2128 |
2129 } // namespace content | 2129 } // namespace content |
OLD | NEW |