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

Unified Diff: mojo/services/native_viewport/native_viewport_android.cc

Issue 65883002: mojo_shell crashes on Linux (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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: mojo/services/native_viewport/native_viewport_android.cc
diff --git a/mojo/services/native_viewport/native_viewport_android.cc b/mojo/services/native_viewport/native_viewport_android.cc
index fbb02f5f008f2d23087668df619f794c84f41f95..e707940f87d632ed68993a8d3c80eb0d9ca72cf7 100644
--- a/mojo/services/native_viewport/native_viewport_android.cc
+++ b/mojo/services/native_viewport/native_viewport_android.cc
@@ -11,8 +11,10 @@
namespace mojo {
namespace services {
-NativeViewportAndroid::NativeViewportAndroid(NativeViewportDelegate* delegate)
- : delegate_(delegate),
+NativeViewportAndroid::NativeViewportAndroid(shell::Context* context,
+ NativeViewportDelegate* delegate)
+ : context_(context),
+ delegate_(delegate),
window_(NULL),
weak_factory_(this) {
}
@@ -47,6 +49,17 @@ gfx::Size NativeViewportAndroid::GetSize() {
return size_;
}
+void NativeViewportAndroid::Open() {
+ MojoViewportInit* init = new MojoViewportInit();
+ init->ui_runner = context_->task_runners()->ui_runner();
+ init->native_viewport = GetWeakPtr();
+
+ context_->task_runners()->java_runner()->PostTask(FROM_HERE,
+ base::Bind(MojoViewport::CreateForActivity,
+ context_->activity(),
+ init));
+}
+
void NativeViewportAndroid::Close() {
// TODO(beng): close activity containing MojoView?
@@ -58,19 +71,8 @@ void NativeViewportAndroid::Close() {
scoped_ptr<NativeViewport> NativeViewport::Create(
shell::Context* context,
NativeViewportDelegate* delegate) {
- scoped_ptr<NativeViewportAndroid> native_viewport(
- new NativeViewportAndroid(delegate));
-
- MojoViewportInit* init = new MojoViewportInit();
- init->ui_runner = context->task_runners()->ui_runner();
- init->native_viewport = native_viewport->GetWeakPtr();
-
- context->task_runners()->java_runner()->PostTask(FROM_HERE,
- base::Bind(MojoViewport::CreateForActivity,
- context->activity(),
- init));
-
- return scoped_ptr<NativeViewport>(native_viewport.Pass());
+ return scoped_ptr<NativeViewport>(
+ new NativeViewportAndroid(context, delegate)).Pass();
}
} // namespace services

Powered by Google App Engine
This is Rietveld 408576698