| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/spdy/spdy_stream.h" | 5 #include "net/spdy/spdy_stream.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/singleton.h" | 9 #include "base/singleton.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 | 352 |
| 353 void SpdyStream::OnClose(int status) { | 353 void SpdyStream::OnClose(int status) { |
| 354 io_state_ = STATE_DONE; | 354 io_state_ = STATE_DONE; |
| 355 response_status_ = status; | 355 response_status_ = status; |
| 356 Delegate* delegate = delegate_; | 356 Delegate* delegate = delegate_; |
| 357 delegate_ = NULL; | 357 delegate_ = NULL; |
| 358 if (delegate) | 358 if (delegate) |
| 359 delegate->OnClose(status); | 359 delegate->OnClose(status); |
| 360 } | 360 } |
| 361 | 361 |
| 362 void SpdyStream::Close() { |
| 363 session_->CloseStream(stream_id_, OK); |
| 364 } |
| 365 |
| 362 void SpdyStream::Cancel() { | 366 void SpdyStream::Cancel() { |
| 363 if (cancelled()) | 367 if (cancelled()) |
| 364 return; | 368 return; |
| 365 | 369 |
| 366 cancelled_ = true; | 370 cancelled_ = true; |
| 367 if (session_->IsStreamActive(stream_id_)) | 371 if (session_->IsStreamActive(stream_id_)) |
| 368 session_->ResetStream(stream_id_, spdy::CANCEL); | 372 session_->ResetStream(stream_id_, spdy::CANCEL); |
| 369 } | 373 } |
| 370 | 374 |
| 371 int SpdyStream::SendRequest(bool has_upload_data) { | 375 int SpdyStream::SendRequest(bool has_upload_data) { |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 541 UMA_HISTOGRAM_TIMES("Net.SpdyStreamDownloadTime", | 545 UMA_HISTOGRAM_TIMES("Net.SpdyStreamDownloadTime", |
| 542 recv_last_byte_time_ - recv_first_byte_time_); | 546 recv_last_byte_time_ - recv_first_byte_time_); |
| 543 UMA_HISTOGRAM_TIMES("Net.SpdyStreamTime", | 547 UMA_HISTOGRAM_TIMES("Net.SpdyStreamTime", |
| 544 recv_last_byte_time_ - send_time_); | 548 recv_last_byte_time_ - send_time_); |
| 545 | 549 |
| 546 UMA_HISTOGRAM_COUNTS("Net.SpdySendBytes", send_bytes_); | 550 UMA_HISTOGRAM_COUNTS("Net.SpdySendBytes", send_bytes_); |
| 547 UMA_HISTOGRAM_COUNTS("Net.SpdyRecvBytes", recv_bytes_); | 551 UMA_HISTOGRAM_COUNTS("Net.SpdyRecvBytes", recv_bytes_); |
| 548 } | 552 } |
| 549 | 553 |
| 550 } // namespace net | 554 } // namespace net |
| OLD | NEW |