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

Unified Diff: media/base/android/dialog_surface_holder.h

Issue 2220623002: DialogSurfaceHolder implementation. Base URL: https://chromium.googlesource.com/chromium/src.git@just_surface_manager
Patch Set: panel => media dialog type Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/base/android/dialog_surface_callback.cc ('k') | media/base/android/dialog_surface_holder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/android/dialog_surface_holder.h
diff --git a/media/base/android/dialog_surface_holder.h b/media/base/android/dialog_surface_holder.h
index 919d6af69141e0b8b51f3344328a6ef2d275ee04..a34fc1ccf3f95240c192d520fcd2cb5a3f5169cd 100644
--- a/media/base/android/dialog_surface_holder.h
+++ b/media/base/android/dialog_surface_holder.h
@@ -22,6 +22,10 @@
#include "ui/gfx/geometry/rect.h"
#include "ui/gl/android/scoped_java_surface.h"
+namespace base {
+class WaitableEvent;
+}
+
namespace media {
class DialogSurfaceCallback;
@@ -45,14 +49,38 @@ class MEDIA_EXPORT DialogSurfaceHolder {
// This may also include pixel format, is_secure, etc.
};
+ // |unwrapped_surface| is the IDialogSurface java instance, which
+ // we will take ownership of. |callback| is the wrapped callback that it will
+ // use to communicate with us (DialogSurfaceCallback).
+ // Note: one generally doesn't want to call this directly. Use
+ // DialogSurfaceManager instead.
+ DialogSurfaceHolder(const base::android::JavaRef<jobject>& unwrapped_surface,
+ std::unique_ptr<DialogSurfaceCallback>&& callback);
+ ~DialogSurfaceHolder();
+
// Schedule a relayout and/or reposition of the surface.
- // void ScheduleLayout(const Config& config);
+ void ScheduleLayout(const Config& config);
// Return the java surface, if any. One should not assume that this is
// available immediately. The callback will be called with SURFACE_CREATED
// when it is available. Of course, it may become unavailable again
// asynchronously, so one must always check.
- // gl::ScopedJavaSurface GetSurface();
+ gl::ScopedJavaSurface GetSurface();
+
+ protected:
+ bool CalledOnValidThread() const;
+
+ private:
+ // Java DialogSurfaceWrapper instance.
+ base::android::ScopedJavaGlobalRef<jobject> j_wrapped_surface_;
+
+ // Callback that's associated with this surface. We maintain ownership of it
+ // so that the native object stays around while we do.
+ std::unique_ptr<DialogSurfaceCallback> wrapped_callback_;
+
+ base::ThreadChecker thread_checker_;
+
+ DISALLOW_COPY_AND_ASSIGN(DialogSurfaceHolder);
};
} // namespace media
« no previous file with comments | « media/base/android/dialog_surface_callback.cc ('k') | media/base/android/dialog_surface_holder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698