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

Side by Side Diff: components/cronet/android/cronet_upload_data_stream.cc

Issue 2351513002: net: rename BoundNetLog to NetLogWithSource (Closed)
Patch Set: one more fix, content bound_net_log_ Created 4 years, 3 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/cronet/android/cronet_upload_data_stream.h" 5 #include "components/cronet/android/cronet_upload_data_stream.h"
6 6
7 #include "net/base/io_buffer.h" 7 #include "net/base/io_buffer.h"
8 #include "net/base/net_errors.h" 8 #include "net/base/net_errors.h"
9 9
10 namespace cronet { 10 namespace cronet {
11 11
12 CronetUploadDataStream::CronetUploadDataStream(Delegate* delegate, int64_t size) 12 CronetUploadDataStream::CronetUploadDataStream(Delegate* delegate, int64_t size)
13 : UploadDataStream(size < 0, 0), 13 : UploadDataStream(size < 0, 0),
14 size_(size), 14 size_(size),
15 waiting_on_read_(false), 15 waiting_on_read_(false),
16 read_in_progress_(false), 16 read_in_progress_(false),
17 waiting_on_rewind_(false), 17 waiting_on_rewind_(false),
18 rewind_in_progress_(false), 18 rewind_in_progress_(false),
19 at_front_of_stream_(true), 19 at_front_of_stream_(true),
20 delegate_(delegate), 20 delegate_(delegate),
21 weak_factory_(this) {} 21 weak_factory_(this) {}
22 22
23 CronetUploadDataStream::~CronetUploadDataStream() { 23 CronetUploadDataStream::~CronetUploadDataStream() {
24 delegate_->OnUploadDataStreamDestroyed(); 24 delegate_->OnUploadDataStreamDestroyed();
25 } 25 }
26 26
27 int CronetUploadDataStream::InitInternal(const net::BoundNetLog& net_log) { 27 int CronetUploadDataStream::InitInternal(const net::NetLogWithSource& net_log) {
28 // ResetInternal should have been called before init, if the stream was in 28 // ResetInternal should have been called before init, if the stream was in
29 // use. 29 // use.
30 DCHECK(!waiting_on_read_); 30 DCHECK(!waiting_on_read_);
31 DCHECK(!waiting_on_rewind_); 31 DCHECK(!waiting_on_rewind_);
32 32
33 if (!weak_factory_.HasWeakPtrs()) 33 if (!weak_factory_.HasWeakPtrs())
34 delegate_->InitializeOnNetworkThread(weak_factory_.GetWeakPtr()); 34 delegate_->InitializeOnNetworkThread(weak_factory_.GetWeakPtr());
35 35
36 // Set size of non-chunked uploads. 36 // Set size of non-chunked uploads.
37 if (size_ >= 0) 37 if (size_ >= 0)
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 DCHECK(!read_in_progress_); 128 DCHECK(!read_in_progress_);
129 DCHECK(waiting_on_rewind_); 129 DCHECK(waiting_on_rewind_);
130 DCHECK(!rewind_in_progress_); 130 DCHECK(!rewind_in_progress_);
131 DCHECK(!at_front_of_stream_); 131 DCHECK(!at_front_of_stream_);
132 132
133 rewind_in_progress_ = true; 133 rewind_in_progress_ = true;
134 delegate_->Rewind(); 134 delegate_->Rewind();
135 } 135 }
136 136
137 } // namespace cronet 137 } // namespace cronet
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698