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

Unified Diff: components/printing/service/pdf_compositor_service.h

Issue 2832633002: Add PDF compositor service (Closed)
Patch Set: rebase more Created 3 years, 7 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: components/printing/service/pdf_compositor_service.h
diff --git a/components/printing/service/pdf_compositor_service.h b/components/printing/service/pdf_compositor_service.h
new file mode 100644
index 0000000000000000000000000000000000000000..20525f487507aa47d56a8a34989275abcb4db7bf
--- /dev/null
+++ b/components/printing/service/pdf_compositor_service.h
@@ -0,0 +1,49 @@
+// 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 COMPONENTS_PRINTING_SERVICE_PDF_COMPOSITOR_SERVICE_H_
+#define COMPONENTS_PRINTING_SERVICE_PDF_COMPOSITOR_SERVICE_H_
+
+#include <memory>
+#include <string>
+
+#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
+#include "components/discardable_memory/client/client_discardable_shared_memory_manager.h"
+#include "components/printing/service/public/interfaces/pdf_compositor.mojom.h"
+#include "services/service_manager/public/cpp/bind_source_info.h"
+#include "services/service_manager/public/cpp/binder_registry.h"
+#include "services/service_manager/public/cpp/service.h"
+#include "services/service_manager/public/cpp/service_context_ref.h"
+
+namespace printing {
+
+class PdfCompositorService : public service_manager::Service {
+ public:
+ PdfCompositorService();
+ ~PdfCompositorService() override;
+
+ // Factory function for use as an embedded service.
+ static std::unique_ptr<service_manager::Service> Create(
+ const std::string& creator);
+
+ // service_manager::Service:
+ void OnStart() override;
+ void OnBindInterface(const service_manager::BindSourceInfo& source_info,
+ const std::string& interface_name,
+ mojo::ScopedMessagePipeHandle interface_pipe) override;
+
+ private:
+ std::unique_ptr<discardable_memory::ClientDiscardableSharedMemoryManager>
+ discardable_shared_memory_manager_;
+ std::unique_ptr<service_manager::ServiceContextRefFactory> ref_factory_;
+ service_manager::BinderRegistry registry_;
+ base::WeakPtrFactory<PdfCompositorService> weak_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(PdfCompositorService);
+};
+
+} // namespace printing
+
+#endif // COMPONENTS_PRINTING_SERVICE_PDF_COMPOSITOR_SERVICE_H_

Powered by Google App Engine
This is Rietveld 408576698