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

Unified Diff: services/pdf_compositor/pdf_compositor_service.h

Issue 2653963002: [Experimental] Supporting OOPIF printing
Patch Set: Rename service, fix for webview, and connect to DiscardableMemoryManager Created 3 years, 9 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/pdf_compositor/pdf_compositor_impl.cc ('k') | services/pdf_compositor/pdf_compositor_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/pdf_compositor/pdf_compositor_service.h
diff --git a/services/pdf_compositor/pdf_compositor_service.h b/services/pdf_compositor/pdf_compositor_service.h
new file mode 100644
index 0000000000000000000000000000000000000000..2dc513ed51454ab6945935a396af872daaf5bccd
--- /dev/null
+++ b/services/pdf_compositor/pdf_compositor_service.h
@@ -0,0 +1,60 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SERVICES_PDF_COMPOSITOR_PDF_COMPOSITOR_SERVICE_H_
+#define SERVICES_PDF_COMPOSITOR_PDF_COMPOSITOR_SERVICE_H_
+
+#include <memory>
+
+#include "base/callback.h"
+#include "base/macros.h"
+#include "base/memory/discardable_memory_allocator.h"
+#include "base/memory/discardable_shared_memory.h"
+#include "base/memory/weak_ptr.h"
+#include "base/threading/thread.h"
+#include "components/discardable_memory/client/client_discardable_shared_memory_manager.h"
+#include "services/pdf_compositor/public/interfaces/pdf_compositor.mojom.h"
+#include "services/service_manager/public/cpp/interface_factory.h"
+#include "services/service_manager/public/cpp/service.h"
+#include "services/service_manager/public/cpp/service_context_ref.h"
+
+namespace pdf_compositor {
+
+class PdfCompositorService
+ : public service_manager::Service,
+ public service_manager::InterfaceFactory<mojom::PdfCompositor> {
+ public:
+ PdfCompositorService();
+ ~PdfCompositorService() override;
+
+ // Factory function for use as an embedded service.
+ static std::unique_ptr<service_manager::Service> Create();
+
+ // service_manager::Service:
+ void OnStart() override;
+ bool OnConnect(const service_manager::ServiceInfo& remote_info,
+ service_manager::InterfaceRegistry* registry) override;
+ bool OnStop() override;
+
+ // service_manager::InterfaceFactory<mojom::PdfCompositor>:
+ void Create(const service_manager::Identity& remote_identity,
+ mojom::PdfCompositorRequest request) override;
+
+ private:
+ void MaybeRequestQuitDelayed();
+ void MaybeRequestQuit();
+
+ std::unique_ptr<discardable_memory::ClientDiscardableSharedMemoryManager>
+ discardable_shared_memory_manager_;
+ std::unique_ptr<base::Thread> io_thread_;
+
+ std::unique_ptr<service_manager::ServiceContextRefFactory> ref_factory_;
+ base::WeakPtrFactory<PdfCompositorService> weak_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(PdfCompositorService);
+};
+
+} // namespace pdf_compositor
+
+#endif // SERVICES_PDF_COMPOSITOR_PDF_COMPOSITOR_SERVICE_H_
« no previous file with comments | « services/pdf_compositor/pdf_compositor_impl.cc ('k') | services/pdf_compositor/pdf_compositor_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698