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

Unified Diff: mojo/services/native_viewport/native_viewport_mac.mm

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_mac.mm
diff --git a/mojo/services/native_viewport/native_viewport_mac.mm b/mojo/services/native_viewport/native_viewport_mac.mm
index e60774fdf20ffcbde32b4f5123c338d24fffeeae..74f55a9a36bfe15e8ee5646e744fc540c0a51b8b 100644
--- a/mojo/services/native_viewport/native_viewport_mac.mm
+++ b/mojo/services/native_viewport/native_viewport_mac.mm
@@ -20,15 +20,6 @@ class NativeViewportMac : public NativeViewport {
: delegate_(delegate),
window_(nil),
rect_(10, 10, 500, 500) {
- [NSApplication sharedApplication];
-
- window_ = [[NSWindow alloc]
- initWithContentRect:NSRectFromCGRect(rect_.ToCGRect())
- styleMask:NSTitledWindowMask
- backing:NSBackingStoreBuffered
- defer:NO];
- [window_ orderFront:nil];
- delegate_->OnAcceleratedWidgetAvailable([window_ contentView]);
}
virtual ~NativeViewportMac() {
@@ -42,6 +33,18 @@ class NativeViewportMac : public NativeViewport {
return rect_.size();
}
+ virtual void Init() OVERRIDE {
+ [NSApplication sharedApplication];
+
+ window_ = [[NSWindow alloc]
+ initWithContentRect:NSRectFromCGRect(rect_.ToCGRect())
+ styleMask:NSTitledWindowMask
+ backing:NSBackingStoreBuffered
+ defer:NO];
+ [window_ orderFront:nil];
+ delegate_->OnAcceleratedWidgetAvailable([window_ contentView]);
+ }
+
virtual void Close() OVERRIDE {
// TODO(beng): perform this in response to NSWindow destruction.
delegate_->OnDestroyed();
« no previous file with comments | « mojo/services/native_viewport/native_viewport_controller.cc ('k') | mojo/services/native_viewport/native_viewport_stub.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698