Delete unused class AsyncFile.
BUG=webrtc:6424 Review-Url: https://codereview.webrtc.org/2566953002 Cr-Commit-Position: refs/heads/master@{#15561}
This commit is contained in:
parent
1b7230015c
commit
921019c48b
@ -388,8 +388,6 @@ rtc_static_library("rtc_base") {
|
||||
|
||||
sources = [
|
||||
"applefilesystem.mm",
|
||||
"asyncfile.cc",
|
||||
"asyncfile.h",
|
||||
"asyncinvoker-inl.h",
|
||||
"asyncinvoker.cc",
|
||||
"asyncinvoker.h",
|
||||
|
||||
@ -1,21 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010 The WebRTC Project Authors. All rights reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include "webrtc/base/asyncfile.h"
|
||||
|
||||
namespace rtc {
|
||||
|
||||
AsyncFile::AsyncFile() {
|
||||
}
|
||||
|
||||
AsyncFile::~AsyncFile() {
|
||||
}
|
||||
|
||||
} // namespace rtc
|
||||
@ -1,40 +0,0 @@
|
||||
/*
|
||||
* Copyright 2004 The WebRTC Project Authors. All rights reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef WEBRTC_BASE_ASYNCFILE_H__
|
||||
#define WEBRTC_BASE_ASYNCFILE_H__
|
||||
|
||||
#include "webrtc/base/sigslot.h"
|
||||
|
||||
namespace rtc {
|
||||
|
||||
// Provides the ability to perform file I/O asynchronously.
|
||||
// TODO: Create a common base class with AsyncSocket.
|
||||
class AsyncFile {
|
||||
public:
|
||||
AsyncFile();
|
||||
virtual ~AsyncFile();
|
||||
|
||||
// Determines whether the file will receive read events.
|
||||
virtual bool readable() = 0;
|
||||
virtual void set_readable(bool value) = 0;
|
||||
|
||||
// Determines whether the file will receive write events.
|
||||
virtual bool writable() = 0;
|
||||
virtual void set_writable(bool value) = 0;
|
||||
|
||||
sigslot::signal1<AsyncFile*> SignalReadEvent;
|
||||
sigslot::signal1<AsyncFile*> SignalWriteEvent;
|
||||
sigslot::signal2<AsyncFile*, int> SignalCloseEvent;
|
||||
};
|
||||
|
||||
} // namespace rtc
|
||||
|
||||
#endif // WEBRTC_BASE_ASYNCFILE_H__
|
||||
@ -1051,61 +1051,6 @@ class PosixSignalDispatcher : public Dispatcher {
|
||||
PhysicalSocketServer *owner_;
|
||||
};
|
||||
|
||||
class FileDispatcher: public Dispatcher, public AsyncFile {
|
||||
public:
|
||||
FileDispatcher(int fd, PhysicalSocketServer *ss) : ss_(ss), fd_(fd) {
|
||||
set_readable(true);
|
||||
|
||||
ss_->Add(this);
|
||||
|
||||
fcntl(fd_, F_SETFL, fcntl(fd_, F_GETFL, 0) | O_NONBLOCK);
|
||||
}
|
||||
|
||||
~FileDispatcher() override {
|
||||
ss_->Remove(this);
|
||||
}
|
||||
|
||||
SocketServer* socketserver() { return ss_; }
|
||||
|
||||
int GetDescriptor() override { return fd_; }
|
||||
|
||||
bool IsDescriptorClosed() override { return false; }
|
||||
|
||||
uint32_t GetRequestedEvents() override { return flags_; }
|
||||
|
||||
void OnPreEvent(uint32_t ff) override {}
|
||||
|
||||
void OnEvent(uint32_t ff, int err) override {
|
||||
if ((ff & DE_READ) != 0)
|
||||
SignalReadEvent(this);
|
||||
if ((ff & DE_WRITE) != 0)
|
||||
SignalWriteEvent(this);
|
||||
if ((ff & DE_CLOSE) != 0)
|
||||
SignalCloseEvent(this, err);
|
||||
}
|
||||
|
||||
bool readable() override { return (flags_ & DE_READ) != 0; }
|
||||
|
||||
void set_readable(bool value) override {
|
||||
flags_ = value ? (flags_ | DE_READ) : (flags_ & ~DE_READ);
|
||||
}
|
||||
|
||||
bool writable() override { return (flags_ & DE_WRITE) != 0; }
|
||||
|
||||
void set_writable(bool value) override {
|
||||
flags_ = value ? (flags_ | DE_WRITE) : (flags_ & ~DE_WRITE);
|
||||
}
|
||||
|
||||
private:
|
||||
PhysicalSocketServer* ss_;
|
||||
int fd_;
|
||||
int flags_;
|
||||
};
|
||||
|
||||
AsyncFile* PhysicalSocketServer::CreateFile(int fd) {
|
||||
return new FileDispatcher(fd, this);
|
||||
}
|
||||
|
||||
#endif // WEBRTC_POSIX
|
||||
|
||||
#if defined(WEBRTC_WIN)
|
||||
|
||||
@ -14,7 +14,6 @@
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "webrtc/base/asyncfile.h"
|
||||
#include "webrtc/base/nethelpers.h"
|
||||
#include "webrtc/base/socketserver.h"
|
||||
#include "webrtc/base/criticalsection.h"
|
||||
@ -79,8 +78,6 @@ class PhysicalSocketServer : public SocketServer {
|
||||
void Remove(Dispatcher* dispatcher);
|
||||
|
||||
#if defined(WEBRTC_POSIX)
|
||||
AsyncFile* CreateFile(int fd);
|
||||
|
||||
// Sets the function to be executed in response to the specified POSIX signal.
|
||||
// The function is executed from inside Wait() using the "self-pipe trick"--
|
||||
// regardless of which thread receives the signal--and hence can safely
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user