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

Side by Side Diff: content/renderer/media/renderer_webmediaplayer_delegate.h

Issue 2820643002: Decouple some graphics-related IsLowEndDevice() policies for 1GB devices. (Closed)
Patch Set: Rebase Created 3 years, 8 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_RENDERER_MEDIA_RENDERER_WEBMEDIAPLAYER_DELEGATE_H_ 5 #ifndef CONTENT_RENDERER_MEDIA_RENDERER_WEBMEDIAPLAYER_DELEGATE_H_
6 #define CONTENT_RENDERER_MEDIA_RENDERER_WEBMEDIAPLAYER_DELEGATE_H_ 6 #define CONTENT_RENDERER_MEDIA_RENDERER_WEBMEDIAPLAYER_DELEGATE_H_
7 7
8 #include <map> 8 #include <map>
9 #include <memory> 9 #include <memory>
10 #include <set> 10 #include <set>
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 bool IsStale(int player_id) override; 59 bool IsStale(int player_id) override;
60 void SetIsEffectivelyFullscreen(int player_id, bool is_fullscreen) override; 60 void SetIsEffectivelyFullscreen(int player_id, bool is_fullscreen) override;
61 61
62 // content::RenderFrameObserver overrides. 62 // content::RenderFrameObserver overrides.
63 void WasHidden() override; 63 void WasHidden() override;
64 void WasShown() override; 64 void WasShown() override;
65 bool OnMessageReceived(const IPC::Message& msg) override; 65 bool OnMessageReceived(const IPC::Message& msg) override;
66 void OnDestruct() override; 66 void OnDestruct() override;
67 67
68 // Zeros out |idle_cleanup_interval_|, sets |idle_timeout_| to |idle_timeout|, 68 // Zeros out |idle_cleanup_interval_|, sets |idle_timeout_| to |idle_timeout|,
69 // and |is_low_end_device_| to |is_low_end_device|. A zero cleanup interval 69 // and |is_jelly_bean_| to |is_jelly_bean|. A zero cleanup interval
70 // will cause the idle timer to run with each run of the message loop. 70 // will cause the idle timer to run with each run of the message loop.
71 void SetIdleCleanupParamsForTesting(base::TimeDelta idle_timeout, 71 void SetIdleCleanupParamsForTesting(base::TimeDelta idle_timeout,
72 base::TickClock* tick_clock, 72 base::TickClock* tick_clock,
73 bool is_low_end_device); 73 bool is_jelly_bean);
74 bool IsIdleCleanupTimerRunningForTesting() const; 74 bool IsIdleCleanupTimerRunningForTesting() const;
75 75
76 // Note: Does not call OnFrameHidden()/OnFrameShown(). 76 // Note: Does not call OnFrameHidden()/OnFrameShown().
77 void SetFrameHiddenForTesting(bool is_hidden); 77 void SetFrameHiddenForTesting(bool is_hidden);
78 78
79 friend class RendererWebMediaPlayerDelegateTest; 79 friend class RendererWebMediaPlayerDelegateTest;
80 80
81 private: 81 private:
82 void OnMediaDelegatePause(int player_id); 82 void OnMediaDelegatePause(int player_id);
83 void OnMediaDelegatePlay(int player_id); 83 void OnMediaDelegatePlay(int player_id);
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 base::TimeTicks background_video_start_time_; 138 base::TimeTicks background_video_start_time_;
139 #endif // OS_ANDROID 139 #endif // OS_ANDROID
140 140
141 // The currently playing local videos. Used to determine whether 141 // The currently playing local videos. Used to determine whether
142 // OnMediaDelegatePlay() should allow the videos to play in the background or 142 // OnMediaDelegatePlay() should allow the videos to play in the background or
143 // not. 143 // not.
144 std::set<int> playing_videos_; 144 std::set<int> playing_videos_;
145 145
146 // Determined at construction time based on system information; determines 146 // Determined at construction time based on system information; determines
147 // when the idle cleanup timer should be fired more aggressively. 147 // when the idle cleanup timer should be fired more aggressively.
148 bool is_low_end_device_; 148 bool is_jelly_bean_;
149 149
150 DISALLOW_COPY_AND_ASSIGN(RendererWebMediaPlayerDelegate); 150 DISALLOW_COPY_AND_ASSIGN(RendererWebMediaPlayerDelegate);
151 }; 151 };
152 152
153 } // namespace media 153 } // namespace media
154 154
155 #endif // CONTENT_RENDERER_MEDIA_RENDERER_WEBMEDIAPLAYER_DELEGATE_H_ 155 #endif // CONTENT_RENDERER_MEDIA_RENDERER_WEBMEDIAPLAYER_DELEGATE_H_
OLDNEW
« no previous file with comments | « content/renderer/gpu/render_widget_compositor.cc ('k') | content/renderer/media/renderer_webmediaplayer_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698