#include "chrome/browser/extensions/api/messaging/native_message_port.h"
#include <memory>
#include <utility>
#include "base/functional/bind.h"
#include "base/task/single_thread_task_runner.h"
#include "chrome/browser/extensions/api/messaging/native_message_process_host.h"
#include "content/public/browser/browser_thread.h"
#include "extensions/common/api/messaging/message.h"
#include "extensions/common/mojom/message_port.mojom-shared.h"
namespace extensions {
class NativeMessagePort::Core : public NativeMessageHost::Client { … };
NativeMessagePort::Core::Core(
std::unique_ptr<NativeMessageHost> host,
base::WeakPtr<NativeMessagePort> port,
scoped_refptr<base::SingleThreadTaskRunner> message_service_task_runner)
: … { … }
NativeMessagePort::Core::~Core() { … }
void NativeMessagePort::Core::OnMessageFromChrome(const std::string& message) { … }
void NativeMessagePort::Core::PostMessageFromNativeHost(
const std::string& message) { … }
void NativeMessagePort::Core::CloseChannel(const std::string& error_message) { … }
NativeMessagePort::NativeMessagePort(
base::WeakPtr<ChannelDelegate> channel_delegate,
const PortId& port_id,
std::unique_ptr<NativeMessageHost> native_message_host)
: … { … }
NativeMessagePort::~NativeMessagePort() { … }
bool NativeMessagePort::IsValidPort() { … }
void NativeMessagePort::DispatchOnMessage(const Message& message) { … }
void NativeMessagePort::PostMessageFromNativeHost(const std::string& message) { … }
void NativeMessagePort::CloseChannel(const std::string& error_message) { … }
}