summaryrefslogtreecommitdiffstats
path: root/net/url_request/url_request_file_job.cc
diff options
context:
space:
mode:
authordarin@google.com <darin@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-07 15:54:23 +0000
committerdarin@google.com <darin@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-07 15:54:23 +0000
commit599664e48f443091d8e686e72928fd4df36898b0 (patch)
tree0fa8dbc8b7152a3ba438e5474df9ea74c284f3eb /net/url_request/url_request_file_job.cc
parent3c8ad73c2dd5ac36c88c0dcfde54e351d5632d28 (diff)
downloadchromium_src-599664e48f443091d8e686e72928fd4df36898b0.zip
chromium_src-599664e48f443091d8e686e72928fd4df36898b0.tar.gz
chromium_src-599664e48f443091d8e686e72928fd4df36898b0.tar.bz2
Rollback changes made to URLRequestFileJob to use ObjectWatcher instead of
ML::WatchObject. This is a test to confirm that the change caused a perf regression on single core machines. TBR=jar git-svn-id: svn://svn.chromium.org/chrome/trunk/src@517 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/url_request/url_request_file_job.cc')
-rw-r--r--net/url_request/url_request_file_job.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/net/url_request/url_request_file_job.cc b/net/url_request/url_request_file_job.cc
index 9f828d4..a738b3a 100644
--- a/net/url_request/url_request_file_job.cc
+++ b/net/url_request/url_request_file_job.cc
@@ -40,7 +40,7 @@
// attempts to read more from the file to fill its buffer. If reading from the
// file does not complete synchronously, then the URLRequestFileJob waits for a
// signal from the OS that the overlapped read has completed. It does so by
-// leveraging the ObjectWatcher API.
+// leveraging the MessageLoop::WatchObject API.
#include <process.h>
#include <windows.h>
@@ -57,7 +57,6 @@
#include "net/url_request/url_request.h"
#include "net/url_request/url_request_file_dir_job.h"
-// TODO(darin): The file job should not depend on WinInet!!
using net::WinInetUtil;
namespace {
@@ -166,7 +165,7 @@ void URLRequestFileJob::Start() {
void URLRequestFileJob::Kill() {
// If we are killed while waiting for an overlapped result...
if (is_waiting_) {
- watcher_.StopWatching();
+ MessageLoop::current()->WatchObject(overlapped_.hEvent, NULL);
is_waiting_ = false;
Release();
}
@@ -204,7 +203,7 @@ bool URLRequestFileJob::ReadRawData(char* dest, int dest_size,
DWORD err = GetLastError();
if (err == ERROR_IO_PENDING) {
// OK, wait for the object to become signaled
- watcher_.StartWatching(overlapped_.hEvent, this);
+ MessageLoop::current()->WatchObject(overlapped_.hEvent, this);
is_waiting_ = true;
SetStatus(URLRequestStatus(URLRequestStatus::IO_PENDING, 0));
AddRef();
@@ -285,7 +284,9 @@ void URLRequestFileJob::OnObjectSignaled(HANDLE object) {
DCHECK(overlapped_.hEvent == object);
DCHECK(is_waiting_);
- // We'll resume watching this handle if need be when we do another IO.
+ // We'll resume watching this handle if need be when we do
+ // another IO.
+ MessageLoop::current()->WatchObject(object, NULL);
is_waiting_ = false;
DWORD bytes_read = 0;