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

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

Issue 606883002: Add a headless configuration to Mojo's native viewport service (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address jamesr's questions Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/services/native_viewport/BUILD.gn ('k') | mojo/services/native_viewport/native_viewport_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/services/native_viewport/main.cc
diff --git a/mojo/services/native_viewport/main.cc b/mojo/services/native_viewport/main.cc
index fb150da28daed961b7aa3c6bec9f2196de998703..0a85b15adcbf810a9ded322b4c9b832fe366d5eb 100644
--- a/mojo/services/native_viewport/main.cc
+++ b/mojo/services/native_viewport/main.cc
@@ -26,6 +26,7 @@ class NativeViewportAppDelegate
: share_group_(new gfx::GLShareGroup),
mailbox_manager_(new gpu::gles2::MailboxManager),
is_test_(false),
+ is_headless_(false),
is_initialized_(false) {}
virtual ~NativeViewportAppDelegate() {}
@@ -36,11 +37,17 @@ class NativeViewportAppDelegate
: app_delegate_(app_delegate) {}
virtual void UseTestConfig(
- const mojo::Callback<void()>& callback) OVERRIDE {
+ const Callback<void()>& callback) OVERRIDE {
app_delegate_->is_test_ = true;
callback.Run();
}
+ virtual void UseHeadlessConfig(
+ const Callback<void()>& callback) OVERRIDE {
+ app_delegate_->is_headless_ = true;
+ callback.Run();
+ }
+
private:
NativeViewportAppDelegate* app_delegate_;
};
@@ -70,7 +77,7 @@ class NativeViewportAppDelegate
is_initialized_ = true;
}
#endif
- BindToRequest(new NativeViewportImpl(app_), &request);
+ BindToRequest(new NativeViewportImpl(app_, is_headless_), &request);
}
// InterfaceFactory<Gpu> implementation.
@@ -90,6 +97,7 @@ class NativeViewportAppDelegate
scoped_refptr<gfx::GLShareGroup> share_group_;
scoped_refptr<gpu::gles2::MailboxManager> mailbox_manager_;
bool is_test_;
+ bool is_headless_;
bool is_initialized_;
DISALLOW_COPY_AND_ASSIGN(NativeViewportAppDelegate);
};
« no previous file with comments | « mojo/services/native_viewport/BUILD.gn ('k') | mojo/services/native_viewport/native_viewport_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698