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

Unified Diff: components/pdf/renderer/pepper_pdf_host.cc

Issue 2455543002: Convert PDF component IPC to mojo. (Closed)
Patch Set: Fix date Created 3 years, 9 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/pdf/renderer/pepper_pdf_host.cc
diff --git a/components/pdf/renderer/pepper_pdf_host.cc b/components/pdf/renderer/pepper_pdf_host.cc
index af5469363a0f1487833bbabc8790333decf1ef1a..abf3114f43133d806590c7b86e0da694c470af4b 100644
--- a/components/pdf/renderer/pepper_pdf_host.cc
+++ b/components/pdf/renderer/pepper_pdf_host.cc
@@ -5,8 +5,8 @@
#include "components/pdf/renderer/pepper_pdf_host.h"
#include "base/memory/ptr_util.h"
-#include "components/pdf/common/pdf_messages.h"
#include "components/pdf/renderer/pdf_accessibility_tree.h"
+#include "content/public/common/associated_interface_provider.h"
#include "content/public/common/referrer.h"
#include "content/public/renderer/pepper_plugin_instance.h"
#include "content/public/renderer/render_frame.h"
@@ -122,8 +122,7 @@ int32_t PepperPDFHost::OnHostMsgSetContentRestriction(
if (!render_frame)
return PP_ERROR_FAILED;
- render_frame->Send(new PDFHostMsg_PDFUpdateContentRestrictions(
- render_frame->GetRoutingID(), restrictions));
+ GetRemotePDFService()->UpdateContentRestrictions(restrictions);
return PP_OK;
}
@@ -142,8 +141,7 @@ int32_t PepperPDFHost::OnHostMsgHasUnsupportedFeature(
if (!render_frame)
return PP_ERROR_FAILED;
- render_frame->Send(
- new PDFHostMsg_PDFHasUnsupportedFeature(render_frame->GetRoutingID()));
+ GetRemotePDFService()->HasUnsupportedFeature();
return PP_OK;
}
@@ -168,8 +166,7 @@ int32_t PepperPDFHost::OnHostMsgSaveAs(
referrer.url = url;
referrer.policy = blink::WebReferrerPolicyDefault;
referrer = content::Referrer::SanitizeForRequest(url, referrer);
- render_frame->Send(
- new PDFHostMsg_PDFSaveURLAs(render_frame->GetRoutingID(), url, referrer));
+ GetRemotePDFService()->SaveURLAs(url, referrer);
return PP_OK;
}
@@ -241,4 +238,12 @@ content::RenderFrame* PepperPDFHost::GetRenderFrame() {
return instance ? instance->GetRenderFrame() : nullptr;
}
+mojom::PDFService* PepperPDFHost::GetRemotePDFService() {
+ if (!remote_pdf_service_) {
+ GetRenderFrame()->GetRemoteAssociatedInterfaces()->GetInterface(
+ &remote_pdf_service_);
+ }
+ return remote_pdf_service_.get();
+}
+
} // namespace pdf

Powered by Google App Engine
This is Rietveld 408576698