chromium/chrome/browser/extensions/api/messaging/native_message_port.cc

// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#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 {

// Handles jumping between the |host_task_runner| and the
// |message_service_task_runner|.
// All methods on the host interface should be called on |host_task_runner|.
// All methods on |port| (that calls into MessageServices) should be called
// on |message_service_task_runner|.
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) {}

}  // namespace extensions