| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "net/socket/websocket_endpoint_lock_manager.h" | 5 #include "net/socket/websocket_endpoint_lock_manager.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 void Disconnect() override { return; } | 39 void Disconnect() override { return; } |
| 40 | 40 |
| 41 bool IsConnected() const override { return false; } | 41 bool IsConnected() const override { return false; } |
| 42 | 42 |
| 43 bool IsConnectedAndIdle() const override { return false; } | 43 bool IsConnectedAndIdle() const override { return false; } |
| 44 | 44 |
| 45 int GetPeerAddress(IPEndPoint* address) const override { return ERR_FAILED; } | 45 int GetPeerAddress(IPEndPoint* address) const override { return ERR_FAILED; } |
| 46 | 46 |
| 47 int GetLocalAddress(IPEndPoint* address) const override { return ERR_FAILED; } | 47 int GetLocalAddress(IPEndPoint* address) const override { return ERR_FAILED; } |
| 48 | 48 |
| 49 const BoundNetLog& NetLog() const override { return bound_net_log_; } | 49 const NetLogWithSource& NetLog() const override { return net_log_; } |
| 50 | 50 |
| 51 void SetSubresourceSpeculation() override { return; } | 51 void SetSubresourceSpeculation() override { return; } |
| 52 void SetOmniboxSpeculation() override { return; } | 52 void SetOmniboxSpeculation() override { return; } |
| 53 | 53 |
| 54 bool WasEverUsed() const override { return false; } | 54 bool WasEverUsed() const override { return false; } |
| 55 | 55 |
| 56 bool WasNpnNegotiated() const override { return false; } | 56 bool WasNpnNegotiated() const override { return false; } |
| 57 | 57 |
| 58 NextProto GetNegotiatedProtocol() const override { return kProtoUnknown; } | 58 NextProto GetNegotiatedProtocol() const override { return kProtoUnknown; } |
| 59 | 59 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 83 int buf_len, | 83 int buf_len, |
| 84 const CompletionCallback& callback) override { | 84 const CompletionCallback& callback) override { |
| 85 return ERR_FAILED; | 85 return ERR_FAILED; |
| 86 } | 86 } |
| 87 | 87 |
| 88 int SetReceiveBufferSize(int32_t size) override { return ERR_FAILED; } | 88 int SetReceiveBufferSize(int32_t size) override { return ERR_FAILED; } |
| 89 | 89 |
| 90 int SetSendBufferSize(int32_t size) override { return ERR_FAILED; } | 90 int SetSendBufferSize(int32_t size) override { return ERR_FAILED; } |
| 91 | 91 |
| 92 private: | 92 private: |
| 93 BoundNetLog bound_net_log_; | 93 NetLogWithSource net_log_; |
| 94 | 94 |
| 95 DISALLOW_COPY_AND_ASSIGN(FakeStreamSocket); | 95 DISALLOW_COPY_AND_ASSIGN(FakeStreamSocket); |
| 96 }; | 96 }; |
| 97 | 97 |
| 98 class FakeWaiter : public WebSocketEndpointLockManager::Waiter { | 98 class FakeWaiter : public WebSocketEndpointLockManager::Waiter { |
| 99 public: | 99 public: |
| 100 FakeWaiter() : called_(false) {} | 100 FakeWaiter() : called_(false) {} |
| 101 | 101 |
| 102 void GotEndpointLock() override { | 102 void GotEndpointLock() override { |
| 103 CHECK(!called_); | 103 CHECK(!called_); |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 blocking_waiter.WaitForLock(); | 330 blocking_waiter.WaitForLock(); |
| 331 TimeTicks after_unlock = TimeTicks::Now(); | 331 TimeTicks after_unlock = TimeTicks::Now(); |
| 332 EXPECT_GE(after_unlock - before_unlock, unlock_delay); | 332 EXPECT_GE(after_unlock - before_unlock, unlock_delay); |
| 333 instance()->SetUnlockDelayForTesting(base::TimeDelta()); | 333 instance()->SetUnlockDelayForTesting(base::TimeDelta()); |
| 334 UnlockDummyEndpoint(1); | 334 UnlockDummyEndpoint(1); |
| 335 } | 335 } |
| 336 | 336 |
| 337 } // namespace | 337 } // namespace |
| 338 | 338 |
| 339 } // namespace net | 339 } // namespace net |
| OLD | NEW |