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

Side by Side Diff: content/browser/renderer_host/render_widget_host_impl.h

Issue 2893773003: Use wakelock mojo interface instead of PowerSaveBlocker in renderer_host. (Closed)
Patch Set: Use wakelock mojo interface instead of PowerSaveBlocker in renderer_host. Created 3 years, 7 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
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 #include "content/public/common/url_constants.h" 46 #include "content/public/common/url_constants.h"
47 #include "ipc/ipc_listener.h" 47 #include "ipc/ipc_listener.h"
48 #include "mojo/public/cpp/bindings/binding.h" 48 #include "mojo/public/cpp/bindings/binding.h"
49 #include "third_party/WebKit/public/platform/WebDisplayMode.h" 49 #include "third_party/WebKit/public/platform/WebDisplayMode.h"
50 #include "ui/base/ime/text_input_mode.h" 50 #include "ui/base/ime/text_input_mode.h"
51 #include "ui/base/ime/text_input_type.h" 51 #include "ui/base/ime/text_input_type.h"
52 #include "ui/events/gesture_detection/gesture_provider_config_helper.h" 52 #include "ui/events/gesture_detection/gesture_provider_config_helper.h"
53 #include "ui/gfx/native_widget_types.h" 53 #include "ui/gfx/native_widget_types.h"
54 #include "ui/latency/latency_info.h" 54 #include "ui/latency/latency_info.h"
55 55
56 #if defined(OS_MACOSX)
57 #include "device/wake_lock/public/interfaces/wake_lock_service.mojom.h"
58 #endif
59
56 class SkBitmap; 60 class SkBitmap;
57 struct FrameHostMsg_HittestData_Params; 61 struct FrameHostMsg_HittestData_Params;
58 struct ViewHostMsg_SelectionBounds_Params; 62 struct ViewHostMsg_SelectionBounds_Params;
59 struct ViewHostMsg_UpdateRect_Params; 63 struct ViewHostMsg_UpdateRect_Params;
60 64
61 namespace blink { 65 namespace blink {
62 class WebInputEvent; 66 class WebInputEvent;
63 class WebMouseEvent; 67 class WebMouseEvent;
64 struct WebCompositionUnderline; 68 struct WebCompositionUnderline;
65 } 69 }
66 70
67 namespace cc { 71 namespace cc {
68 struct BeginFrameAck; 72 struct BeginFrameAck;
69 } // namespace cc 73 } // namespace cc
70 74
71 #if defined(OS_MACOSX)
72 namespace device {
73 class PowerSaveBlocker;
74 } // namespace device
75 #endif
76
77 namespace gfx { 75 namespace gfx {
78 class Image; 76 class Image;
79 class Range; 77 class Range;
80 } 78 }
81 79
82 namespace content { 80 namespace content {
83 81
84 class BrowserAccessibilityManager; 82 class BrowserAccessibilityManager;
85 class InputRouter; 83 class InputRouter;
86 class MockRenderWidgetHost; 84 class MockRenderWidgetHost;
(...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after
753 void LogHangMonitorUnresponsive(); 751 void LogHangMonitorUnresponsive();
754 752
755 // Signals that a frame with token |frame_token| was finished processing. If 753 // Signals that a frame with token |frame_token| was finished processing. If
756 // there are any queued messages belonging to it, they will be processed. 754 // there are any queued messages belonging to it, they will be processed.
757 void DidProcessFrame(uint32_t frame_token); 755 void DidProcessFrame(uint32_t frame_token);
758 756
759 // Once both the frame and its swap messages arrive, we call this method to 757 // Once both the frame and its swap messages arrive, we call this method to
760 // process the messages. Virtual for tests. 758 // process the messages. Virtual for tests.
761 virtual void ProcessSwapMessages(std::vector<IPC::Message> messages); 759 virtual void ProcessSwapMessages(std::vector<IPC::Message> messages);
762 760
761 #if defined(OS_MACOSX)
762 device::mojom::WakeLockService* GetWakeLockService();
763 #endif
764
763 // true if a renderer has once been valid. We use this flag to display a sad 765 // true if a renderer has once been valid. We use this flag to display a sad
764 // tab only when we lose our renderer and not if a paint occurs during 766 // tab only when we lose our renderer and not if a paint occurs during
765 // initialization. 767 // initialization.
766 bool renderer_initialized_; 768 bool renderer_initialized_;
767 769
768 // True if |Destroy()| has been called. 770 // True if |Destroy()| has been called.
769 bool destroyed_; 771 bool destroyed_;
770 772
771 // Our delegate, which wants to know mainly about keyboard events. 773 // Our delegate, which wants to know mainly about keyboard events.
772 // It will remain non-NULL until DetachDelegate() is called. 774 // It will remain non-NULL until DetachDelegate() is called.
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
952 bool monitoring_composition_info_; 954 bool monitoring_composition_info_;
953 955
954 // This is the content_source_id of the latest frame received. This value is 956 // This is the content_source_id of the latest frame received. This value is
955 // compared against current_content_source_id_ to determine whether the 957 // compared against current_content_source_id_ to determine whether the
956 // received frame belongs to the current page. If a frame for the current page 958 // received frame belongs to the current page. If a frame for the current page
957 // does not arrive in time after nagivation, we clear the graphics of the old 959 // does not arrive in time after nagivation, we clear the graphics of the old
958 // page. See RenderWidget::current_content_source_id_ for more information. 960 // page. See RenderWidget::current_content_source_id_ for more information.
959 uint32_t last_received_content_source_id_ = 0; 961 uint32_t last_received_content_source_id_ = 0;
960 962
961 #if defined(OS_MACOSX) 963 #if defined(OS_MACOSX)
962 std::unique_ptr<device::PowerSaveBlocker> power_save_blocker_; 964 device::mojom::WakeLockServicePtr wake_lock_;
963 #endif 965 #endif
964 966
965 // These information are used to verify that the renderer does not misbehave 967 // These information are used to verify that the renderer does not misbehave
966 // when it comes to allocating LocalSurfaceIds. If surface properties change, 968 // when it comes to allocating LocalSurfaceIds. If surface properties change,
967 // a new LocalSurfaceId must be created. 969 // a new LocalSurfaceId must be created.
968 cc::LocalSurfaceId last_local_surface_id_; 970 cc::LocalSurfaceId last_local_surface_id_;
969 RenderWidgetSurfaceProperties last_surface_properties_; 971 RenderWidgetSurfaceProperties last_surface_properties_;
970 972
971 mojo::Binding<cc::mojom::MojoCompositorFrameSink> 973 mojo::Binding<cc::mojom::MojoCompositorFrameSink>
972 compositor_frame_sink_binding_; 974 compositor_frame_sink_binding_;
(...skipping 12 matching lines...) Expand all
985 base::OnceClosure begin_frame_callback_; 987 base::OnceClosure begin_frame_callback_;
986 988
987 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; 989 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_;
988 990
989 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); 991 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl);
990 }; 992 };
991 993
992 } // namespace content 994 } // namespace content
993 995
994 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ 996 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698