Chromium Code Reviews| 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..8199823d7b41358f5031bd9f84be109c2a14b8e4 |
| --- /dev/null |
| +++ b/components/printing/service/pdf_compositor_service.h |
| @@ -0,0 +1,52 @@ |
| +// 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/discardable_memory_allocator.h" |
| +#include "base/memory/discardable_shared_memory.h" |
| +#include "base/memory/weak_ptr.h" |
| +#include "base/single_thread_task_runner.h" |
|
Lei Zhang
2017/05/04 02:13:13
Not used?
Wei Li
2017/05/04 18:18:28
Removed.
|
| +#include "base/threading/thread.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/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::ServiceInfo& 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_ |