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

Unified Diff: chrome/browser/printing/pdf_to_emf_converter.cc

Issue 1062873003: Give names to all utility processes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix typos Created 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/printing/pdf_to_emf_converter.cc
diff --git a/chrome/browser/printing/pdf_to_emf_converter.cc b/chrome/browser/printing/pdf_to_emf_converter.cc
index 48a3845730551460d99ae2dfcf4417a4ba1d2907..0e22ccab2c033d42a6d68070cd5c1c6211d03b6f 100644
--- a/chrome/browser/printing/pdf_to_emf_converter.cc
+++ b/chrome/browser/printing/pdf_to_emf_converter.cc
@@ -12,12 +12,14 @@
#include "base/logging.h"
#include "chrome/common/chrome_utility_messages.h"
#include "chrome/common/chrome_utility_printing_messages.h"
+#include "chrome/grit/generated_resources.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/child_process_data.h"
#include "content/public/browser/utility_process_host.h"
#include "content/public/browser/utility_process_host_client.h"
#include "printing/emf_win.h"
#include "printing/pdf_render_settings.h"
+#include "ui/base/l10n/l10n_util.h"
namespace printing {
@@ -61,8 +63,8 @@ class LazyEmf : public MetafilePlayer {
: temp_dir_(temp_dir), file_(file.Pass()) {}
virtual ~LazyEmf() { Close(); }
- virtual bool SafePlayback(HDC hdc) const override;
- virtual bool SaveTo(base::File* file) const override;
+ bool SafePlayback(HDC hdc) const override;
+ bool SaveTo(base::File* file) const override;
private:
void Close() const;
@@ -103,9 +105,9 @@ class PdfToEmfUtilityProcessHostClient
void Stop();
// UtilityProcessHostClient implementation.
- virtual void OnProcessCrashed(int exit_code) override;
- virtual void OnProcessLaunchFailed() override;
- virtual bool OnMessageReceived(const IPC::Message& message) override;
+ void OnProcessCrashed(int exit_code) override;
+ void OnProcessLaunchFailed() override;
+ bool OnMessageReceived(const IPC::Message& message) override;
private:
class GetPageCallbackData {
@@ -181,12 +183,12 @@ class PdfToEmfConverterImpl : public PdfToEmfConverter {
virtual ~PdfToEmfConverterImpl();
- virtual void Start(const scoped_refptr<base::RefCountedMemory>& data,
- const PdfRenderSettings& conversion_settings,
- const StartCallback& start_callback) override;
+ void Start(const scoped_refptr<base::RefCountedMemory>& data,
+ const PdfRenderSettings& conversion_settings,
+ const StartCallback& start_callback) override;
- virtual void GetPage(int page_number,
- const GetPageCallback& get_page_callback) override;
+ void GetPage(int page_number,
+ const GetPageCallback& get_page_callback) override;
// Helps to cancel callbacks if this object is destroyed.
void RunCallback(const base::Closure& callback);
@@ -298,8 +300,8 @@ void PdfToEmfUtilityProcessHostClient::Start(
content::UtilityProcessHost::Create(
this, base::MessageLoop::current()->message_loop_proxy())
->AsWeakPtr();
- if (!utility_process_host_)
- return OnFailed();
+ utility_process_host_->SetName(l10n_util::GetStringUTF16(
+ IDS_UTILITY_PROCESS_EMF_CONVERTOR_NAME));
// Should reply with OnProcessStarted().
Send(new ChromeUtilityMsg_StartupPing);
}

Powered by Google App Engine
This is Rietveld 408576698