X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fchrome%2Fservice%2Fservice_utility_process_host.h;h=fd1fad91cf6d9b6ca05462a201a86c149a0ee38c;hb=ff3e2503a20db9193d323c1d19c38c68004dec4a;hp=1e41066b770c19e56a57a286f4ea636ff99561e3;hpb=7338fba38ba696536d1cc9d389afd716a6ab2fe6;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/chrome/service/service_utility_process_host.h b/src/chrome/service/service_utility_process_host.h index 1e41066..fd1fad9 100644 --- a/src/chrome/service/service_utility_process_host.h +++ b/src/chrome/service/service_utility_process_host.h @@ -34,6 +34,7 @@ namespace printing { class Emf; struct PageRange; struct PrinterCapsAndDefaults; +struct PrinterSemanticCapsAndDefaults; } // namespace printing // Acts as the service-side host to a utility child process. A @@ -61,15 +62,18 @@ class ServiceUtilityProcessHost : public content::ChildProcessHostDelegate { virtual void OnRenderPDFPagesToMetafileFailed() {} // Called when the printer capabilities and defaults have been - // retrieved successfully. - virtual void OnGetPrinterCapsAndDefaultsSucceeded( + // retrieved successfully or if retrieval failed. + virtual void OnGetPrinterCapsAndDefaults( + bool succedded, const std::string& printer_name, const printing::PrinterCapsAndDefaults& caps_and_defaults) {} - // Called when the printer capabilities and defaults could not be - // retrieved successfully. - virtual void OnGetPrinterCapsAndDefaultsFailed( - const std::string& printer_name) {} + // Called when the printer capabilities and defaults have been + // retrieved successfully or if retrieval failed. + virtual void OnGetPrinterSemanticCapsAndDefaults( + bool succedded, + const std::string& printer_name, + const printing::PrinterSemanticCapsAndDefaults& caps_and_defaults) {} protected: virtual ~Client() {} @@ -104,6 +108,12 @@ class ServiceUtilityProcessHost : public content::ChildProcessHostDelegate { // in a sandbox. bool StartGetPrinterCapsAndDefaults(const std::string& printer_name); + // Starts a process to get capabilities and defaults for the specified + // printer. Used on Windows to isolate the service process from printer driver + // crashes by executing this in a separate process. The process does not run + // in a sandbox. Returns result as printing::PrinterSemanticCapsAndDefaults. + bool StartGetPrinterSemanticCapsAndDefaults(const std::string& printer_name); + protected: // Allows this method to be overridden for tests. virtual base::FilePath GetUtilityProcessCmd(); @@ -111,6 +121,7 @@ class ServiceUtilityProcessHost : public content::ChildProcessHostDelegate { // ChildProcessHostDelegate implementation: virtual void OnChildDisconnected() OVERRIDE; virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; + virtual base::ProcessHandle GetHandle() const OVERRIDE; private: // Starts a process. Returns true iff it succeeded. |exposed_dir| is the @@ -136,6 +147,11 @@ class ServiceUtilityProcessHost : public content::ChildProcessHostDelegate { const std::string& printer_name, const printing::PrinterCapsAndDefaults& caps_and_defaults); void OnGetPrinterCapsAndDefaultsFailed(const std::string& printer_name); + void OnGetPrinterSemanticCapsAndDefaultsSucceeded( + const std::string& printer_name, + const printing::PrinterSemanticCapsAndDefaults& caps_and_defaults); + void OnGetPrinterSemanticCapsAndDefaultsFailed( + const std::string& printer_name); scoped_ptr child_process_host_; base::ProcessHandle handle_;