Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(290)

Side by Side Diff: content/renderer/render_widget.cc

Issue 1784743002: Migrate *-ime-thread switches to feature API (Closed) Base URL: https://chromium.googlesource.com/a/chromium/src.git@2661
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/renderer/render_widget.h" 5 #include "content/renderer/render_widget.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
11 #include "base/command_line.h" 11 #include "base/command_line.h"
12 #include "base/feature_list.h"
12 #include "base/logging.h" 13 #include "base/logging.h"
13 #include "base/macros.h" 14 #include "base/macros.h"
14 #include "base/memory/scoped_ptr.h" 15 #include "base/memory/scoped_ptr.h"
15 #include "base/memory/singleton.h" 16 #include "base/memory/singleton.h"
16 #include "base/message_loop/message_loop.h" 17 #include "base/message_loop/message_loop.h"
17 #include "base/metrics/histogram.h" 18 #include "base/metrics/histogram.h"
18 #include "base/stl_util.h" 19 #include "base/stl_util.h"
19 #include "base/strings/utf_string_conversions.h" 20 #include "base/strings/utf_string_conversions.h"
20 #include "base/sys_info.h" 21 #include "base/sys_info.h"
21 #include "base/trace_event/trace_event.h" 22 #include "base/trace_event/trace_event.h"
22 #include "base/trace_event/trace_event_synthetic_delay.h" 23 #include "base/trace_event/trace_event_synthetic_delay.h"
23 #include "build/build_config.h" 24 #include "build/build_config.h"
24 #include "cc/base/switches.h" 25 #include "cc/base/switches.h"
25 #include "cc/debug/benchmark_instrumentation.h" 26 #include "cc/debug/benchmark_instrumentation.h"
26 #include "cc/output/output_surface.h" 27 #include "cc/output/output_surface.h"
27 #include "cc/scheduler/begin_frame_source.h" 28 #include "cc/scheduler/begin_frame_source.h"
28 #include "cc/trees/layer_tree_host.h" 29 #include "cc/trees/layer_tree_host.h"
29 #include "components/scheduler/renderer/render_widget_scheduling_state.h" 30 #include "components/scheduler/renderer/render_widget_scheduling_state.h"
30 #include "components/scheduler/renderer/renderer_scheduler.h" 31 #include "components/scheduler/renderer/renderer_scheduler.h"
31 #include "content/child/npapi/webplugin.h" 32 #include "content/child/npapi/webplugin.h"
32 #include "content/common/content_switches_internal.h" 33 #include "content/common/content_switches_internal.h"
33 #include "content/common/gpu/client/context_provider_command_buffer.h" 34 #include "content/common/gpu/client/context_provider_command_buffer.h"
34 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" 35 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h"
35 #include "content/common/gpu/gpu_process_launch_causes.h" 36 #include "content/common/gpu/gpu_process_launch_causes.h"
36 #include "content/common/input/synthetic_gesture_packet.h" 37 #include "content/common/input/synthetic_gesture_packet.h"
37 #include "content/common/input/web_input_event_traits.h" 38 #include "content/common/input/web_input_event_traits.h"
38 #include "content/common/input_messages.h" 39 #include "content/common/input_messages.h"
39 #include "content/common/swapped_out_messages.h" 40 #include "content/common/swapped_out_messages.h"
40 #include "content/common/view_messages.h" 41 #include "content/common/view_messages.h"
42 #include "content/public/common/content_features.h"
41 #include "content/public/common/content_switches.h" 43 #include "content/public/common/content_switches.h"
42 #include "content/public/common/context_menu_params.h" 44 #include "content/public/common/context_menu_params.h"
43 #include "content/renderer/cursor_utils.h" 45 #include "content/renderer/cursor_utils.h"
44 #include "content/renderer/devtools/render_widget_screen_metrics_emulator.h" 46 #include "content/renderer/devtools/render_widget_screen_metrics_emulator.h"
45 #include "content/renderer/external_popup_menu.h" 47 #include "content/renderer/external_popup_menu.h"
46 #include "content/renderer/gpu/compositor_output_surface.h" 48 #include "content/renderer/gpu/compositor_output_surface.h"
47 #include "content/renderer/gpu/delegated_compositor_output_surface.h" 49 #include "content/renderer/gpu/delegated_compositor_output_surface.h"
48 #include "content/renderer/gpu/frame_swap_message_queue.h" 50 #include "content/renderer/gpu/frame_swap_message_queue.h"
49 #include "content/renderer/gpu/mailbox_output_surface.h" 51 #include "content/renderer/gpu/mailbox_output_surface.h"
50 #include "content/renderer/gpu/queue_message_swap_promise.h" 52 #include "content/renderer/gpu/queue_message_swap_promise.h"
(...skipping 1666 matching lines...) Expand 10 before | Expand all | Expand 10 after
1717 void RenderWidget::set_next_paint_is_resize_ack() { 1719 void RenderWidget::set_next_paint_is_resize_ack() {
1718 next_paint_flags_ |= ViewHostMsg_UpdateRect_Flags::IS_RESIZE_ACK; 1720 next_paint_flags_ |= ViewHostMsg_UpdateRect_Flags::IS_RESIZE_ACK;
1719 } 1721 }
1720 1722
1721 void RenderWidget::set_next_paint_is_repaint_ack() { 1723 void RenderWidget::set_next_paint_is_repaint_ack() {
1722 next_paint_flags_ |= ViewHostMsg_UpdateRect_Flags::IS_REPAINT_ACK; 1724 next_paint_flags_ |= ViewHostMsg_UpdateRect_Flags::IS_REPAINT_ACK;
1723 } 1725 }
1724 1726
1725 bool RenderWidget::IsUsingImeThread() { 1727 bool RenderWidget::IsUsingImeThread() {
1726 #if defined(OS_ANDROID) 1728 #if defined(OS_ANDROID)
1727 return base::CommandLine::ForCurrentProcess()->HasSwitch( 1729 return base::FeatureList::IsEnabled(features::kImeThread);
1728 switches::kEnableImeThread) &&
1729 !base::CommandLine::ForCurrentProcess()->HasSwitch(
1730 switches::kDisableImeThread);
1731 #else 1730 #else
1732 return false; 1731 return false;
1733 #endif 1732 #endif
1734 } 1733 }
1735 1734
1736 void RenderWidget::OnImeEventGuardStart(ImeEventGuard* guard) { 1735 void RenderWidget::OnImeEventGuardStart(ImeEventGuard* guard) {
1737 if (!ime_event_guard_) 1736 if (!ime_event_guard_)
1738 ime_event_guard_ = guard; 1737 ime_event_guard_ = guard;
1739 } 1738 }
1740 1739
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
2123 } 2122 }
2124 2123
2125 float RenderWidget::GetOriginalDeviceScaleFactor() const { 2124 float RenderWidget::GetOriginalDeviceScaleFactor() const {
2126 return 2125 return
2127 screen_metrics_emulator_ ? 2126 screen_metrics_emulator_ ?
2128 screen_metrics_emulator_->original_screen_info().deviceScaleFactor : 2127 screen_metrics_emulator_->original_screen_info().deviceScaleFactor :
2129 device_scale_factor_; 2128 device_scale_factor_;
2130 } 2129 }
2131 2130
2132 } // namespace content 2131 } // namespace content
OLDNEW
« no previous file with comments | « content/public/common/content_switches.cc ('k') | testing/variations/fieldtrial_testing_config_android.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698