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

Side by Side Diff: components/printing/browser/print_composite_client.h

Issue 2920013002: Use pdf compositor service for printing when OOPIF is enabled
Patch Set: rebase Created 3 years, 2 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
« no previous file with comments | « components/printing/browser/DEPS ('k') | components/printing/browser/print_composite_client.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 COMPONENTS_PRINTING_BROWSER_PRINT_COMPOSITE_CLIENT_H_
6 #define COMPONENTS_PRINTING_BROWSER_PRINT_COMPOSITE_CLIENT_H_
7
8 #include "base/memory/ref_counted_memory.h"
9 #include "base/memory/shared_memory.h"
10 #include "base/memory/shared_memory_handle.h"
11 #include "components/printing/service/public/cpp/pdf_compositor_client.h"
12 #include "content/public/browser/web_contents_observer.h"
13 #include "content/public/browser/web_contents_user_data.h"
14
15 namespace printing {
16
17 class PrintCompositeClient
18 : public PdfCompositorClient,
19 public content::WebContentsUserData<PrintCompositeClient> {
20 public:
21 explicit PrintCompositeClient(content::WebContents* web_contents);
22 ~PrintCompositeClient() override;
23
24 void DoComposite(base::SharedMemoryHandle handle,
25 uint32_t data_size,
26 mojom::PdfCompositor::CompositePdfCallback callback);
27
28 // Utility functions.
29 static std::unique_ptr<base::SharedMemory> GetShmFromMojoHandle(
30 mojo::ScopedSharedBufferHandle handle);
31 static scoped_refptr<base::RefCountedBytes> GetDataFromMojoHandle(
32 mojo::ScopedSharedBufferHandle handle);
33
34 private:
35 void CreateConnectorRequest();
36
37 service_manager::mojom::ConnectorRequest connector_request_;
38 std::unique_ptr<service_manager::Connector> connector_;
39
40 DISALLOW_COPY_AND_ASSIGN(PrintCompositeClient);
41 };
42
43 } // namespace printing
44
45 #endif // COMPONENTS_PRINTING_BROWSER_PRINT_COMPOSITE_CLIENT_H_
OLDNEW
« no previous file with comments | « components/printing/browser/DEPS ('k') | components/printing/browser/print_composite_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698