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

Unified Diff: services/ui/service.h

Issue 2916823002: Move Mus into chrome's process when running with --mus.
Patch Set: Addressing most feedback, making this work on device. Created 3 years, 6 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: services/ui/service.h
diff --git a/services/ui/service.h b/services/ui/service.h
index 415080deaa6f9995e384ca781d9510e36ca09f21..4b77ac9d19abc87eaa9ce1c5fa6b46fbee474db9 100644
--- a/services/ui/service.h
+++ b/services/ui/service.h
@@ -63,7 +63,11 @@ class WindowServer;
class Service : public service_manager::Service,
public ws::WindowServerDelegate {
public:
- Service();
+ // |resource_runner| is the task runner for the thread which can be used to
+ // load resources. Used when UI Service is run inside a Window Manager's
+ // process. When UI Service is run in a separate process, resource_runner
+ // should be null, and resources are loaded on the UI Service's thread.
+ Service(scoped_refptr<base::SingleThreadTaskRunner> resource_runner);
sky 2017/06/19 21:25:47 Rather than having mus deal with the different emb
Elliot Glaysher 2017/06/19 21:46:43 This sounds significantly better than having a wra
mfomitchev 2017/06/19 21:50:19 I considered this, but it would mean pre-loading a
sky 2017/06/20 16:07:09 I don't have a good feel for how many cursors and
mfomitchev 2017/06/20 17:00:42 Ok. I think we have just two cursor sets right now
~Service() override;
private:
@@ -74,6 +78,8 @@ class Service : public service_manager::Service,
using UserIdToUserState = std::map<ws::UserId, std::unique_ptr<UserState>>;
+ bool in_process() { return resource_runner_ != nullptr; }
+
// Attempts to initialize the resource bundle. Returns true if successful,
// otherwise false if resources cannot be loaded.
bool InitializeResources(service_manager::Connector* connector);
@@ -160,6 +166,7 @@ class Service : public service_manager::Service,
// and must outlive |registry_|.
InputDeviceServer input_device_server_;
+ scoped_refptr<base::SingleThreadTaskRunner> resource_runner_;
bool test_config_;
#if defined(USE_OZONE)
std::unique_ptr<gfx::ClientNativePixmapFactory> client_native_pixmap_factory_;

Powered by Google App Engine
This is Rietveld 408576698