FileWrapper[Impl] modifications and actually remove the "Impl" class.

This is a somewhat involved refactoring of this class. Here's an overview of the changes:

* FileWrapper can now be used as a regular class and instances allocated on the stack.
* The type now has support for move semantics and copy isn't allowed.
* New public ctor with FILE* that can be used instead of OpenFromFileHandle.
* New static Open() method.  The intent of this is to allow opening a file and getting back a FileWrapper instance.  Using this method instead of Create(), will allow us in the future to make the FILE* member pointer, to be const and simplify threading (get rid of the lock).
* Rename the Open() method to is_open() and make it inline.
* The FileWrapper interface is no longer a pure virtual interface.  There's only one implementation so there's no need to go through a vtable for everything.
* Functionality offered by the class, is now reduced.  No support for looping (not clear if that was actually useful to users of that flag), no need to implement the 'read_only_' functionality in the class, since file APIs implement that already, no support for *not* managing the file handle (this wasn't used).  OpenFromFileHandle always "manages" the file.
* Delete the unused WriteText() method and don't support opening files in text mode.  Text mode is only different on Windows and on Windows it translates \n to \r\n, which means that files such as log files, could have a slightly different format on Windows than other platforms.  Besides, tools on Windows can handle UNIX line endings.
* Remove FileName(), change Trace code to manage its own path.
* Rename id_ member variable to file_.
* Removed the open_ member variable since the same functionality can be gotten from just checking the file pointer.
* Don't call CloseFile inside of Write.  Write shouldn't be changing the state of the class beyond just attempting to write.
* Remove concept of looping from FileWrapper and never close inside of Read()
* Changed stream base classes to inherit from a common base class instead of both defining the Rewind method. Ultimately, Id' like to remove these interfaces and just have FileWrapper.
* Remove read_only param from OpenFromFileHandle
* Renamed size_in_bytes_ to position_, since it gets set to 0 when Rewind() is called (and the size actually does not change).
* Switch out rw lock for CriticalSection. The r/w lock was only used for reading when checking the open_ flag.

BUG=

Review-Url: https://codereview.webrtc.org/2054373002
Cr-Commit-Position: refs/heads/master@{#13155}
27 files changed
tree: 523950473b6aaf5191daa96a7f257b54ac5f5e1a
  1. build_overrides/
  2. chromium/
  3. data/
  4. infra/
  5. resources/
  6. talk/
  7. third_party/
  8. tools/
  9. webrtc/
  10. .clang-format
  11. .gitignore
  12. .gn
  13. all.gyp
  14. AUTHORS
  15. BUILD.gn
  16. check_root_dir.py
  17. codereview.settings
  18. COPYING
  19. DEPS
  20. LICENSE
  21. license_template.txt
  22. LICENSE_THIRD_PARTY
  23. OWNERS
  24. PATENTS
  25. PRESUBMIT.py
  26. pylintrc
  27. README.md
  28. setup_links.py
  29. sync_chromium.py
  30. WATCHLISTS
README.md

WebRTC is a free, open software project that provides browsers and mobile applications with Real-Time Communications (RTC) capabilities via simple APIs. The WebRTC components have been optimized to best serve this purpose.

Our mission: To enable rich, high-quality RTC applications to be developed for the browser, mobile platforms, and IoT devices, and allow them all to communicate via a common set of protocols.

The WebRTC initiative is a project supported by Google, Mozilla and Opera, amongst others. This page is maintained by the Google Chrome team.

Development

See http://www.webrtc.org/native-code/development for instructions on how to get started developing with the native code.

More info