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

Side by Side 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, 8 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef SERVICES_PDF_COMPOSITOR_PUBLIC_CPP_PDF_COMPOSITE_CLIENT_H_
6 #define SERVICES_PDF_COMPOSITOR_PUBLIC_CPP_PDF_COMPOSITE_CLIENT_H_
7
8 #include <stdint.h>
9
10 #include <vector>
11
12 #include "base/memory/shared_memory_handle.h"
13 #include "services/pdf_compositor/public/interfaces/pdf_compositor.mojom.h"
14 #include "services/service_manager/public/cpp/connector.h"
15
16 namespace pdf_compositor {
17
18 // Helper class to composite a pdf via the pdf_compositor service.
19 class PdfCompositorClient {
20 public:
21 PdfCompositorClient() : compositor_(nullptr) {}
22 ~PdfCompositorClient(){};
23
24 // Connect to the service before use.
25 void ConnectionWithPdfCompositor();
26
27 // Disconnect from the service when no longer in use.
28 void DisconnectFromPdfCompositor();
29
30 // Composite the final picture and convert into a PDF file.
31 void Composite(
32 base::SharedMemoryHandle handle,
33 uint32_t data_size,
34 const pdf_compositor::mojom::PdfCompositor::CompositePdfCallback&
35 callback,
36 scoped_refptr<base::SequencedTaskRunner> callback_task_runner);
37
38 // Instructs the compositor about starting a subframe drawing for a page.
39 void PrepareSubframe(int id, int page_num);
40
41 // Check whether it is ready to start compositing a page.
42 void IsReadyToComposite(
43 int page_num,
44 const pdf_compositor::mojom::PdfCompositor::IsReadyToCompositeCallback&
45 callback,
46 scoped_refptr<base::SequencedTaskRunner> callback_task_runner);
47
48 void AddSubFrameContent(int id,
49 base::SharedMemoryHandle handle,
50 uint32_t data_size);
51
52 private:
53 mojom::PdfCompositorPtr compositor_;
54
55 DISALLOW_COPY_AND_ASSIGN(PdfCompositorClient);
56 };
57
58 } // namespace pdf_compositor
59
60 #endif // SERVICES_PDF_COMPOSITOR_PUBLIC_CPP_PDF_COMPOSITE_CLIENT_H_
OLDNEW
« 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