Commit 0981210c authored by n.bansal@samsung.com's avatar n.bansal@samsung.com

Fix WeakPtrFactory member order in net/url_request/

BUG=303818

Review URL: https://codereview.chromium.org/252003002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@272645 0039d316-1c4b-4281-b951-d872f2087c98
parent d884f4cc
...@@ -255,6 +255,7 @@ Naoki Takano <takano.naoki@gmail.com> ...@@ -255,6 +255,7 @@ Naoki Takano <takano.naoki@gmail.com>
Naveen Bobbili <naveenbobbili@motorola.com> Naveen Bobbili <naveenbobbili@motorola.com>
Naveen Bobbili <qghc36@motorola.com> Naveen Bobbili <qghc36@motorola.com>
Nayan Kumar K <qtc746@motorola.com> Nayan Kumar K <qtc746@motorola.com>
Nikhil Bansal <n.bansal@samsung.com>
Nikita Ofitserov <himikof@gmail.com> Nikita Ofitserov <himikof@gmail.com>
Ningxin Hu <ningxin.hu@intel.com> Ningxin Hu <ningxin.hu@intel.com>
Nitish Mehrotra <nitish.m@samsung.com> Nitish Mehrotra <nitish.m@samsung.com>
......
...@@ -52,10 +52,10 @@ URLFetcherStringWriter* URLFetcherStringWriter::AsStringWriter() { ...@@ -52,10 +52,10 @@ URLFetcherStringWriter* URLFetcherStringWriter::AsStringWriter() {
URLFetcherFileWriter::URLFetcherFileWriter( URLFetcherFileWriter::URLFetcherFileWriter(
scoped_refptr<base::SequencedTaskRunner> file_task_runner, scoped_refptr<base::SequencedTaskRunner> file_task_runner,
const base::FilePath& file_path) const base::FilePath& file_path)
: weak_factory_(this), : file_task_runner_(file_task_runner),
file_task_runner_(file_task_runner),
file_path_(file_path), file_path_(file_path),
owns_file_(false) { owns_file_(false),
weak_factory_(this) {
DCHECK(file_task_runner_.get()); DCHECK(file_task_runner_.get());
} }
......
...@@ -121,9 +121,6 @@ class NET_EXPORT URLFetcherFileWriter : public URLFetcherResponseWriter { ...@@ -121,9 +121,6 @@ class NET_EXPORT URLFetcherFileWriter : public URLFetcherResponseWriter {
// Callback which gets the result of closing a file. // Callback which gets the result of closing a file.
void CloseComplete(const CompletionCallback& callback, int result); void CloseComplete(const CompletionCallback& callback, int result);
// Callbacks are created for use with base::FileUtilProxy.
base::WeakPtrFactory<URLFetcherFileWriter> weak_factory_;
// Task runner on which file operations should happen. // Task runner on which file operations should happen.
scoped_refptr<base::SequencedTaskRunner> file_task_runner_; scoped_refptr<base::SequencedTaskRunner> file_task_runner_;
...@@ -136,6 +133,9 @@ class NET_EXPORT URLFetcherFileWriter : public URLFetcherResponseWriter { ...@@ -136,6 +133,9 @@ class NET_EXPORT URLFetcherFileWriter : public URLFetcherResponseWriter {
scoped_ptr<FileStream> file_stream_; scoped_ptr<FileStream> file_stream_;
// Callbacks are created for use with base::FileUtilProxy.
base::WeakPtrFactory<URLFetcherFileWriter> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(URLFetcherFileWriter); DISALLOW_COPY_AND_ASSIGN(URLFetcherFileWriter);
}; };
......
...@@ -34,9 +34,9 @@ URLRequestFtpJob::URLRequestFtpJob( ...@@ -34,9 +34,9 @@ URLRequestFtpJob::URLRequestFtpJob(
pac_request_(NULL), pac_request_(NULL),
http_response_info_(NULL), http_response_info_(NULL),
read_in_progress_(false), read_in_progress_(false),
weak_factory_(this),
ftp_transaction_factory_(ftp_transaction_factory), ftp_transaction_factory_(ftp_transaction_factory),
ftp_auth_cache_(ftp_auth_cache) { ftp_auth_cache_(ftp_auth_cache),
weak_factory_(this) {
DCHECK(proxy_service_); DCHECK(proxy_service_);
DCHECK(ftp_transaction_factory); DCHECK(ftp_transaction_factory);
DCHECK(ftp_auth_cache); DCHECK(ftp_auth_cache);
......
...@@ -94,11 +94,11 @@ class NET_EXPORT_PRIVATE URLRequestFtpJob : public URLRequestJob { ...@@ -94,11 +94,11 @@ class NET_EXPORT_PRIVATE URLRequestFtpJob : public URLRequestJob {
scoped_refptr<AuthData> auth_data_; scoped_refptr<AuthData> auth_data_;
base::WeakPtrFactory<URLRequestFtpJob> weak_factory_;
FtpTransactionFactory* ftp_transaction_factory_; FtpTransactionFactory* ftp_transaction_factory_;
FtpAuthCache* ftp_auth_cache_; FtpAuthCache* ftp_auth_cache_;
base::WeakPtrFactory<URLRequestFtpJob> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(URLRequestFtpJob); DISALLOW_COPY_AND_ASSIGN(URLRequestFtpJob);
}; };
......
...@@ -193,12 +193,12 @@ URLRequestHttpJob::URLRequestHttpJob( ...@@ -193,12 +193,12 @@ URLRequestHttpJob::URLRequestHttpJob(
request_time_snapshot_(), request_time_snapshot_(),
final_packet_time_(), final_packet_time_(),
filter_context_(new HttpFilterContext(this)), filter_context_(new HttpFilterContext(this)),
weak_factory_(this),
on_headers_received_callback_( on_headers_received_callback_(
base::Bind(&URLRequestHttpJob::OnHeadersReceivedCallback, base::Bind(&URLRequestHttpJob::OnHeadersReceivedCallback,
base::Unretained(this))), base::Unretained(this))),
awaiting_callback_(false), awaiting_callback_(false),
http_user_agent_settings_(http_user_agent_settings) { http_user_agent_settings_(http_user_agent_settings),
weak_factory_(this) {
URLRequestThrottlerManager* manager = request->context()->throttler_manager(); URLRequestThrottlerManager* manager = request->context()->throttler_manager();
if (manager) if (manager)
throttling_entry_ = manager->RegisterRequestUrl(request->url()); throttling_entry_ = manager->RegisterRequestUrl(request->url());
......
...@@ -248,7 +248,6 @@ class NET_EXPORT_PRIVATE URLRequestHttpJob : public URLRequestJob { ...@@ -248,7 +248,6 @@ class NET_EXPORT_PRIVATE URLRequestHttpJob : public URLRequestJob {
base::TimeTicks receive_headers_end_; base::TimeTicks receive_headers_end_;
scoped_ptr<HttpFilterContext> filter_context_; scoped_ptr<HttpFilterContext> filter_context_;
base::WeakPtrFactory<URLRequestHttpJob> weak_factory_;
CompletionCallback on_headers_received_callback_; CompletionCallback on_headers_received_callback_;
...@@ -271,6 +270,8 @@ class NET_EXPORT_PRIVATE URLRequestHttpJob : public URLRequestJob { ...@@ -271,6 +270,8 @@ class NET_EXPORT_PRIVATE URLRequestHttpJob : public URLRequestJob {
const HttpUserAgentSettings* http_user_agent_settings_; const HttpUserAgentSettings* http_user_agent_settings_;
base::WeakPtrFactory<URLRequestHttpJob> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(URLRequestHttpJob); DISALLOW_COPY_AND_ASSIGN(URLRequestHttpJob);
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment