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

Unified Diff: media/base/android/dialog_surface_manager.cc

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
Index: media/base/android/dialog_surface_manager.cc
diff --git a/media/base/android/dialog_surface_manager.cc b/media/base/android/dialog_surface_manager.cc
index ba67ccbc9e17e2615b53894e0df5dd89570a8776..75a9c819836e956a0518a205a2f0dbc4c794ad67 100644
--- a/media/base/android/dialog_surface_manager.cc
+++ b/media/base/android/dialog_surface_manager.cc
@@ -18,6 +18,7 @@
#include "base/strings/string_util.h"
#include "gpu/ipc/common/android/dialog_surface_lookup.h"
#include "jni/DialogSurfaceManagerWrapper_jni.h"
+#include "media/base/android/dialog_surface_callback.h"
#include "media/base/bit_reader.h"
#include "media/base/decrypt_config.h"
@@ -62,17 +63,19 @@ std::unique_ptr<DialogSurfaceHolder> DialogSurfaceManager::CreateSurface(
JNIEnv* env = AttachCurrentThread();
CHECK(env);
- // TODO(liberato): wrap the callback here, and send in place of the nullptr.
- // This was omitted for the first CL.
+ std::unique_ptr<DialogSurfaceCallback> wrapped_callback(
+ new DialogSurfaceCallback(callback));
ScopedJavaGlobalRef<jobject> result(
Java_DialogSurfaceManagerWrapper_createSurface(
- env, j_wrapped_manager_.obj(), pid, frame_id, nullptr,
+ env, j_wrapped_manager_.obj(), pid, frame_id, wrapped_callback->obj(),
config.rect.x(), config.rect.y(), config.rect.width(),
config.rect.height()));
- // NOTE: result is always null right now.
std::unique_ptr<DialogSurfaceHolder> holder;
+ if (result.obj() != nullptr) {
+ holder.reset(new DialogSurfaceHolder(result, std::move(wrapped_callback)));
+ }
return holder;
}
« no previous file with comments | « media/base/android/dialog_surface_holder.cc ('k') | media/base/android/java/src/org/chromium/media/DialogSurfaceCallback.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698