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

Unified Diff: net/quic/chromium/bidirectional_stream_quic_impl.h

Issue 2915973002: Fix potential crash bug with BidirectionalStreamQuicImpl::SendRequestHeaders (Closed)
Patch Set: More comments Created 3 years, 7 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 | « no previous file | net/quic/chromium/bidirectional_stream_quic_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/chromium/bidirectional_stream_quic_impl.h
diff --git a/net/quic/chromium/bidirectional_stream_quic_impl.h b/net/quic/chromium/bidirectional_stream_quic_impl.h
index 36129e1914d3305a0946676c25bfc6b4249b5cb3..af5bcf4a348f7547ab6359b60551a2fe33690254 100644
--- a/net/quic/chromium/bidirectional_stream_quic_impl.h
+++ b/net/quic/chromium/bidirectional_stream_quic_impl.h
@@ -61,6 +61,10 @@ class NET_EXPORT_PRIVATE BidirectionalStreamQuicImpl
void OnClose() override;
void OnError(int error) override;
+ // Write headers to the stream and returns true on success. Posts a task to
+ // notify the delegate asynchronously and returns false on failure
+ bool WriteHeaders();
+
void OnStreamReady(int rv);
void OnSendDataComplete(int rv);
void ReadInitialHeaders();
@@ -69,12 +73,20 @@ class NET_EXPORT_PRIVATE BidirectionalStreamQuicImpl
void OnReadTrailingHeadersComplete(int rv);
void OnReadDataComplete(int rv);
- // Notifies the delegate of an error.
+ // Notifies the delegate of an error, clears |stream_| and |delegate_|,
+ // and cancels any pending callbacks.
void NotifyError(int error);
+ // Notifies the delegate of an error, clears |stream_| and |delegate_|,
+ // and cancels any pending callbacks. If |notify_delegate_later| is true
+ // then the delegate will be notified asynchronously via a posted task,
+ // otherwise the notification will be synchronous.
+ void NotifyErrorImpl(int error, bool notify_delegate_later);
// Notifies the delegate that the stream is ready.
void NotifyStreamReady();
// Resets the stream and ensures that |delegate_| won't be called back.
void ResetStream();
+ // Invokes OnFailure(error) on |delegate|.
+ void NotifyFailure(BidirectionalStreamImpl::Delegate* delegate, int error);
const std::unique_ptr<QuicChromiumClientSession::Handle> session_;
std::unique_ptr<QuicChromiumClientStream::Handle> stream_;
« no previous file with comments | « no previous file | net/quic/chromium/bidirectional_stream_quic_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698