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

Unified Diff: services/pdf_compositor/public/cpp/pdf_compositor_client.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
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_
« no previous file with comments | « services/pdf_compositor/public/cpp/compositor_data.h ('k') | services/pdf_compositor/public/cpp/pdf_compositor_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698