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

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: 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
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..b726e52345ce12ace24bbec53dca9c1909aa672c 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() {}
@@ -41,6 +42,12 @@ class NativeViewportAppDelegate
callback.Run();
}
+ virtual void UseHeadlessConfig(
+ const mojo::Callback<void()>& callback) OVERRIDE {
jamesr 2014/09/25 22:18:14 this code is in namespace mojo, no need to specify
+ 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);
};

Powered by Google App Engine
This is Rietveld 408576698