Commit 57edfda0 authored by Miyoung Shin's avatar Miyoung Shin Committed by Commit Bot

Convert WebLaunchService to new Mojo types

This CL converts WebLaunchServiceAssociatedPtr in chrome and
WebLaunchServiceAssociatedRequest in blink to the new Mojo types.

Bug: 955171, 978694
Change-Id: Ic73752fe3f3525c631d9665cbc7cb967ce8c39ab
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1767446Reviewed-by: default avatarKen Rockot <rockot@google.com>
Reviewed-by: default avatarJay Harris <harrisjay@chromium.org>
Commit-Queue: Miyoung Shin <myid.shin@igalia.com>
Cr-Commit-Position: refs/heads/master@{#690255}
parent f3ad5ba1
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include "content/public/browser/storage_partition.h" #include "content/public/browser/storage_partition.h"
#include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_user_data.h" #include "content/public/browser/web_contents_user_data.h"
#include "mojo/public/cpp/bindings/associated_remote.h"
#include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h" #include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h"
#include "third_party/blink/public/mojom/native_file_system/native_file_system_directory_handle.mojom.h" #include "third_party/blink/public/mojom/native_file_system/native_file_system_directory_handle.mojom.h"
#include "url/origin.h" #include "url/origin.h"
...@@ -117,7 +118,7 @@ void WebLaunchFilesHelper::MaybeSendLaunchEntries() { ...@@ -117,7 +118,7 @@ void WebLaunchFilesHelper::MaybeSendLaunchEntries() {
if (launch_url_ != web_contents()->GetLastCommittedURL()) if (launch_url_ != web_contents()->GetLastCommittedURL())
return; return;
blink::mojom::WebLaunchServiceAssociatedPtr launch_service; mojo::AssociatedRemote<blink::mojom::WebLaunchService> launch_service;
web_contents()->GetMainFrame()->GetRemoteAssociatedInterfaces()->GetInterface( web_contents()->GetMainFrame()->GetRemoteAssociatedInterfaces()->GetInterface(
&launch_service); &launch_service);
DCHECK(launch_service); DCHECK(launch_service);
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#include <memory> #include <memory>
#include "mojo/public/cpp/bindings/strong_associated_binding.h" #include "mojo/public/cpp/bindings/self_owned_associated_receiver.h"
#include "third_party/blink/public/mojom/native_file_system/native_file_system_directory_handle.mojom-blink.h" #include "third_party/blink/public/mojom/native_file_system/native_file_system_directory_handle.mojom-blink.h"
#include "third_party/blink/renderer/core/frame/local_dom_window.h" #include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/core/frame/local_frame.h" #include "third_party/blink/renderer/core/frame/local_frame.h"
...@@ -19,12 +19,12 @@ namespace blink { ...@@ -19,12 +19,12 @@ namespace blink {
void WebLaunchServiceImpl::Create( void WebLaunchServiceImpl::Create(
LocalFrame* frame, LocalFrame* frame,
mojom::blink::WebLaunchServiceAssociatedRequest request) { mojo::PendingAssociatedReceiver<mojom::blink::WebLaunchService> receiver) {
DCHECK(frame); DCHECK(frame);
mojo::MakeStrongAssociatedBinding( mojo::MakeSelfOwnedAssociatedReceiver(
std::make_unique<WebLaunchServiceImpl>(*frame->DomWindow()), std::make_unique<WebLaunchServiceImpl>(*frame->DomWindow()),
std::move(request)); std::move(receiver));
} }
WebLaunchServiceImpl::WebLaunchServiceImpl(LocalDOMWindow& window) WebLaunchServiceImpl::WebLaunchServiceImpl(LocalDOMWindow& window)
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_LAUNCH_WEB_LAUNCH_SERVICE_IMPL_H_ #ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_LAUNCH_WEB_LAUNCH_SERVICE_IMPL_H_
#define THIRD_PARTY_BLINK_RENDERER_MODULES_LAUNCH_WEB_LAUNCH_SERVICE_IMPL_H_ #define THIRD_PARTY_BLINK_RENDERER_MODULES_LAUNCH_WEB_LAUNCH_SERVICE_IMPL_H_
#include "mojo/public/cpp/bindings/pending_associated_receiver.h"
#include "third_party/blink/public/mojom/native_file_system/native_file_system_directory_handle.mojom-blink-forward.h" #include "third_party/blink/public/mojom/native_file_system/native_file_system_directory_handle.mojom-blink-forward.h"
#include "third_party/blink/public/mojom/web_launch/web_launch.mojom-blink.h" #include "third_party/blink/public/mojom/web_launch/web_launch.mojom-blink.h"
#include "third_party/blink/renderer/modules/modules_export.h" #include "third_party/blink/renderer/modules/modules_export.h"
...@@ -22,8 +23,9 @@ class LocalDOMWindow; ...@@ -22,8 +23,9 @@ class LocalDOMWindow;
class MODULES_EXPORT WebLaunchServiceImpl final class MODULES_EXPORT WebLaunchServiceImpl final
: public mojom::blink::WebLaunchService { : public mojom::blink::WebLaunchService {
public: public:
static void Create(LocalFrame* frame, static void Create(
mojom::blink::WebLaunchServiceAssociatedRequest); LocalFrame* frame,
mojo::PendingAssociatedReceiver<mojom::blink::WebLaunchService>);
explicit WebLaunchServiceImpl(LocalDOMWindow& frame); explicit WebLaunchServiceImpl(LocalDOMWindow& frame);
~WebLaunchServiceImpl() override; ~WebLaunchServiceImpl() override;
......
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