OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef COMPONENTS_PRINTING_SERVICE_PDF_COMPOSITOR_SERVICE_H_ |
| 6 #define COMPONENTS_PRINTING_SERVICE_PDF_COMPOSITOR_SERVICE_H_ |
| 7 |
| 8 #include <memory> |
| 9 #include <string> |
| 10 |
| 11 #include "base/macros.h" |
| 12 #include "base/memory/weak_ptr.h" |
| 13 #include "components/discardable_memory/client/client_discardable_shared_memory_
manager.h" |
| 14 #include "components/printing/service/public/interfaces/pdf_compositor.mojom.h" |
| 15 #include "services/service_manager/public/cpp/bind_source_info.h" |
| 16 #include "services/service_manager/public/cpp/binder_registry.h" |
| 17 #include "services/service_manager/public/cpp/service.h" |
| 18 #include "services/service_manager/public/cpp/service_context_ref.h" |
| 19 |
| 20 namespace printing { |
| 21 |
| 22 class PdfCompositorService : public service_manager::Service { |
| 23 public: |
| 24 explicit PdfCompositorService(const std::string& creator); |
| 25 ~PdfCompositorService() override; |
| 26 |
| 27 // Factory function for use as an embedded service. |
| 28 static std::unique_ptr<service_manager::Service> Create( |
| 29 const std::string& creator); |
| 30 |
| 31 // service_manager::Service: |
| 32 void OnStart() override; |
| 33 void OnBindInterface(const service_manager::BindSourceInfo& source_info, |
| 34 const std::string& interface_name, |
| 35 mojo::ScopedMessagePipeHandle interface_pipe) override; |
| 36 |
| 37 private: |
| 38 // The creator of this service. |
| 39 // Currently contains the service creator's user agent string if given, |
| 40 // otherwise just use string "Chromium". |
| 41 const std::string creator_; |
| 42 |
| 43 std::unique_ptr<discardable_memory::ClientDiscardableSharedMemoryManager> |
| 44 discardable_shared_memory_manager_; |
| 45 std::unique_ptr<service_manager::ServiceContextRefFactory> ref_factory_; |
| 46 service_manager::BinderRegistry registry_; |
| 47 base::WeakPtrFactory<PdfCompositorService> weak_factory_; |
| 48 |
| 49 DISALLOW_COPY_AND_ASSIGN(PdfCompositorService); |
| 50 }; |
| 51 |
| 52 } // namespace printing |
| 53 |
| 54 #endif // COMPONENTS_PRINTING_SERVICE_PDF_COMPOSITOR_SERVICE_H_ |
OLD | NEW |