Remove unused code and comments for socket annotations.
Not required codes and comments related to sockets annotations are
removed from several classes. The changes include:
- Default network traffic annotation values are removed and test tags
are added instead if required.
- Code to store annotations in sockets is removed.
- Comments regarding annotations storage is removed.
Bug: 656607
Change-Id: I716dd482a6e868ba3b634437c434950db6073332
Reviewed-on: https://chromium-review.googlesource.com/823965
Commit-Queue: Ramin Halavati <[email protected]>
Reviewed-by: Jochen Eisinger <[email protected]>
Cr-Commit-Position: refs/heads/master@{#523778}
diff --git a/net/socket/ssl_server_socket_unittest.cc b/net/socket/ssl_server_socket_unittest.cc
index 54bc3a5..987768ca 100644
--- a/net/socket/ssl_server_socket_unittest.cc
+++ b/net/socket/ssl_server_socket_unittest.cc
@@ -66,7 +66,7 @@
#include "net/test/cert_test_util.h"
#include "net/test/gtest_util.h"
#include "net/test/test_data_directory.h"
-#include "net/traffic_annotation/network_traffic_annotation.h"
+#include "net/traffic_annotation/network_traffic_annotation_test_helper.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/platform_test.h"
@@ -120,12 +120,10 @@
return PropagateData(buf, buf_len);
}
- // TODO(crbug.com/656607): Remove default value.
int Write(IOBuffer* buf,
int buf_len,
const CompletionCallback& callback,
- const NetworkTrafficAnnotationTag& traffic_annotation =
- NO_TRAFFIC_ANNOTATION_BUG_656607) {
+ const NetworkTrafficAnnotationTag& traffic_annotation) {
DCHECK(write_callback_.is_null());
if (closed_) {
if (write_called_after_close_)
@@ -238,15 +236,14 @@
return incoming_->Read(buf, buf_len, callback);
}
- // TODO(crbug.com/656607): Remove default value.
int Write(IOBuffer* buf,
int buf_len,
const CompletionCallback& callback,
- const NetworkTrafficAnnotationTag& traffic_annotation =
- NO_TRAFFIC_ANNOTATION_BUG_656607) override {
+ const NetworkTrafficAnnotationTag& traffic_annotation) override {
// Write random number of bytes.
buf_len = rand() % buf_len + 1;
- return outgoing_->Write(buf, buf_len, callback);
+ return outgoing_->Write(buf, buf_len, callback,
+ TRAFFIC_ANNOTATION_FOR_TESTS);
}
int SetReceiveBufferSize(int32_t size) override { return OK; }
@@ -328,7 +325,8 @@
// Write then read.
int written =
- server.Write(write_buf.get(), kTestDataSize, CompletionCallback());
+ server.Write(write_buf.get(), kTestDataSize, CompletionCallback(),
+ TRAFFIC_ANNOTATION_FOR_TESTS);
EXPECT_GT(written, 0);
EXPECT_LE(written, kTestDataSize);
@@ -342,7 +340,8 @@
EXPECT_EQ(ERR_IO_PENDING,
server.Read(read_buf.get(), kReadBufSize, callback.callback()));
- written = client.Write(write_buf.get(), kTestDataSize, CompletionCallback());
+ written = client.Write(write_buf.get(), kTestDataSize, CompletionCallback(),
+ TRAFFIC_ANNOTATION_FOR_TESTS);
EXPECT_GT(written, 0);
EXPECT_LE(written, kTestDataSize);