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

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

Issue 252003002: Fix WeakPtrFactory member order in net/url_request/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 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_fetcher_response_writer.h ('k') | net/url_request/url_request_ftp_job.h » ('j') | 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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_fetcher_response_writer.h" 5 #include "net/url_request/url_fetcher_response_writer.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/sequenced_task_runner.h" 9 #include "base/sequenced_task_runner.h"
10 #include "base/task_runner_util.h" 10 #include "base/task_runner_util.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 return OK; 45 return OK;
46 } 46 }
47 47
48 URLFetcherStringWriter* URLFetcherStringWriter::AsStringWriter() { 48 URLFetcherStringWriter* URLFetcherStringWriter::AsStringWriter() {
49 return this; 49 return this;
50 } 50 }
51 51
52 URLFetcherFileWriter::URLFetcherFileWriter( 52 URLFetcherFileWriter::URLFetcherFileWriter(
53 scoped_refptr<base::SequencedTaskRunner> file_task_runner, 53 scoped_refptr<base::SequencedTaskRunner> file_task_runner,
54 const base::FilePath& file_path) 54 const base::FilePath& file_path)
55 : weak_factory_(this), 55 : file_task_runner_(file_task_runner),
56 file_task_runner_(file_task_runner),
57 file_path_(file_path), 56 file_path_(file_path),
58 owns_file_(false) { 57 owns_file_(false),
58 weak_factory_(this) {
59 DCHECK(file_task_runner_.get()); 59 DCHECK(file_task_runner_.get());
60 } 60 }
61 61
62 URLFetcherFileWriter::~URLFetcherFileWriter() { 62 URLFetcherFileWriter::~URLFetcherFileWriter() {
63 CloseAndDeleteFile(); 63 CloseAndDeleteFile();
64 } 64 }
65 65
66 int URLFetcherFileWriter::Initialize(const CompletionCallback& callback) { 66 int URLFetcherFileWriter::Initialize(const CompletionCallback& callback) {
67 file_stream_.reset(new FileStream()); 67 file_stream_.reset(new FileStream());
68 68
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 } 182 }
183 183
184 void URLFetcherFileWriter::CloseComplete(const CompletionCallback& callback, 184 void URLFetcherFileWriter::CloseComplete(const CompletionCallback& callback,
185 int result) { 185 int result) {
186 // Destroy |file_stream_| whether or not the close succeeded. 186 // Destroy |file_stream_| whether or not the close succeeded.
187 file_stream_.reset(); 187 file_stream_.reset();
188 callback.Run(result); 188 callback.Run(result);
189 } 189 }
190 190
191 } // namespace net 191 } // namespace net
OLDNEW
« no previous file with comments | « net/url_request/url_fetcher_response_writer.h ('k') | net/url_request/url_request_ftp_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698