summaryrefslogtreecommitdiffstats
path: root/chrome/common/net/url_request_intercept_job.cc
diff options
context:
space:
mode:
authorwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-03 20:24:50 +0000
committerwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-03 20:24:50 +0000
commitc4a1dc65ee5c402923c8e58ae29c502c58cbe0c1 (patch)
treebfcb8e3adfced68ea314365b32db1e2c13e2fa43 /chrome/common/net/url_request_intercept_job.cc
parentd58df53b86f0c72ec4207455b7fb6c8a500979e9 (diff)
downloadchromium_src-c4a1dc65ee5c402923c8e58ae29c502c58cbe0c1.zip
chromium_src-c4a1dc65ee5c402923c8e58ae29c502c58cbe0c1.tar.gz
chromium_src-c4a1dc65ee5c402923c8e58ae29c502c58cbe0c1.tar.bz2
Stop using adding refcounts to some URLRequestJob subtypes.
Switch to using ScopedRunnableMethodFactory::NewRunnableMethod(). Clean up some unnecessary AddRef()/Release() pairs. BUG=63692 TEST=existing Review URL: http://codereview.chromium.org/5559003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68206 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/net/url_request_intercept_job.cc')
-rw-r--r--chrome/common/net/url_request_intercept_job.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/chrome/common/net/url_request_intercept_job.cc b/chrome/common/net/url_request_intercept_job.cc
index deadd7d..eb3b74f 100644
--- a/chrome/common/net/url_request_intercept_job.cc
+++ b/chrome/common/net/url_request_intercept_job.cc
@@ -8,6 +8,7 @@
#include "chrome/common/net/url_request_intercept_job.h"
+#include "base/compiler_specific.h"
#include "base/message_loop.h"
#include "base/string_util.h"
#include "chrome/common/chrome_plugin_lib.h"
@@ -31,7 +32,8 @@ URLRequestInterceptJob::URLRequestInterceptJob(net::URLRequest* request,
: URLRequestJob(request),
cprequest_(cprequest),
plugin_(plugin),
- read_buffer_(NULL) {
+ read_buffer_(NULL),
+ ALLOW_THIS_IN_INITIALIZER_LIST(method_factory_(this)) {
cprequest_->data = this; // see FromCPRequest().
registrar_.Add(this, NotificationType::CHROME_PLUGIN_UNLOADED,
@@ -53,8 +55,10 @@ void URLRequestInterceptJob::DetachPlugin() {
void URLRequestInterceptJob::Start() {
// Start reading asynchronously so that all error reporting and data
// callbacks happen as they would for network requests.
- MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod(
- this, &URLRequestInterceptJob::StartAsync));
+ MessageLoop::current()->PostTask(
+ FROM_HERE,
+ method_factory_.NewRunnableMethod(
+ &URLRequestInterceptJob::StartAsync));
}
void URLRequestInterceptJob::Kill() {
@@ -64,6 +68,7 @@ void URLRequestInterceptJob::Kill() {
DetachPlugin();
}
URLRequestJob::Kill();
+ method_factory_.RevokeAll();
}
bool URLRequestInterceptJob::ReadRawData(net::IOBuffer* dest, int dest_size,