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

Unified Diff: net/quic/quic_reliable_client_stream.cc

Issue 992733002: Remove //net (except for Android test stuff) and sdch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/quic_reliable_client_stream.h ('k') | net/quic/quic_reliable_client_stream_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_reliable_client_stream.cc
diff --git a/net/quic/quic_reliable_client_stream.cc b/net/quic/quic_reliable_client_stream.cc
deleted file mode 100644
index 68651cb049cec25bdede56ee9121e3da9879fdaa..0000000000000000000000000000000000000000
--- a/net/quic/quic_reliable_client_stream.cc
+++ /dev/null
@@ -1,108 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "net/quic/quic_reliable_client_stream.h"
-
-#include "base/callback_helpers.h"
-#include "net/base/net_errors.h"
-#include "net/quic/quic_session.h"
-#include "net/quic/quic_write_blocked_list.h"
-
-namespace net {
-
-QuicReliableClientStream::QuicReliableClientStream(QuicStreamId id,
- QuicSession* session,
- const BoundNetLog& net_log)
- : QuicDataStream(id, session),
- net_log_(net_log),
- delegate_(nullptr) {
-}
-
-QuicReliableClientStream::~QuicReliableClientStream() {
- if (delegate_)
- delegate_->OnClose(connection_error());
-}
-
-uint32 QuicReliableClientStream::ProcessData(const char* data,
- uint32 data_len) {
- // TODO(rch): buffer data if we don't have a delegate.
- if (!delegate_) {
- DLOG(ERROR) << "Missing delegate";
- Reset(QUIC_STREAM_CANCELLED);
- return 0;
- }
-
- int rv = delegate_->OnDataReceived(data, data_len);
- if (rv != OK) {
- DLOG(ERROR) << "Delegate refused data, rv: " << rv;
- Reset(QUIC_BAD_APPLICATION_PAYLOAD);
- return 0;
- }
- return data_len;
-}
-
-void QuicReliableClientStream::OnClose() {
- if (delegate_) {
- delegate_->OnClose(connection_error());
- delegate_ = nullptr;
- }
- ReliableQuicStream::OnClose();
-}
-
-void QuicReliableClientStream::OnCanWrite() {
- ReliableQuicStream::OnCanWrite();
-
- if (!HasBufferedData() && !callback_.is_null()) {
- base::ResetAndReturn(&callback_).Run(OK);
- }
-}
-
-QuicPriority QuicReliableClientStream::EffectivePriority() const {
- if (delegate_ && delegate_->HasSendHeadersComplete()) {
- return QuicDataStream::EffectivePriority();
- }
- return QuicWriteBlockedList::kHighestPriority;
-}
-
-int QuicReliableClientStream::WriteStreamData(
- base::StringPiece data,
- bool fin,
- const CompletionCallback& callback) {
- // We should not have data buffered.
- DCHECK(!HasBufferedData());
- // Writes the data, or buffers it.
- WriteOrBufferData(data, fin, nullptr);
- if (!HasBufferedData()) {
- return OK;
- }
-
- callback_ = callback;
- return ERR_IO_PENDING;
-}
-
-void QuicReliableClientStream::SetDelegate(
- QuicReliableClientStream::Delegate* delegate) {
- DCHECK(!(delegate_ && delegate));
- delegate_ = delegate;
-}
-
-void QuicReliableClientStream::OnError(int error) {
- if (delegate_) {
- QuicReliableClientStream::Delegate* delegate = delegate_;
- delegate_ = nullptr;
- delegate->OnError(error);
- }
-}
-
-bool QuicReliableClientStream::CanWrite(const CompletionCallback& callback) {
- bool can_write = session()->connection()->CanWrite(HAS_RETRANSMITTABLE_DATA);
- if (!can_write) {
- session()->MarkWriteBlocked(id(), EffectivePriority());
- DCHECK(callback_.is_null());
- callback_ = callback;
- }
- return can_write;
-}
-
-} // namespace net
« no previous file with comments | « net/quic/quic_reliable_client_stream.h ('k') | net/quic/quic_reliable_client_stream_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698