diff options
author | kmarshall <kmarshall@chromium.org> | 2015-12-02 11:23:15 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-12-02 19:24:14 +0000 |
commit | d9e1c5c6a8780007ea3dc03e594889a5597d32d5 (patch) | |
tree | 9ca88561d2379eae501442921cc7b0c34d84fcab /blimp/net/browser_connection_handler.cc | |
parent | 8cafdc1d0e5f922d1c1cb7f24b827de82c2fffe9 (diff) | |
download | chromium_src-d9e1c5c6a8780007ea3dc03e594889a5597d32d5.zip chromium_src-d9e1c5c6a8780007ea3dc03e594889a5597d32d5.tar.gz chromium_src-d9e1c5c6a8780007ea3dc03e594889a5597d32d5.tar.bz2 |
Implementation for the Blimp Message Buffer.
This class provides a FIFO buffer for reliable, ordered message
delivery, and schedules completion callbacks in response
to message delivery acknowledgements.
BUG=557360
R=wez@chromium.org,haibinlu@chromium.org
Review URL: https://codereview.chromium.org/1458633002
Cr-Commit-Position: refs/heads/master@{#362769}
Diffstat (limited to 'blimp/net/browser_connection_handler.cc')
-rw-r--r-- | blimp/net/browser_connection_handler.cc | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/blimp/net/browser_connection_handler.cc b/blimp/net/browser_connection_handler.cc index d47623e8..897ae62 100644 --- a/blimp/net/browser_connection_handler.cc +++ b/blimp/net/browser_connection_handler.cc @@ -13,10 +13,17 @@ #include "blimp/net/blimp_message_processor.h" namespace blimp { +namespace { + +// Maximum footprint of the output buffer. +// TODO(kmarshall): Use a value that's computed from the platform. +const int kMaxBufferSizeBytes = 1 << 24; + +} // namespace BrowserConnectionHandler::BrowserConnectionHandler() : demultiplexer_(new BlimpMessageDemultiplexer), - output_buffer_(new BlimpMessageOutputBuffer), + output_buffer_(new BlimpMessageOutputBuffer(kMaxBufferSizeBytes)), multiplexer_(new BlimpMessageMultiplexer(output_buffer_.get())) {} BrowserConnectionHandler::~BrowserConnectionHandler() {} @@ -37,7 +44,7 @@ void BrowserConnectionHandler::HandleConnection( // Connect the incoming & outgoing message streams. connection_->SetIncomingMessageProcessor(demultiplexer_.get()); - output_buffer_->set_output_processor( + output_buffer_->SetOutputProcessor( connection_->GetOutgoingMessageProcessor()); } @@ -45,7 +52,7 @@ void BrowserConnectionHandler::DropCurrentConnection() { if (!connection_) return; connection_->SetIncomingMessageProcessor(nullptr); - output_buffer_->set_output_processor(nullptr); + output_buffer_->SetOutputProcessor(nullptr); connection_.reset(); } |