Commit e8100379 authored by ricea's avatar ricea Committed by Commit bot

Revert of Temporary: Detect WebSocket destruction order problem (patchset #2...

Revert of Temporary: Detect WebSocket destruction order problem (patchset #2 id:20001 of https://codereview.chromium.org/2315213002/ )

Reason for revert:
We have learnt everything we are going to learn
from this CHECK. Reverting as intended.

This does not need to be relanded.

Original issue's description:
> Temporary: Detect WebSocket destruction order problem
>
> Add a CHECK() to crash the browser if a destruction order problem is
> encountered.
>
> This will be reverted once the information is collected.
>
> BUG=641013
>
> Committed: https://crrev.com/23169a0f5421e6759d89b1feaa83b06b197a7039
> Cr-Commit-Position: refs/heads/master@{#417522}

TBR=yhirano@chromium.org,mmenke@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=641013

Review-Url: https://codereview.chromium.org/2340253002
Cr-Commit-Position: refs/heads/master@{#418791}
parent 0df831ca
...@@ -241,9 +241,6 @@ HttpNetworkSession::HttpNetworkSession(const Params& params) ...@@ -241,9 +241,6 @@ HttpNetworkSession::HttpNetworkSession(const Params& params)
HttpNetworkSession::~HttpNetworkSession() { HttpNetworkSession::~HttpNetworkSession() {
base::STLDeleteElements(&response_drainers_); base::STLDeleteElements(&response_drainers_);
spdy_session_pool_.CloseAllSessions(); spdy_session_pool_.CloseAllSessions();
// TODO(ricea): Remove this by October 2016. See bug 641013.
CHECK_EQ(active_websockets_, 0);
} }
void HttpNetworkSession::AddResponseDrainer(HttpResponseBodyDrainer* drainer) { void HttpNetworkSession::AddResponseDrainer(HttpResponseBodyDrainer* drainer) {
......
...@@ -273,10 +273,6 @@ class NET_EXPORT HttpNetworkSession ...@@ -273,10 +273,6 @@ class NET_EXPORT HttpNetworkSession
SSLConfig* server_config, SSLConfig* server_config,
SSLConfig* proxy_config) const; SSLConfig* proxy_config) const;
// TODO(ricea): Remove this by October 2016.
void IncrementActiveWebSockets() { ++active_websockets_; }
void DecrementActiveWebSockets() { --active_websockets_; }
private: private:
friend class HttpNetworkSessionPeer; friend class HttpNetworkSessionPeer;
...@@ -311,9 +307,6 @@ class NET_EXPORT HttpNetworkSession ...@@ -311,9 +307,6 @@ class NET_EXPORT HttpNetworkSession
Params params_; Params params_;
std::unique_ptr<base::MemoryPressureListener> memory_pressure_listener_; std::unique_ptr<base::MemoryPressureListener> memory_pressure_listener_;
// TODO(ricea): Remove this by October 2016.
int active_websockets_ = 0;
}; };
} // namespace net } // namespace net
......
...@@ -25,13 +25,10 @@ ...@@ -25,13 +25,10 @@
#include "base/threading/thread_task_runner_handle.h" #include "base/threading/thread_task_runner_handle.h"
#include "base/time/time.h" #include "base/time/time.h"
#include "net/base/io_buffer.h" #include "net/base/io_buffer.h"
#include "net/http/http_network_session.h" // TODO(ricea): Remove
#include "net/http/http_request_headers.h" #include "net/http/http_request_headers.h"
#include "net/http/http_response_headers.h" #include "net/http/http_response_headers.h"
#include "net/http/http_transaction_factory.h" // TODO(ricea): Remove
#include "net/http/http_util.h" #include "net/http/http_util.h"
#include "net/log/net_log.h" #include "net/log/net_log.h"
#include "net/url_request/url_request_context.h" // TODO(ricea): Remove
#include "net/websockets/websocket_errors.h" #include "net/websockets/websocket_errors.h"
#include "net/websockets/websocket_event_interface.h" #include "net/websockets/websocket_event_interface.h"
#include "net/websockets/websocket_frame.h" #include "net/websockets/websocket_frame.h"
...@@ -330,14 +327,6 @@ WebSocketChannel::WebSocketChannel( ...@@ -330,14 +327,6 @@ WebSocketChannel::WebSocketChannel(
initial_frame_forwarded_(false) {} initial_frame_forwarded_(false) {}
WebSocketChannel::~WebSocketChannel() { WebSocketChannel::~WebSocketChannel() {
// TODO(ricea): Remove this by October 2016. See bug 641013.
if (stream_) {
HttpTransactionFactory* http_transaction_factory =
url_request_context_->http_transaction_factory();
if (http_transaction_factory)
http_transaction_factory->GetSession()->DecrementActiveWebSockets();
}
// The stream may hold a pointer to read_frames_, and so it needs to be // The stream may hold a pointer to read_frames_, and so it needs to be
// destroyed first. // destroyed first.
stream_.reset(); stream_.reset();
...@@ -609,12 +598,6 @@ void WebSocketChannel::OnConnectSuccess( ...@@ -609,12 +598,6 @@ void WebSocketChannel::OnConnectSuccess(
stream_ = std::move(stream); stream_ = std::move(stream);
// TODO(ricea): Remove this before October 2016.
HttpTransactionFactory* http_transaction_factory =
url_request_context_->http_transaction_factory();
if (http_transaction_factory)
http_transaction_factory->GetSession()->IncrementActiveWebSockets();
SetState(CONNECTED); SetState(CONNECTED);
if (event_interface_->OnAddChannelResponse(stream_->GetSubProtocol(), if (event_interface_->OnAddChannelResponse(stream_->GetSubProtocol(),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment