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

Unified Diff: chrome/browser/printing/print_view_manager_base.h

Issue 2920013002: Use pdf compositor service for printing when OOPIF is enabled
Patch Set: fix due to rebase Created 3 years, 3 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/print_view_manager_base.h
diff --git a/chrome/browser/printing/print_view_manager_base.h b/chrome/browser/printing/print_view_manager_base.h
index ee19939c1341eb792b48ade7ccd0bcda45945742..8dcffb8d68f32faaca2151ca498d41d14ea14e88 100644
--- a/chrome/browser/printing/print_view_manager_base.h
+++ b/chrome/browser/printing/print_view_manager_base.h
@@ -9,12 +9,16 @@
#include "base/macros.h"
#include "base/memory/ref_counted.h"
+#include "base/memory/shared_memory.h"
+#include "base/memory/shared_memory_handle.h"
#include "base/strings/string16.h"
#include "build/build_config.h"
#include "components/prefs/pref_member.h"
#include "components/printing/browser/print_manager.h"
+#include "components/printing/service/public/interfaces/pdf_compositor.mojom.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
+#include "mojo/public/cpp/system/platform_handle.h"
#include "printing/features/features.h"
#include "printing/printed_pages_source.h"
@@ -85,9 +89,19 @@ class PrintViewManagerBase : public content::NotificationObserver,
// IPC Message handlers.
void OnDidGetPrintedPagesCount(int cookie, int number_pages) override;
- void OnDidPrintPage(const PrintHostMsg_DidPrintPage_Params& params);
void OnPrintingFailed(int cookie) override;
void OnShowInvalidPrinterSettingsError();
+ void OnDidPrintPage(const PrintHostMsg_DidPrintPage_Params& params);
+
+ // Handle extra tasks once a page or doc is printed.
+ void UpdateForPrintedPage(const PrintHostMsg_DidPrintPage_Params& params,
+ bool has_valid_page_data,
+ std::unique_ptr<base::SharedMemory> shared_buf);
+
+ // IPC message handlers for service.
+ void OnComposePdfDone(const PrintHostMsg_DidPrintPage_Params& params,
+ mojom::PdfCompositor::Status status,
+ mojo::ScopedSharedBufferHandle handle);
// Processes a NOTIFY_PRINT_JOB_EVENT notification.
void OnNotifyPrintJobEvent(const JobEventDetails& event_details);
@@ -166,6 +180,8 @@ class PrintViewManagerBase : public content::NotificationObserver,
scoped_refptr<printing::PrintQueriesQueue> queue_;
+ base::WeakPtrFactory<PrintViewManagerBase> weak_ptr_factory_;
+
DISALLOW_COPY_AND_ASSIGN(PrintViewManagerBase);
};

Powered by Google App Engine
This is Rietveld 408576698