diff --git a/src/system_wrappers/source/file_impl.cc b/src/system_wrappers/source/file_impl.cc index 3832240777..4d06c54707 100644 --- a/src/system_wrappers/source/file_impl.cc +++ b/src/system_wrappers/source/file_impl.cc @@ -8,7 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "system_wrappers/source/file_impl.h" +#include "file_impl.h" #include @@ -19,8 +19,6 @@ #include #endif -#include "system_wrappers/interface/rw_lock_wrapper.h" - namespace webrtc { FileWrapper* FileWrapper::Create() @@ -29,8 +27,7 @@ FileWrapper* FileWrapper::Create() } FileWrapperImpl::FileWrapperImpl() - : _rwLock(RWLockWrapper::CreateRWLock()), - _id(NULL), + : _id(NULL), _open(false), _looping(false), _readOnly(false), @@ -50,7 +47,6 @@ FileWrapperImpl::~FileWrapperImpl() int FileWrapperImpl::CloseFile() { - WriteLockScoped write(*_rwLock); if (_id != NULL) { fclose(_id); @@ -63,7 +59,6 @@ int FileWrapperImpl::CloseFile() int FileWrapperImpl::Rewind() { - WriteLockScoped write(*_rwLock); if(_looping || !_readOnly) { if (_id != NULL) @@ -77,14 +72,12 @@ int FileWrapperImpl::Rewind() int FileWrapperImpl::SetMaxFileSize(size_t bytes) { - WriteLockScoped write(*_rwLock); _maxSizeInBytes = bytes; return 0; } int FileWrapperImpl::Flush() { - WriteLockScoped write(*_rwLock); if (_id != NULL) { return fflush(_id); @@ -95,7 +88,6 @@ int FileWrapperImpl::Flush() int FileWrapperImpl::FileName(char* fileNameUTF8, size_t size) const { - ReadLockScoped read(*_rwLock); size_t length = strlen(_fileNameUTF8); if(length > kMaxFileNameSize) { @@ -119,14 +111,12 @@ int FileWrapperImpl::FileName(char* fileNameUTF8, bool FileWrapperImpl::Open() const { - ReadLockScoped read(*_rwLock); return _open; } int FileWrapperImpl::OpenFile(const char *fileNameUTF8, bool readOnly, bool loop, bool text) { - WriteLockScoped write(*_rwLock); size_t length = strlen(fileNameUTF8); if (length > kMaxFileNameSize - 1) { @@ -199,7 +189,6 @@ int FileWrapperImpl::OpenFile(const char *fileNameUTF8, bool readOnly, int FileWrapperImpl::Read(void* buf, int length) { - WriteLockScoped write(*_rwLock); if (length < 0) return -1; @@ -216,7 +205,6 @@ int FileWrapperImpl::Read(void* buf, int length) int FileWrapperImpl::WriteText(const char* format, ...) { - WriteLockScoped write(*_rwLock); if (format == NULL) return -1; @@ -244,7 +232,6 @@ int FileWrapperImpl::WriteText(const char* format, ...) bool FileWrapperImpl::Write(const void* buf, int length) { - WriteLockScoped write(*_rwLock); if (buf == NULL) return false; diff --git a/src/system_wrappers/source/file_impl.h b/src/system_wrappers/source/file_impl.h index 4cd7eecf0d..31ab31e533 100644 --- a/src/system_wrappers/source/file_impl.h +++ b/src/system_wrappers/source/file_impl.h @@ -11,16 +11,12 @@ #ifndef WEBRTC_SYSTEM_WRAPPERS_SOURCE_FILE_IMPL_H_ #define WEBRTC_SYSTEM_WRAPPERS_SOURCE_FILE_IMPL_H_ -#include "system_wrappers/interface/file_wrapper.h" +#include "file_wrapper.h" #include -#include "system_wrappers/interface/scoped_ptr.h" - namespace webrtc { -class RWLockWrapper; - class FileWrapperImpl : public FileWrapper { public: @@ -47,8 +43,6 @@ public: virtual int Rewind(); private: - scoped_ptr _rwLock; - FILE* _id; bool _open; bool _looping;