| Index: services/pdf_compositor/public/cpp/pdf_compositor_client.h
|
| diff --git a/services/pdf_compositor/public/cpp/pdf_compositor_client.h b/services/pdf_compositor/public/cpp/pdf_compositor_client.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..8ccf4d767eaa4fe62eba3c08148ccaabce44db19
|
| --- /dev/null
|
| +++ b/services/pdf_compositor/public/cpp/pdf_compositor_client.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_PUBLIC_CPP_PDF_COMPOSITE_CLIENT_H_
|
| +#define SERVICES_PDF_COMPOSITOR_PUBLIC_CPP_PDF_COMPOSITE_CLIENT_H_
|
| +
|
| +#include <stdint.h>
|
| +
|
| +#include <vector>
|
| +
|
| +#include "base/memory/shared_memory_handle.h"
|
| +#include "services/pdf_compositor/public/interfaces/pdf_compositor.mojom.h"
|
| +#include "services/service_manager/public/cpp/connector.h"
|
| +
|
| +namespace pdf_compositor {
|
| +
|
| +// Helper class to composite a pdf via the pdf_compositor service.
|
| +class PdfCompositorClient {
|
| + public:
|
| + PdfCompositorClient() : compositor_(nullptr) {}
|
| + ~PdfCompositorClient(){};
|
| +
|
| + // Connect to the service before use.
|
| + void ConnectionWithPdfCompositor();
|
| +
|
| + // Disconnect from the service when no longer in use.
|
| + void DisconnectFromPdfCompositor();
|
| +
|
| + // Composite the final picture and convert into a PDF file.
|
| + void Composite(
|
| + base::SharedMemoryHandle handle,
|
| + uint32_t data_size,
|
| + const pdf_compositor::mojom::PdfCompositor::CompositePdfCallback&
|
| + callback,
|
| + scoped_refptr<base::SequencedTaskRunner> callback_task_runner);
|
| +
|
| + // Instructs the compositor about starting a subframe drawing for a page.
|
| + void PrepareSubframe(int id, int page_num);
|
| +
|
| + // Check whether it is ready to start compositing a page.
|
| + void IsReadyToComposite(
|
| + int page_num,
|
| + const pdf_compositor::mojom::PdfCompositor::IsReadyToCompositeCallback&
|
| + callback,
|
| + scoped_refptr<base::SequencedTaskRunner> callback_task_runner);
|
| +
|
| + void AddSubFrameContent(int id,
|
| + base::SharedMemoryHandle handle,
|
| + uint32_t data_size);
|
| +
|
| + private:
|
| + mojom::PdfCompositorPtr compositor_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(PdfCompositorClient);
|
| +};
|
| +
|
| +} // namespace pdf_compositor
|
| +
|
| +#endif // SERVICES_PDF_COMPOSITOR_PUBLIC_CPP_PDF_COMPOSITE_CLIENT_H_
|
|
|