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

Side by Side Diff: mojo/examples/sample_app/sample_app.cc

Issue 372273004: Shutdown cleanup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stdio.h> 5 #include <stdio.h>
6 #include <string> 6 #include <string>
7 7
8 #include "mojo/examples/sample_app/gles2_client_impl.h" 8 #include "mojo/examples/sample_app/gles2_client_impl.h"
9 #include "mojo/public/cpp/application/application_connection.h" 9 #include "mojo/public/cpp/application/application_connection.h"
10 #include "mojo/public/cpp/application/application_delegate.h" 10 #include "mojo/public/cpp/application/application_delegate.h"
(...skipping 30 matching lines...) Expand all
41 viewport_->Show(); 41 viewport_->Show();
42 42
43 CommandBufferPtr command_buffer; 43 CommandBufferPtr command_buffer;
44 viewport_->CreateGLES2Context(Get(&command_buffer)); 44 viewport_->CreateGLES2Context(Get(&command_buffer));
45 gles2_client_.reset(new GLES2ClientImpl(command_buffer.Pass())); 45 gles2_client_.reset(new GLES2ClientImpl(command_buffer.Pass()));
46 } 46 }
47 47
48 virtual void OnCreated() MOJO_OVERRIDE { 48 virtual void OnCreated() MOJO_OVERRIDE {
49 } 49 }
50 50
51 virtual void OnDestroyed() MOJO_OVERRIDE { 51 virtual void OnDestroyed(
52 const mojo::Callback<void()>& callback) MOJO_OVERRIDE {
52 RunLoop::current()->Quit(); 53 RunLoop::current()->Quit();
54 callback.Run();
53 } 55 }
54 56
55 virtual void OnBoundsChanged(RectPtr bounds) MOJO_OVERRIDE { 57 virtual void OnBoundsChanged(RectPtr bounds) MOJO_OVERRIDE {
56 assert(bounds); 58 assert(bounds);
57 SizePtr size(Size::New()); 59 SizePtr size(Size::New());
58 size->width = bounds->width; 60 size->width = bounds->width;
59 size->height = bounds->height; 61 size->height = bounds->height;
60 gles2_client_->SetSize(*size); 62 gles2_client_->SetSize(*size);
61 } 63 }
62 64
(...skipping 14 matching lines...) Expand all
77 }; 79 };
78 80
79 } // namespace examples 81 } // namespace examples
80 82
81 // static 83 // static
82 ApplicationDelegate* ApplicationDelegate::Create() { 84 ApplicationDelegate* ApplicationDelegate::Create() {
83 return new examples::SampleApp(); 85 return new examples::SampleApp();
84 } 86 }
85 87
86 } // namespace mojo 88 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698