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

Side by Side Diff: content/browser/media/android/media_throttler.h

Issue 1372203002: Throttle media decoding after excessive Android media server crashes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_BROWSER_MEDIA_ANDROID_MEDIA_THROTTLER_H_
6 #define CONTENT_BROWSER_MEDIA_ANDROID_MEDIA_THROTTLER_H_
7
8 #include <jni.h>
9
10 #include "base/android/scoped_java_ref.h"
11 #include "base/memory/singleton.h"
12
13 namespace content {
14
15 class MediaThrottler {
16 public:
17 // Called to get the singleton MediaThrottler instance.
18 static MediaThrottler* GetInstance();
19
20 // Jni registration.
21 static bool RegisterMediaThrottler(JNIEnv* env);
22
23 virtual ~MediaThrottler();
24
25 // Called to request the permission to decode media data. Returns true if
26 // permitted, or false otherwise.
27 bool RequestToDecodeData();
Tima Vaisburd 2015/09/28 22:09:12 nit: the naming was a little bit confusing for me.
qinmin 2015/09/29 23:16:23 Done.
28
29 // Called when a decode request finishes.
30 void OnDecodeRequestFinished();
31
32 // Resets the throttler to a fresh state.
33 void Reset();
34
35 private:
36 friend struct base::DefaultSingletonTraits<MediaThrottler>;
37 MediaThrottler();
38
39 base::android::ScopedJavaGlobalRef<jobject> j_media_throttler_;
40 DISALLOW_COPY_AND_ASSIGN(MediaThrottler);
41 };
42
43 } // namespace content
44
45 #endif // CONTENT_BROWSER_MEDIA_ANDROID_MEDIA_THROTTLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698