diff options
author | satorux@chromium.org <satorux@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-15 04:08:41 +0000 |
---|---|---|
committer | satorux@chromium.org <satorux@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-15 04:08:41 +0000 |
commit | 6b230f4db95ebe798a6cec0045322e562065aef5 (patch) | |
tree | fedc9447bfb327132682cdafe95451bf86764bd1 /webkit/tools/test_shell/simple_resource_loader_bridge.cc | |
parent | 9f5dd1d37b5b0496fc4815f7c0c4b84a9f606985 (diff) | |
download | chromium_src-6b230f4db95ebe798a6cec0045322e562065aef5.zip chromium_src-6b230f4db95ebe798a6cec0045322e562065aef5.tar.gz chromium_src-6b230f4db95ebe798a6cec0045322e562065aef5.tar.bz2 |
net: Split FileStream::Read/Write() into sync and async versions.
Historically, FileStream::Read/Write() used to take NULL for synchronous
operations, but these are replaced with ComplocationCallback(), which
is rather ugly. ReadSync() and WriteSync() which do not take a
CompletionCallback are introduced for synchronous operations.
Having function separate signatures make clients code cleaner,
and easier to catch synchronous operations on wrong threads.
This convention also matches with Open/OpenSync and Close/CloseSync.
BUG=72001
TEST=try bots.
Review URL: https://chromiumcodereview.appspot.com/9365024
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@122031 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools/test_shell/simple_resource_loader_bridge.cc')
-rw-r--r-- | webkit/tools/test_shell/simple_resource_loader_bridge.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/webkit/tools/test_shell/simple_resource_loader_bridge.cc b/webkit/tools/test_shell/simple_resource_loader_bridge.cc index cd29965..9a2c80b 100644 --- a/webkit/tools/test_shell/simple_resource_loader_bridge.cc +++ b/webkit/tools/test_shell/simple_resource_loader_bridge.cc @@ -410,7 +410,7 @@ class RequestProxy : public net::URLRequest::Delegate, virtual void OnReceivedData(int bytes_read) { if (download_to_file_) { - file_stream_.Write(buf_->data(), bytes_read, net::CompletionCallback()); + file_stream_.WriteSync(buf_->data(), bytes_read); owner_loop_->PostTask( FROM_HERE, base::Bind(&RequestProxy::NotifyDownloadedData, this, bytes_read)); @@ -724,7 +724,7 @@ class SyncRequestProxy : public RequestProxy { virtual void OnReceivedData(int bytes_read) { if (download_to_file_) - file_stream_.Write(buf_->data(), bytes_read, net::CompletionCallback()); + file_stream_.WriteSync(buf_->data(), bytes_read); else result_->data.append(buf_->data(), bytes_read); AsyncReadData(); // read more (may recurse) |