Commit 559210ed authored by Julie Jeongeun Kim's avatar Julie Jeongeun Kim Committed by Commit Bot

Clean up old Mojo types for mojom::PdfToPwgRasterConverter

This CL cleans up old Mojo types for mojom::PdfToPwgRasterConverter
from PwgRasterConverterHelper using Remote instead of InterfacePtr.

Bug: 955171
Change-Id: I8a44ec93c23433f04674a1e543fa6bdb9c7ba10d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1936067Reviewed-by: default avatarDave Tapuska <dtapuska@chromium.org>
Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
Commit-Queue: Julie Kim <jkim@igalia.com>
Cr-Commit-Position: refs/heads/master@{#720777}
parent df7838b5
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include "components/cloud_devices/common/printer_description.h" #include "components/cloud_devices/common/printer_description.h"
#include "content/public/browser/browser_thread.h" #include "content/public/browser/browser_thread.h"
#include "content/public/browser/child_process_data.h" #include "content/public/browser/child_process_data.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "mojo/public/cpp/system/platform_handle.h" #include "mojo/public/cpp/system/platform_handle.h"
#include "printing/pdf_render_settings.h" #include "printing/pdf_render_settings.h"
#include "printing/pwg_raster_settings.h" #include "printing/pwg_raster_settings.h"
...@@ -53,8 +54,8 @@ class PwgRasterConverterHelper ...@@ -53,8 +54,8 @@ class PwgRasterConverterHelper
PdfRenderSettings settings_; PdfRenderSettings settings_;
PwgRasterSettings bitmap_settings_; PwgRasterSettings bitmap_settings_;
mojo::InterfacePtr<printing::mojom::PdfToPwgRasterConverter> mojo::Remote<printing::mojom::PdfToPwgRasterConverter>
pdf_to_pwg_raster_converter_ptr_; pdf_to_pwg_raster_converter_remote_;
PwgRasterConverter::ResultCallback callback_; PwgRasterConverter::ResultCallback callback_;
DISALLOW_COPY_AND_ASSIGN(PwgRasterConverterHelper); DISALLOW_COPY_AND_ASSIGN(PwgRasterConverterHelper);
...@@ -79,8 +80,8 @@ void PwgRasterConverterHelper::Convert( ...@@ -79,8 +80,8 @@ void PwgRasterConverterHelper::Convert(
callback_ = std::move(callback); callback_ = std::move(callback);
GetPrintingService()->BindPdfToPwgRasterConverter( GetPrintingService()->BindPdfToPwgRasterConverter(
mojo::MakeRequest(&pdf_to_pwg_raster_converter_ptr_)); pdf_to_pwg_raster_converter_remote_.BindNewPipeAndPassReceiver());
pdf_to_pwg_raster_converter_ptr_.set_connection_error_handler( pdf_to_pwg_raster_converter_remote_.set_disconnect_handler(
base::BindOnce(&PwgRasterConverterHelper::RunCallback, this, base::BindOnce(&PwgRasterConverterHelper::RunCallback, this,
base::ReadOnlySharedMemoryRegion(), /*page_count=*/0)); base::ReadOnlySharedMemoryRegion(), /*page_count=*/0));
...@@ -94,7 +95,7 @@ void PwgRasterConverterHelper::Convert( ...@@ -94,7 +95,7 @@ void PwgRasterConverterHelper::Convert(
// TODO(thestig): Write |data| into shared memory in the first place, to avoid // TODO(thestig): Write |data| into shared memory in the first place, to avoid
// this memcpy(). // this memcpy().
memcpy(memory.mapping.memory(), data->front(), data->size()); memcpy(memory.mapping.memory(), data->front(), data->size());
pdf_to_pwg_raster_converter_ptr_->Convert( pdf_to_pwg_raster_converter_remote_->Convert(
std::move(memory.region), settings_, bitmap_settings_, std::move(memory.region), settings_, bitmap_settings_,
base::BindOnce(&PwgRasterConverterHelper::RunCallback, this)); base::BindOnce(&PwgRasterConverterHelper::RunCallback, this));
} }
...@@ -115,7 +116,7 @@ void PwgRasterConverterHelper::RunCallback( ...@@ -115,7 +116,7 @@ void PwgRasterConverterHelper::RunCallback(
std::move(callback_).Run(base::ReadOnlySharedMemoryRegion()); std::move(callback_).Run(base::ReadOnlySharedMemoryRegion());
} }
} }
pdf_to_pwg_raster_converter_ptr_.reset(); pdf_to_pwg_raster_converter_remote_.reset();
} }
class PwgRasterConverterImpl : public PwgRasterConverter { class PwgRasterConverterImpl : public PwgRasterConverter {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment