| Index: services/pdf_compositor/pdf_compositor_impl.h
|
| diff --git a/services/pdf_compositor/pdf_compositor_impl.h b/services/pdf_compositor/pdf_compositor_impl.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..2671a75c991c840dab40247c9a4c6c9d1b6e4a47
|
| --- /dev/null
|
| +++ b/services/pdf_compositor/pdf_compositor_impl.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 CHROME_UTILITY_PDF_COMPOSITOR_IMPL_H_
|
| +#define CHROME_UTILITY_PDF_COMPOSITOR_IMPL_H_
|
| +
|
| +#include <stdint.h>
|
| +
|
| +#include <map>
|
| +#include <memory>
|
| +#include <set>
|
| +
|
| +#include "base/macros.h"
|
| +#include "base/memory/shared_memory.h"
|
| +#include "services/pdf_compositor/public/interfaces/pdf_compositor.mojom.h"
|
| +#include "services/service_manager/public/cpp/service_context_ref.h"
|
| +
|
| +namespace pdf_compositor {
|
| +
|
| +class PdfCompositorImpl : public mojom::PdfCompositor {
|
| + public:
|
| + explicit PdfCompositorImpl(
|
| + std::unique_ptr<service_manager::ServiceContextRef> service_ref);
|
| + ~PdfCompositorImpl() override;
|
| +
|
| + void PrepareSubframe(int subframeId, int page_num) override;
|
| +
|
| + // Add a subframe drawable for composition.
|
| + void AddSubFrameContent(int subframeId,
|
| + mojo::ScopedSharedBufferHandle sk_handle) override;
|
| +
|
| + // Query whether all subframes are ready.
|
| + void IsReadyToComposite(
|
| + int page_num,
|
| + const mojom::PdfCompositor::IsReadyToCompositeCallback& callback)
|
| + override;
|
| +
|
| + // Composite a pdf file from content of one or more subframe.
|
| + void CompositePdf(
|
| + mojo::ScopedSharedBufferHandle sk_handle,
|
| + const mojom::PdfCompositor::CompositePdfCallback& callback) override;
|
| +
|
| + private:
|
| + const std::unique_ptr<service_manager::ServiceContextRef> service_ref_;
|
| +
|
| + // Map a page with all the non-painted remote subframes in it.
|
| + std::map<int, std::set<int>> pending_subframes_in_page_;
|
| +
|
| + // Map a remote subframe with all the pages which contain it.
|
| + std::map<int, std::set<int>> pages_with_subframe_;
|
| +
|
| + std::set<int> painted_subframes_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(PdfCompositorImpl);
|
| +};
|
| +
|
| +} // namespace pdf_compositor
|
| +
|
| +#endif // CHROME_UTILITY_PDF_COMPOSITOR_IMPL_H_
|
|
|