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

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

Issue 2915053003: Remove unused BidirectionalStream::SendData() method and implementations. (Closed)
Patch Set: Fix Created 3 years, 6 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 | « no previous file | net/http/bidirectional_stream.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 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 "cronet_bidirectional_stream_adapter.h" 5 #include "cronet_bidirectional_stream_adapter.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 // If stream failed between the time when WritevData is invoked and 391 // If stream failed between the time when WritevData is invoked and
392 // WritevDataOnNetworkThread is executed, do not call into |bidi_stream_| 392 // WritevDataOnNetworkThread is executed, do not call into |bidi_stream_|
393 // since the underlying stream might have been destroyed. Do not invoke 393 // since the underlying stream might have been destroyed. Do not invoke
394 // Java callback either, since onError is posted when |stream_failed_| is 394 // Java callback either, since onError is posted when |stream_failed_| is
395 // set to true. 395 // set to true.
396 return; 396 return;
397 } 397 }
398 398
399 pending_write_data_ = std::move(pending_write_data); 399 pending_write_data_ = std::move(pending_write_data);
400 bool end_of_stream = pending_write_data_->jwrite_end_of_stream == JNI_TRUE; 400 bool end_of_stream = pending_write_data_->jwrite_end_of_stream == JNI_TRUE;
401 if (pending_write_data_->write_buffer_list.size() == 1) { 401 bidi_stream_->SendvData(pending_write_data_->write_buffer_list,
402 bidi_stream_->SendData(pending_write_data_->write_buffer_list[0], 402 pending_write_data_->write_buffer_len_list,
403 pending_write_data_->write_buffer_len_list[0], 403 end_of_stream);
404 end_of_stream);
405 } else {
406 bidi_stream_->SendvData(pending_write_data_->write_buffer_list,
407 pending_write_data_->write_buffer_len_list,
408 end_of_stream);
409 }
410 } 404 }
411 405
412 void CronetBidirectionalStreamAdapter::DestroyOnNetworkThread( 406 void CronetBidirectionalStreamAdapter::DestroyOnNetworkThread(
413 bool send_on_canceled) { 407 bool send_on_canceled) {
414 DCHECK(context_->IsOnNetworkThread()); 408 DCHECK(context_->IsOnNetworkThread());
415 if (send_on_canceled) { 409 if (send_on_canceled) {
416 JNIEnv* env = base::android::AttachCurrentThread(); 410 JNIEnv* env = base::android::AttachCurrentThread();
417 cronet::Java_CronetBidirectionalStream_onCanceled(env, owner_.obj()); 411 cronet::Java_CronetBidirectionalStream_onCanceled(env, owner_.obj());
418 } 412 }
419 MaybeReportMetrics(); 413 MaybeReportMetrics();
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 start_time), 464 start_time),
471 metrics_util::ConvertTime(load_timing_info.receive_headers_end, 465 metrics_util::ConvertTime(load_timing_info.receive_headers_end,
472 start_ticks, start_time), 466 start_ticks, start_time),
473 metrics_util::ConvertTime(base::TimeTicks::Now(), start_ticks, 467 metrics_util::ConvertTime(base::TimeTicks::Now(), start_ticks,
474 start_time), 468 start_time),
475 load_timing_info.socket_reused, bidi_stream_->GetTotalSentBytes(), 469 load_timing_info.socket_reused, bidi_stream_->GetTotalSentBytes(),
476 bidi_stream_->GetTotalReceivedBytes()); 470 bidi_stream_->GetTotalReceivedBytes());
477 } 471 }
478 472
479 } // namespace cronet 473 } // namespace cronet
OLDNEW
« no previous file with comments | « no previous file | net/http/bidirectional_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698