Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(242)

Side by Side Diff: net/url_request/url_request_error_job.cc

Issue 1395643003: Fix two URLRequestJob subclasses that didn't support cancellation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add OWNERS Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/url_request/url_request_error_job.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/url_request/url_request_error_job.h" 5 #include "net/url_request/url_request_error_job.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
(...skipping 10 matching lines...) Expand all
21 weak_factory_(this) {} 21 weak_factory_(this) {}
22 22
23 URLRequestErrorJob::~URLRequestErrorJob() {} 23 URLRequestErrorJob::~URLRequestErrorJob() {}
24 24
25 void URLRequestErrorJob::Start() { 25 void URLRequestErrorJob::Start() {
26 base::ThreadTaskRunnerHandle::Get()->PostTask( 26 base::ThreadTaskRunnerHandle::Get()->PostTask(
27 FROM_HERE, 27 FROM_HERE,
28 base::Bind(&URLRequestErrorJob::StartAsync, weak_factory_.GetWeakPtr())); 28 base::Bind(&URLRequestErrorJob::StartAsync, weak_factory_.GetWeakPtr()));
29 } 29 }
30 30
31 void URLRequestErrorJob::Kill() {
32 weak_factory_.InvalidateWeakPtrs();
33 URLRequestJob::Kill();
34 }
35
31 void URLRequestErrorJob::StartAsync() { 36 void URLRequestErrorJob::StartAsync() {
32 NotifyStartError(URLRequestStatus(URLRequestStatus::FAILED, error_)); 37 NotifyStartError(URLRequestStatus(URLRequestStatus::FAILED, error_));
33 } 38 }
34 39
35 } // namespace net 40 } // namespace net
OLDNEW
« no previous file with comments | « net/url_request/url_request_error_job.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698