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

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: Fix android build 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 4340c4e95f5ae5ec64f0b5877312f4fd90937c1e..5c03a0afcb3da8116e6961d6dfe22c7715c5c4ab 100644
--- a/mojo/services/native_viewport/native_viewport_android.cc
+++ b/mojo/services/native_viewport/native_viewport_android.cc
@@ -13,8 +13,10 @@
namespace mojo {
namespace services {
-NativeViewportAndroid::NativeViewportAndroid(NativeViewportDelegate* delegate)
+NativeViewportAndroid::NativeViewportAndroid(shell::Context* context,
+ NativeViewportDelegate* delegate)
: delegate_(delegate),
+ context_(context),
window_(NULL),
id_generator_(0),
weak_factory_(this) {
@@ -64,6 +66,17 @@ gfx::Size NativeViewportAndroid::GetSize() {
return size_;
}
+void NativeViewportAndroid::Init() {
+ 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?
@@ -75,19 +88,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
« no previous file with comments | « mojo/services/native_viewport/native_viewport_android.h ('k') | mojo/services/native_viewport/native_viewport_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698