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

Unified Diff: services/pdf_compositor/pdf_compositor_impl.h

Issue 2653963002: [Experimental] Supporting OOPIF printing
Patch Set: Rename service, fix for webview, and connect to DiscardableMemoryManager Created 3 years, 9 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
« no previous file with comments | « services/pdf_compositor/manifest.json ('k') | services/pdf_compositor/pdf_compositor_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_
« no previous file with comments | « services/pdf_compositor/manifest.json ('k') | services/pdf_compositor/pdf_compositor_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698