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

Unified Diff: services/ui/service.h

Issue 2916823002: Move Mus into chrome's process when running with --mus.
Patch Set: Removing debug include. Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « services/ui/public/cpp/gpu/BUILD.gn ('k') | services/ui/service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/service.h
diff --git a/services/ui/service.h b/services/ui/service.h
index 4d035f9c94a2d269df23c1d455a7e5f68f796044..4deb7cf2bd3957ee330422b6c21976c57d15f9a7 100644
--- a/services/ui/service.h
+++ b/services/ui/service.h
@@ -13,6 +13,8 @@
#include <vector>
#include "base/macros.h"
+#include "base/memory/ref_counted.h"
+#include "base/memory/weak_ptr.h"
#include "components/discardable_memory/public/interfaces/discardable_shared_memory_manager.mojom.h"
#include "services/service_manager/public/cpp/binder_registry.h"
#include "services/service_manager/public/cpp/service.h"
@@ -53,17 +55,35 @@ class Identity;
namespace ui {
+class ImageCursorsSet;
class InputDeviceController;
class PlatformEventSource;
namespace ws {
+class ThreadedImageCursorsFactory;
class WindowServer;
}
class Service : public service_manager::Service,
public ws::WindowServerDelegate {
public:
- Service();
+ // Contains the configuration necessary to run the UI Service inside the
+ // Window Manager's process.
+ struct InProcessConfig {
+ InProcessConfig();
+ InProcessConfig(const InProcessConfig& config);
+ ~InProcessConfig();
+
+ // Can be used to load resources.
+ scoped_refptr<base::SingleThreadTaskRunner> resource_runner = nullptr;
+
+ // Can only be de-referenced on |resource_runner_|.
+ base::WeakPtr<ImageCursorsSet> image_cursors_set_weak_ptr = nullptr;
+ };
+
+ // |config| should be null when UI Service runs in it's own separate process,
+ // as opposed to inside the Window Manager's process.
+ explicit Service(InProcessConfig* config);
~Service() override;
private:
@@ -74,6 +94,8 @@ class Service : public service_manager::Service,
using UserIdToUserState = std::map<ws::UserId, std::unique_ptr<UserState>>;
+ bool is_in_process() const { return is_in_process_; }
+
// Attempts to initialize the resource bundle. Returns true if successful,
// otherwise false if resources cannot be loaded.
bool InitializeResources(service_manager::Connector* connector);
@@ -99,6 +121,7 @@ class Service : public service_manager::Service,
bool IsTestConfig() const override;
void OnWillCreateTreeForWindowManager(
bool automatically_create_display_roots) override;
+ ws::ThreadedImageCursorsFactory* GetThreadedImageCursorsFactory() override;
void BindAccessibilityManagerRequest(
const service_manager::BindSourceInfo& source_info,
@@ -150,7 +173,7 @@ class Service : public service_manager::Service,
mojom::WindowServerTestRequest request);
std::unique_ptr<ws::WindowServer> window_server_;
- std::unique_ptr<ui::PlatformEventSource> event_source_;
+ std::unique_ptr<PlatformEventSource> event_source_;
using PendingRequests = std::vector<std::unique_ptr<PendingRequest>>;
PendingRequests pending_requests_;
@@ -160,6 +183,13 @@ class Service : public service_manager::Service,
// and must outlive |registry_|.
InputDeviceServer input_device_server_;
+ // True if the UI Service runs inside WM's process, false if it runs inside
+ // its own process.
+ const bool is_in_process_;
+
+ std::unique_ptr<ws::ThreadedImageCursorsFactory>
+ threaded_image_cursors_factory_;
+
bool test_config_;
#if defined(USE_OZONE)
std::unique_ptr<gfx::ClientNativePixmapFactory> client_native_pixmap_factory_;
« no previous file with comments | « services/ui/public/cpp/gpu/BUILD.gn ('k') | services/ui/service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698