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

Unified Diff: components/printing/service/pdf_compositor_service.cc

Issue 2919823004: Add error handling and unit test for pdf compositor service (Closed)
Patch Set: rebase Created 3 years, 5 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: components/printing/service/pdf_compositor_service.cc
diff --git a/components/printing/service/pdf_compositor_service.cc b/components/printing/service/pdf_compositor_service.cc
index 40456fe47aa78e477812dbde30c4e7b37472c834..d656c6d6c7a06703b5333d4bb5da8ec565eced19 100644
--- a/components/printing/service/pdf_compositor_service.cc
+++ b/components/printing/service/pdf_compositor_service.cc
@@ -42,7 +42,7 @@ std::unique_ptr<service_manager::Service> PdfCompositorService::Create(
return base::MakeUnique<printing::PdfCompositorService>(creator);
}
-void PdfCompositorService::OnStart() {
+void PdfCompositorService::PrepareToStart() {
// Set up discardable memory manager.
discardable_memory::mojom::DiscardableSharedMemoryManagerPtr manager_ptr;
context()->connector()->BindInterface(content::mojom::kBrowserServiceName,
@@ -53,6 +53,10 @@ void PdfCompositorService::OnStart() {
DCHECK(discardable_shared_memory_manager_);
base::DiscardableMemoryAllocator::SetInstance(
discardable_shared_memory_manager_.get());
+}
+
+void PdfCompositorService::OnStart() {
+ PrepareToStart();
ref_factory_ = base::MakeUnique<service_manager::ServiceContextRefFactory>(
base::Bind(&service_manager::ServiceContext::RequestQuit,
« no previous file with comments | « components/printing/service/pdf_compositor_service.h ('k') | components/printing/service/pdf_compositor_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698