summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormmenke <mmenke@chromium.org>2015-10-09 05:18:58 -0700
committerCommit bot <commit-bot@chromium.org>2015-10-09 12:20:07 +0000
commit27d71098b7c60b5841a311ff3a9622f133c99319 (patch)
tree12cd21141700bd83b69aee96941194fb9b4a6565
parentd202bccc6c61c6eb2c0980bc30e210fe29b36d7f (diff)
downloadchromium_src-27d71098b7c60b5841a311ff3a9622f133c99319.zip
chromium_src-27d71098b7c60b5841a311ff3a9622f133c99319.tar.gz
chromium_src-27d71098b7c60b5841a311ff3a9622f133c99319.tar.bz2
Fix two URLRequestJob subclasses that didn't support cancellation
This was causing crashes. I suspect there are a bunch of other subclasses with the same issue. :( Also add an OWNERS file to components/about_handler. BUG=508900,541152 Review URL: https://codereview.chromium.org/1395643003 Cr-Commit-Position: refs/heads/master@{#353271}
-rw-r--r--components/about_handler/OWNERS2
-rw-r--r--components/about_handler/url_request_about_job.cc5
-rw-r--r--components/about_handler/url_request_about_job.h1
-rw-r--r--net/url_request/url_request_error_job.cc5
-rw-r--r--net/url_request/url_request_error_job.h1
5 files changed, 14 insertions, 0 deletions
diff --git a/components/about_handler/OWNERS b/components/about_handler/OWNERS
new file mode 100644
index 0000000..e48155c
--- /dev/null
+++ b/components/about_handler/OWNERS
@@ -0,0 +1,2 @@
+mmenke@chromium.org
+davidben@chromium.org
diff --git a/components/about_handler/url_request_about_job.cc b/components/about_handler/url_request_about_job.cc
index 880685a..71e7c1e 100644
--- a/components/about_handler/url_request_about_job.cc
+++ b/components/about_handler/url_request_about_job.cc
@@ -30,6 +30,11 @@ void URLRequestAboutJob::Start() {
base::Bind(&URLRequestAboutJob::StartAsync, weak_factory_.GetWeakPtr()));
}
+void URLRequestAboutJob::Kill() {
+ weak_factory_.InvalidateWeakPtrs();
+ URLRequestJob::Kill();
+}
+
bool URLRequestAboutJob::GetMimeType(std::string* mime_type) const {
*mime_type = "text/html";
return true;
diff --git a/components/about_handler/url_request_about_job.h b/components/about_handler/url_request_about_job.h
index e37c568..d7a445d 100644
--- a/components/about_handler/url_request_about_job.h
+++ b/components/about_handler/url_request_about_job.h
@@ -20,6 +20,7 @@ class URLRequestAboutJob : public net::URLRequestJob {
// URLRequestJob:
void Start() override;
+ void Kill() override;
bool GetMimeType(std::string* mime_type) const override;
private:
diff --git a/net/url_request/url_request_error_job.cc b/net/url_request/url_request_error_job.cc
index efbf424..c2a75c1 100644
--- a/net/url_request/url_request_error_job.cc
+++ b/net/url_request/url_request_error_job.cc
@@ -28,6 +28,11 @@ void URLRequestErrorJob::Start() {
base::Bind(&URLRequestErrorJob::StartAsync, weak_factory_.GetWeakPtr()));
}
+void URLRequestErrorJob::Kill() {
+ weak_factory_.InvalidateWeakPtrs();
+ URLRequestJob::Kill();
+}
+
void URLRequestErrorJob::StartAsync() {
NotifyStartError(URLRequestStatus(URLRequestStatus::FAILED, error_));
}
diff --git a/net/url_request/url_request_error_job.h b/net/url_request/url_request_error_job.h
index 059db26..efd6b66 100644
--- a/net/url_request/url_request_error_job.h
+++ b/net/url_request/url_request_error_job.h
@@ -21,6 +21,7 @@ class NET_EXPORT URLRequestErrorJob : public URLRequestJob {
int error);
void Start() override;
+ void Kill() override;
private:
~URLRequestErrorJob() override;