Asynchronously open the temp file used for Pepper StreamToFile, and delete the
temp file once we are done with it.

We observe ResourceHandle::OnRequestClosed as a signal of when we should delete
the temp file.  This corresponds to the WebURLLoader being closed (or
canceled).

This patch also includes some helpers:

base/scoped_callback_factory.h
  This class makes it easy to allocate Callbacks that hold a weak reference
  back to the owning class.  It works just like ScopedRunnableMethodFactory
  but for Callbacks instead of RunnableMethods.

base/platform_file.h
  Added a PassPlatformFile class that is useful for cases where a callback may
  decide not to take ownership of a PlatformFile (as can happen when using
  ScopedCallbackFactory).

chrome/file_system_proxy.{h,cc}
  This class provides static methods for executing file system commands on the
  FILE thread.  It routes callbacks back to the originating thread to deliver
  results (file handles, etc.).  Note: this file declares a few functions that
  are not yet used.  I anticipate that we'll make use of these and add more
  functions here to support the Pepper and OWP FileSystem APIs.

chrome/chrome_thread_relay.{h,cc}
  This class is a helper class for proxying calls over to a background
  ChromeThread and then returning results to the originating ChromeThread.

R=brettw
BUG=49789
TEST=(more to be added in third_party/ppapi/tests)

Review URL: http://codereview.chromium.org/2878062

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54402 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi
index 1b5ea58..25f9996 100644
--- a/chrome/chrome_browser.gypi
+++ b/chrome/chrome_browser.gypi
@@ -346,6 +346,8 @@
         'browser/chrome_plugin_host.h',
         'browser/chrome_thread.cc',
         'browser/chrome_thread.h',
+        'browser/chrome_thread_relay.cc',
+        'browser/chrome_thread_relay.h',
         'browser/chromeos/notifications/balloon_collection_impl.h',
         'browser/chromeos/notifications/balloon_collection_impl.cc',
         'browser/chromeos/notifications/balloon_view.h',
@@ -1390,6 +1392,8 @@
         'browser/file_watcher_inotify.cc',
         'browser/file_watcher_mac.cc',
         'browser/file_watcher_win.cc',
+        'browser/file_system_proxy.cc',
+        'browser/file_system_proxy.h',
         'browser/find_bar.h',
         'browser/find_bar_controller.cc',
         'browser/find_bar_controller.h',