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

Side by Side Diff: services/ui/launcher/launch_instance.cc

Issue 1997513002: Mozart: Generalize frame scheduling. (Closed) Base URL: git@github.com:domokit/mojo.git@moz-jank2
Patch Set: add comments Created 4 years, 7 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
« no previous file with comments | « services/gfx/compositor/tests/scheduling_apptest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "services/ui/launcher/launch_instance.h" 5 #include "services/ui/launcher/launch_instance.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/trace_event/trace_event.h" 10 #include "base/trace_event/trace_event.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 viewport_event_dispatcher_binding_.Bind(GetProxy(&dispatcher)); 55 viewport_event_dispatcher_binding_.Bind(GetProxy(&dispatcher));
56 viewport_->SetEventDispatcher(dispatcher.Pass()); 56 viewport_->SetEventDispatcher(dispatcher.Pass());
57 57
58 // Match the Nexus 5 aspect ratio initially. 58 // Match the Nexus 5 aspect ratio initially.
59 auto size = mojo::Size::New(); 59 auto size = mojo::Size::New();
60 size->width = 320; 60 size->width = 320;
61 size->height = 640; 61 size->height = 640;
62 62
63 auto requested_configuration = mojo::SurfaceConfiguration::New(); 63 auto requested_configuration = mojo::SurfaceConfiguration::New();
64 viewport_->Create( 64 viewport_->Create(
65 size.Clone(), requested_configuration.Pass(), 65 size.Pass(), requested_configuration.Pass(),
66 base::Bind(&LaunchInstance::OnViewportCreated, base::Unretained(this))); 66 base::Bind(&LaunchInstance::OnViewportCreated, base::Unretained(this)));
67 } 67 }
68 68
69 void LaunchInstance::OnViewportConnectionError() { 69 void LaunchInstance::OnViewportConnectionError() {
70 LOG(ERROR) << "Exiting due to viewport connection error."; 70 LOG(ERROR) << "Exiting due to viewport connection error.";
71 shutdown_callback_.Run(); 71 shutdown_callback_.Run();
72 } 72 }
73 73
74 void LaunchInstance::OnViewportCreated(mojo::ViewportMetricsPtr metrics) { 74 void LaunchInstance::OnViewportCreated(mojo::ViewportMetricsPtr metrics) {
75 viewport_->Show(); 75 viewport_->Show();
(...skipping 23 matching lines...) Expand all
99 } 99 }
100 100
101 void LaunchInstance::OnEvent(mojo::EventPtr event, 101 void LaunchInstance::OnEvent(mojo::EventPtr event,
102 const mojo::Callback<void()>& callback) { 102 const mojo::Callback<void()>& callback) {
103 if (view_tree_) 103 if (view_tree_)
104 view_tree_->DispatchEvent(event.Pass()); 104 view_tree_->DispatchEvent(event.Pass());
105 callback.Run(); 105 callback.Run();
106 } 106 }
107 107
108 } // namespace launcher 108 } // namespace launcher
OLDNEW
« no previous file with comments | « services/gfx/compositor/tests/scheduling_apptest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698