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

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: fix due to rebase Created 3 years, 3 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 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::WebContentsObserver,
Lei Zhang 2017/09/08 07:50:53 Is this class actually a WebContentsObserver?
Wei Li 2017/09/08 22:57:47 Done.
20 public content::WebContentsUserData<PrintCompositeClient> {
21 public:
22 explicit PrintCompositeClient(content::WebContents* web_contents);
23 ~PrintCompositeClient() override;
24
25 void CreateConnectorRequest();
Lei Zhang 2017/09/08 07:50:53 private
Wei Li 2017/09/08 22:57:48 Done.
26 void DoComposite(base::SharedMemoryHandle handle,
27 uint32_t data_size,
28 mojom::PdfCompositor::CompositePdfCallback callback);
29
30 // Utility functions.
31 static std::unique_ptr<base::SharedMemory> GetShmFromMojoHandle(
32 mojo::ScopedSharedBufferHandle handle);
33 static scoped_refptr<base::RefCountedBytes> GetDataFromMojoHandle(
34 mojo::ScopedSharedBufferHandle handle);
35
36 private:
37 service_manager::mojom::ConnectorRequest connector_request_;
38 std::unique_ptr<service_manager::Connector> connector_;
39 base::WeakPtrFactory<PrintCompositeClient> weak_factory_;
Lei Zhang 2017/09/08 07:50:53 Not used?
Wei Li 2017/09/08 22:57:48 Done.
40
41 DISALLOW_COPY_AND_ASSIGN(PrintCompositeClient);
42 };
43
44 } // namespace printing
45
46 #endif // COMPONENTS_PRINTING_BROWSER_PRINT_COMPOSITE_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698