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

Side by Side Diff: chrome/service/service_utility_process_host.h

Issue 2812263002: clean up printing::Image and printing::Metafile (Closed)
Patch Set: return 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
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_SERVICE_SERVICE_UTILITY_PROCESS_HOST_H_ 5 #ifndef CHROME_SERVICE_SERVICE_UTILITY_PROCESS_HOST_H_
6 #define CHROME_SERVICE_SERVICE_UTILITY_PROCESS_HOST_H_ 6 #define CHROME_SERVICE_SERVICE_UTILITY_PROCESS_HOST_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 10
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
13 #include "base/memory/weak_ptr.h" 13 #include "base/memory/weak_ptr.h"
14 #include "content/public/common/child_process_host_delegate.h" 14 #include "content/public/common/child_process_host_delegate.h"
15 #include "ipc/ipc_platform_file.h" 15 #include "ipc/ipc_platform_file.h"
16 #include "mojo/edk/embedder/pending_process_connection.h" 16 #include "mojo/edk/embedder/pending_process_connection.h"
17 17
18 namespace base { 18 namespace base {
19 class CommandLine; 19 class CommandLine;
20 class File; 20 class File;
21 class FilePath; 21 class FilePath;
22 class SingleThreadTaskRunner; 22 class SingleThreadTaskRunner;
23 } // namespace base 23 } // namespace base
24 24
25 namespace content { 25 namespace content {
26 class ChildProcessHost; 26 class ChildProcessHost;
27 } 27 }
28 28
29 namespace printing { 29 namespace printing {
30 class MetafilePlayer;
31 struct PdfRenderSettings; 30 struct PdfRenderSettings;
32 struct PrinterCapsAndDefaults; 31 struct PrinterCapsAndDefaults;
33 struct PrinterSemanticCapsAndDefaults; 32 struct PrinterSemanticCapsAndDefaults;
34 } // namespace printing 33 } // namespace printing
35 34
36 // Acts as the service-side host to a utility child process. A 35 // Acts as the service-side host to a utility child process. A
37 // utility process is a short-lived sandboxed process that is created to run 36 // utility process is a short-lived sandboxed process that is created to run
38 // a specific task. 37 // a specific task.
39 class ServiceUtilityProcessHost : public content::ChildProcessHostDelegate { 38 class ServiceUtilityProcessHost : public content::ChildProcessHostDelegate {
40 public: 39 public:
41 // Consumers of ServiceUtilityProcessHost must implement this interface to 40 // Consumers of ServiceUtilityProcessHost must implement this interface to
42 // get results back. All functions are called on the thread passed along 41 // get results back. All functions are called on the thread passed along
43 // to ServiceUtilityProcessHost. 42 // to ServiceUtilityProcessHost.
44 class Client : public base::RefCountedThreadSafe<Client> { 43 class Client : public base::RefCountedThreadSafe<Client> {
45 public: 44 public:
46 Client() {} 45 Client() {}
47 46
48 // Called when the child process died before a reply was receieved. 47 // Called when the child process died before a reply was receieved.
49 virtual void OnChildDied() {} 48 virtual void OnChildDied() {}
50 49
51 virtual void OnRenderPDFPagesToMetafilePageDone( 50 virtual bool OnRenderPDFPagesToMetafilePageDone(std::vector<char>& emf_data,
Lei Zhang 2017/04/12 19:33:33 Why is |emf_data| non-const?
hal.canary 2017/04/13 20:55:38 oversight on my part.
52 float scale_factor, 51 float scale_factor) {
53 const printing::MetafilePlayer& emf) {} 52 return false;
Lei Zhang 2017/04/12 19:33:33 The impl in the header is causing win_clang bot to
hal.canary 2017/04/13 20:55:38 Done.
53 }
54 54
55 // Called when at all pages in the PDF has been rendered. 55 // Called when at all pages in the PDF has been rendered.
56 virtual void OnRenderPDFPagesToMetafileDone(bool success) {} 56 virtual void OnRenderPDFPagesToMetafileDone(bool success) {}
57 57
58 // Called when the printer capabilities and defaults have been 58 // Called when the printer capabilities and defaults have been
59 // retrieved successfully or if retrieval failed. 59 // retrieved successfully or if retrieval failed.
60 virtual void OnGetPrinterCapsAndDefaults( 60 virtual void OnGetPrinterCapsAndDefaults(
61 bool succedded, 61 bool succedded,
62 const std::string& printer_name, 62 const std::string& printer_name,
63 const printing::PrinterCapsAndDefaults& caps_and_defaults) {} 63 const printing::PrinterCapsAndDefaults& caps_and_defaults) {}
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 154
155 class PdfToEmfState; 155 class PdfToEmfState;
156 std::unique_ptr<PdfToEmfState> pdf_to_emf_state_; 156 std::unique_ptr<PdfToEmfState> pdf_to_emf_state_;
157 157
158 base::WeakPtrFactory<ServiceUtilityProcessHost> weak_ptr_factory_; 158 base::WeakPtrFactory<ServiceUtilityProcessHost> weak_ptr_factory_;
159 159
160 DISALLOW_COPY_AND_ASSIGN(ServiceUtilityProcessHost); 160 DISALLOW_COPY_AND_ASSIGN(ServiceUtilityProcessHost);
161 }; 161 };
162 162
163 #endif // CHROME_SERVICE_SERVICE_UTILITY_PROCESS_HOST_H_ 163 #endif // CHROME_SERVICE_SERVICE_UTILITY_PROCESS_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698