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

Side by Side Diff: services/pdf_compositor/pdf_compositor_service.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_PDF_COMPOSITOR_SERVICE_H_
6 #define SERVICES_PDF_COMPOSITOR_PDF_COMPOSITOR_SERVICE_H_
7
8 #include <memory>
9
10 #include "base/callback.h"
11 #include "base/macros.h"
12 #include "base/memory/discardable_memory_allocator.h"
13 #include "base/memory/discardable_shared_memory.h"
14 #include "base/memory/weak_ptr.h"
15 #include "base/threading/thread.h"
16 #include "components/discardable_memory/client/client_discardable_shared_memory_ manager.h"
17 #include "services/pdf_compositor/public/interfaces/pdf_compositor.mojom.h"
18 #include "services/service_manager/public/cpp/interface_factory.h"
19 #include "services/service_manager/public/cpp/service.h"
20 #include "services/service_manager/public/cpp/service_context_ref.h"
21
22 namespace pdf_compositor {
23
24 class PdfCompositorService
25 : public service_manager::Service,
26 public service_manager::InterfaceFactory<mojom::PdfCompositor> {
27 public:
28 PdfCompositorService();
29 ~PdfCompositorService() override;
30
31 // Factory function for use as an embedded service.
32 static std::unique_ptr<service_manager::Service> Create();
33
34 // service_manager::Service:
35 void OnStart() override;
36 bool OnConnect(const service_manager::ServiceInfo& remote_info,
37 service_manager::InterfaceRegistry* registry) override;
38 bool OnStop() override;
39
40 // service_manager::InterfaceFactory<mojom::PdfCompositor>:
41 void Create(const service_manager::Identity& remote_identity,
42 mojom::PdfCompositorRequest request) override;
43
44 private:
45 void MaybeRequestQuitDelayed();
46 void MaybeRequestQuit();
47
48 std::unique_ptr<discardable_memory::ClientDiscardableSharedMemoryManager>
49 discardable_shared_memory_manager_;
50 std::unique_ptr<base::Thread> io_thread_;
51
52 std::unique_ptr<service_manager::ServiceContextRefFactory> ref_factory_;
53 base::WeakPtrFactory<PdfCompositorService> weak_factory_;
54
55 DISALLOW_COPY_AND_ASSIGN(PdfCompositorService);
56 };
57
58 } // namespace pdf_compositor
59
60 #endif // SERVICES_PDF_COMPOSITOR_PDF_COMPOSITOR_SERVICE_H_
OLDNEW
« no previous file with comments | « services/pdf_compositor/pdf_compositor_impl.cc ('k') | services/pdf_compositor/pdf_compositor_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698