#include "components/js_injection/browser/js_to_browser_messaging.h"
#include "base/containers/contains.h"
#include "base/memory/raw_ptr.h"
#include "components/js_injection/browser/web_message.h"
#include "components/js_injection/browser/web_message_host.h"
#include "components/js_injection/browser/web_message_host_factory.h"
#include "components/js_injection/browser/web_message_reply_proxy.h"
#include "components/js_injection/common/interfaces.mojom-forward.h"
#include "content/public/browser/disallow_activation_reason.h"
#include "content/public/browser/document_user_data.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/web_contents.h"
#include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h"
#include "third_party/blink/public/common/messaging/message_port_descriptor.h"
#include "third_party/blink/public/common/messaging/string_message_codec.h"
#include "url/origin.h"
#include "url/url_util.h"
namespace js_injection {
namespace …
class JsToBrowserMessaging::ReplyProxyImpl : public WebMessageReplyProxy { … };
JsToBrowserMessaging::JsToBrowserMessaging(
content::RenderFrameHost* render_frame_host,
mojo::PendingAssociatedReceiver<mojom::JsToBrowserMessaging> receiver,
mojo::PendingAssociatedRemote<mojom::BrowserToJsMessagingFactory>
browser_to_js_factory,
WebMessageHostFactory* factory,
const OriginMatcher& origin_matcher)
: … { … }
JsToBrowserMessaging::~JsToBrowserMessaging() = default;
void JsToBrowserMessaging::OnRenderFrameHostActivated() { … }
void JsToBrowserMessaging::PostMessage(
blink::WebMessagePayload message,
std::vector<blink::MessagePortDescriptor> ports) { … }
void JsToBrowserMessaging::SetBrowserToJsMessaging(
mojo::PendingAssociatedRemote<mojom::BrowserToJsMessaging>
java_to_js_messaging) { … }
}