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

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

Issue 12321057: [chromedriver] Implement reconnection to DevTools. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix nits. Created 7 years, 9 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 | Annotate | Revision Log
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_H_ 5 #ifndef CHROME_TEST_CHROMEDRIVER_NET_SYNC_WEBSOCKET_H_
6 #define CHROME_TEST_CHROMEDRIVER_NET_SYNC_WEBSOCKET_H_ 6 #define CHROME_TEST_CHROMEDRIVER_NET_SYNC_WEBSOCKET_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 class GURL; 10 class GURL;
11 11
12 // Proxy for using a WebSocket running on a background thread synchronously. 12 // Proxy for using a WebSocket running on a background thread synchronously.
13 class SyncWebSocket { 13 class SyncWebSocket {
14 public: 14 public:
15 virtual ~SyncWebSocket() {} 15 virtual ~SyncWebSocket() {}
16 16
17 // Return true if connected, otherwise return false.
18 virtual bool IsConnected() = 0;
19
17 // Connects to the WebSocket server. Returns true on success. 20 // Connects to the WebSocket server. Returns true on success.
18 virtual bool Connect(const GURL& url) = 0; 21 virtual bool Connect(const GURL& url) = 0;
19 22
20 // Sends message. Returns true on success. 23 // Sends message. Returns true on success.
21 virtual bool Send(const std::string& message) = 0; 24 virtual bool Send(const std::string& message) = 0;
22 25
23 // Receives next message. Blocks until at least one message is received or 26 // Receives next message. Blocks until at least one message is received or
24 // the socket is closed. Returns true on success and modifies |message|. 27 // the socket is closed. Returns true on success and modifies |message|.
25 virtual bool ReceiveNextMessage(std::string* message) = 0; 28 virtual bool ReceiveNextMessage(std::string* message) = 0;
26 29
27 // Returns whether there are any messages that have been received and not yet 30 // Returns whether there are any messages that have been received and not yet
28 // handled by ReceiveNextMessage. 31 // handled by ReceiveNextMessage.
29 virtual bool HasNextMessage() = 0; 32 virtual bool HasNextMessage() = 0;
30 }; 33 };
31 34
32 #endif // CHROME_TEST_CHROMEDRIVER_NET_SYNC_WEBSOCKET_H_ 35 #endif // CHROME_TEST_CHROMEDRIVER_NET_SYNC_WEBSOCKET_H_
OLDNEW
« no previous file with comments | « chrome/test/chromedriver/devtools_client_impl_unittest.cc ('k') | chrome/test/chromedriver/net/sync_websocket_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698