blob: 6d001aeccc5f9262f545fd8f7ecfa2d95e99f52a [file] [log] [blame]
// Copyright 2018 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "shill/net/io_handler_factory.h"
#include "shill/net/io_input_handler.h"
#include "shill/net/io_ready_handler.h"
namespace shill {
IOHandlerFactory::IOHandlerFactory() {}
IOHandlerFactory::~IOHandlerFactory() {}
IOHandler* IOHandlerFactory::CreateIOInputHandler(
int fd,
const IOHandler::InputCallback& input_callback,
const IOHandler::ErrorCallback& error_callback) {
IOHandler* handler = new IOInputHandler(fd, input_callback, error_callback);
handler->Start();
return handler;
}
IOHandler* IOHandlerFactory::CreateIOReadyHandler(
int fd,
IOHandler::ReadyMode mode,
const IOHandler::ReadyCallback& ready_callback) {
IOHandler* handler = new IOReadyHandler(fd, mode, ready_callback);
handler->Start();
return handler;
}
} // namespace shill