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

Unified Diff: net/socket/socket_test_util.h

Issue 1119803006: Revert of Add AllReadDataConsumed and AllWriteDataConsumed methods to SocketDataProvider (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/socket/sequenced_socket_data_unittest.cc ('k') | net/socket/socket_test_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/socket_test_util.h
diff --git a/net/socket/socket_test_util.h b/net/socket/socket_test_util.h
index b4584ad956384b7ac97d934fd46afb0a433d1087..3bd88d2772f751a822613c856d5e2c2f98da90e1 100644
--- a/net/socket/socket_test_util.h
+++ b/net/socket/socket_test_util.h
@@ -198,8 +198,6 @@
virtual MockRead OnRead() = 0;
virtual MockWriteResult OnWrite(const std::string& data) = 0;
virtual void Reset() = 0;
- virtual bool AllReadDataConsumed() const = 0;
- virtual bool AllWriteDataConsumed() const = 0;
// Accessor for the socket which is using the SocketDataProvider.
AsyncSocket* socket() { return socket_; }
@@ -260,16 +258,13 @@
// in which case this method will still return true.
bool VerifyWriteData(const std::string& data);
- // Return true if all read data has been consumed.
- bool AllReadDataConsumed() const;
-
- // Return true if all write data has been consumed.
- bool AllWriteDataConsumed() const;
-
size_t read_index() const { return read_index_; }
size_t write_index() const { return write_index_; }
size_t read_count() const { return read_count_; }
size_t write_count() const { return write_count_; }
+
+ bool at_read_eof() const { return read_index_ >= read_count_; }
+ bool at_write_eof() const { return write_index_ >= write_count_; }
private:
MockRead* reads_;
@@ -299,13 +294,14 @@
MockRead OnRead() override;
MockWriteResult OnWrite(const std::string& data) override;
void Reset() override;
- bool AllReadDataConsumed() const override;
- bool AllWriteDataConsumed() const override;
size_t read_index() const { return helper_.read_index(); }
size_t write_index() const { return helper_.write_index(); }
size_t read_count() const { return helper_.read_count(); }
size_t write_count() const { return helper_.write_count(); }
+
+ bool at_read_eof() const { return helper_.at_read_eof(); }
+ bool at_write_eof() const { return helper_.at_write_eof(); }
protected:
StaticSocketDataHelper* helper() { return &helper_; }
@@ -503,8 +499,12 @@
MockRead OnRead() override;
MockWriteResult OnWrite(const std::string& data) override;
void Reset() override;
- bool AllReadDataConsumed() const override;
- bool AllWriteDataConsumed() const override;
+
+ // Returns true if all data has been read.
+ bool at_read_eof() const;
+
+ // Returns true if all data has been written.
+ bool at_write_eof() const;
private:
// Defines the state for the read or write path.
« no previous file with comments | « net/socket/sequenced_socket_data_unittest.cc ('k') | net/socket/socket_test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698