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

Side by Side Diff: chrome/test/chromedriver/net/sync_websocket_impl.h

Issue 1669453002: [chromedriver] Apply page load timeout to slow cross-process navigations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pure virtual Created 4 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef CHROME_TEST_CHROMEDRIVER_NET_SYNC_WEBSOCKET_IMPL_H_ 5 #ifndef CHROME_TEST_CHROMEDRIVER_NET_SYNC_WEBSOCKET_IMPL_H_
6 #define CHROME_TEST_CHROMEDRIVER_NET_SYNC_WEBSOCKET_IMPL_H_ 6 #define CHROME_TEST_CHROMEDRIVER_NET_SYNC_WEBSOCKET_IMPL_H_
7 7
8 #include <list> 8 #include <list>
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 19 matching lines...) Expand all
30 class SyncWebSocketImpl : public SyncWebSocket { 30 class SyncWebSocketImpl : public SyncWebSocket {
31 public: 31 public:
32 explicit SyncWebSocketImpl(net::URLRequestContextGetter* context_getter); 32 explicit SyncWebSocketImpl(net::URLRequestContextGetter* context_getter);
33 ~SyncWebSocketImpl() override; 33 ~SyncWebSocketImpl() override;
34 34
35 // Overridden from SyncWebSocket: 35 // Overridden from SyncWebSocket:
36 bool IsConnected() override; 36 bool IsConnected() override;
37 bool Connect(const GURL& url) override; 37 bool Connect(const GURL& url) override;
38 bool Send(const std::string& message) override; 38 bool Send(const std::string& message) override;
39 StatusCode ReceiveNextMessage(std::string* message, 39 StatusCode ReceiveNextMessage(std::string* message,
40 const base::TimeDelta& timeout) override; 40 const Timeout& timeout) override;
41 bool HasNextMessage() override; 41 bool HasNextMessage() override;
42 42
43 private: 43 private:
44 struct CoreTraits; 44 struct CoreTraits;
45 class Core : public WebSocketListener, 45 class Core : public WebSocketListener,
46 public base::RefCountedThreadSafe<Core, CoreTraits> { 46 public base::RefCountedThreadSafe<Core, CoreTraits> {
47 public: 47 public:
48 explicit Core(net::URLRequestContextGetter* context_getter); 48 explicit Core(net::URLRequestContextGetter* context_getter);
49 49
50 bool IsConnected(); 50 bool IsConnected();
51 bool Connect(const GURL& url); 51 bool Connect(const GURL& url);
52 bool Send(const std::string& message); 52 bool Send(const std::string& message);
53 SyncWebSocket::StatusCode ReceiveNextMessage( 53 SyncWebSocket::StatusCode ReceiveNextMessage(
54 std::string* message, 54 std::string* message,
55 const base::TimeDelta& timeout); 55 const Timeout& timeout);
56 bool HasNextMessage(); 56 bool HasNextMessage();
57 57
58 // Overriden from WebSocketListener: 58 // Overriden from WebSocketListener:
59 void OnMessageReceived(const std::string& message) override; 59 void OnMessageReceived(const std::string& message) override;
60 void OnClose() override; 60 void OnClose() override;
61 61
62 private: 62 private:
63 friend class base::RefCountedThreadSafe<Core, CoreTraits>; 63 friend class base::RefCountedThreadSafe<Core, CoreTraits>;
64 friend class base::DeleteHelper<Core>; 64 friend class base::DeleteHelper<Core>;
65 friend struct CoreTraits; 65 friend struct CoreTraits;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 scoped_refptr<Core> core_; 100 scoped_refptr<Core> core_;
101 }; 101 };
102 102
103 struct SyncWebSocketImpl::CoreTraits { 103 struct SyncWebSocketImpl::CoreTraits {
104 static void Destruct(const SyncWebSocketImpl::Core* core) { 104 static void Destruct(const SyncWebSocketImpl::Core* core) {
105 core->OnDestruct(); 105 core->OnDestruct();
106 } 106 }
107 }; 107 };
108 108
109 #endif // CHROME_TEST_CHROMEDRIVER_NET_SYNC_WEBSOCKET_IMPL_H_ 109 #endif // CHROME_TEST_CHROMEDRIVER_NET_SYNC_WEBSOCKET_IMPL_H_
OLDNEW
« no previous file with comments | « chrome/test/chromedriver/net/sync_websocket.h ('k') | chrome/test/chromedriver/net/sync_websocket_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698