Index: content/browser/webui/url_data_manager_backend.cc |
diff --git a/content/browser/webui/url_data_manager_backend.cc b/content/browser/webui/url_data_manager_backend.cc |
index d6434f03707d775510f705c695aa21536a26dd19..ba1f5d4646e05e7298698d9320121da7aa85489b 100644 |
--- a/content/browser/webui/url_data_manager_backend.cc |
+++ b/content/browser/webui/url_data_manager_backend.cc |
@@ -111,7 +111,8 @@ |
// chrome-internal resource requests asynchronously. |
// It hands off URL requests to ChromeURLDataManager, which asynchronously |
// calls back once the data is available. |
-class URLRequestChromeJob : public net::URLRequestJob { |
+class URLRequestChromeJob : public net::URLRequestJob, |
+ public base::SupportsWeakPtr<URLRequestChromeJob> { |
public: |
// |is_incognito| set when job is generated from an incognito profile. |
URLRequestChromeJob(net::URLRequest* request, |
@@ -133,9 +134,6 @@ |
// Called by ChromeURLDataManager to notify us that the data blob is ready |
// for us. |
void DataAvailable(base::RefCountedMemory* bytes); |
- |
- // Returns a weak pointer to the job. |
- base::WeakPtr<URLRequestChromeJob> AsWeakPtr(); |
void set_mime_type(const std::string& mime_type) { |
mime_type_ = mime_type; |
@@ -269,16 +267,13 @@ |
BrowserThread::UI, |
FROM_HERE, |
base::Bind(&URLRequestChromeJob::CheckStoragePartitionMatches, |
- render_process_id, request_->url(), |
- weak_factory_.GetWeakPtr())); |
+ render_process_id, request_->url(), AsWeakPtr())); |
TRACE_EVENT_ASYNC_BEGIN1("browser", "DataManager:Request", this, "URL", |
request_->url().possibly_invalid_spec()); |
} |
void URLRequestChromeJob::Kill() { |
- weak_factory_.InvalidateWeakPtrs(); |
backend_->RemoveRequest(this); |
- URLRequestJob::Kill(); |
} |
bool URLRequestChromeJob::GetMimeType(std::string* mime_type) const { |
@@ -352,10 +347,6 @@ |
NotifyDone(net::URLRequestStatus(net::URLRequestStatus::FAILED, |
net::ERR_FAILED)); |
} |
-} |
- |
-base::WeakPtr<URLRequestChromeJob> URLRequestChromeJob::AsWeakPtr() { |
- return weak_factory_.GetWeakPtr(); |
} |
bool URLRequestChromeJob::ReadRawData(net::IOBuffer* buf, int buf_size, |