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

Unified Diff: net/flip/flip_session.cc

Issue 439002: Flip: Fix cancellation code path. (Closed)
Patch Set: Created 11 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/flip/flip_session.cc
diff --git a/net/flip/flip_session.cc b/net/flip/flip_session.cc
index cede942eee80efc9a55cdde9d4901b4a850fa9be..d3bcedc72231fa844bc119656c7cdac3975e8971 100644
--- a/net/flip/flip_session.cc
+++ b/net/flip/flip_session.cc
@@ -461,15 +461,15 @@ void FlipSession::OnWriteComplete(int result) {
scoped_refptr<FlipStream> stream = in_flight_write_.stream();
DCHECK(stream.get());
- if (!stream->cancelled()) {
- // Report the number of bytes written to the caller, but exclude the
- // frame size overhead.
- if (result > 0) {
- DCHECK(result > static_cast<int>(flip::FlipFrame::size()));
- result -= static_cast<int>(flip::FlipFrame::size());
- }
- stream->OnWriteComplete(result);
+ // Report the number of bytes written to the caller, but exclude the
+ // frame size overhead.
+ if (result > 0) {
+ // TODO(willchan): This is an unsafe DCHECK. I'm hitting this. We should
+ // handle small writes appropriately.
+ DCHECK(result > static_cast<int>(flip::FlipFrame::size()));
+ result -= static_cast<int>(flip::FlipFrame::size());
}
+ stream->OnWriteComplete(result);
// Cleanup the write which just completed.
in_flight_write_.release();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698