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

Unified Diff: net/websockets/websocket_channel.cc

Issue 266243004: Clang format slam. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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
Index: net/websockets/websocket_channel.cc
diff --git a/net/websockets/websocket_channel.cc b/net/websockets/websocket_channel.cc
index 47114f846455490edbb434cf4890d1a1e28b08a7..b744db7a93e043c220ac460af1b6234840f068b5 100644
--- a/net/websockets/websocket_channel.cc
+++ b/net/websockets/websocket_channel.cc
@@ -86,7 +86,8 @@ bool IsStrictlyValidCloseStatusCode(int code) {
}
// This function avoids a bunch of boilerplate code.
-void AllowUnused(ChannelState ALLOW_UNUSED unused) {}
+void AllowUnused(ChannelState ALLOW_UNUSED unused) {
+}
// Sets |name| to the name of the frame type for the given |opcode|. Note that
// for all of Text, Binary and Continuation opcode, this method returns
@@ -222,9 +223,11 @@ class WebSocketChannel::HandshakeNotificationSender
WebSocketChannel::HandshakeNotificationSender::HandshakeNotificationSender(
WebSocketChannel* channel)
- : owner_(channel) {}
+ : owner_(channel) {
+}
-WebSocketChannel::HandshakeNotificationSender::~HandshakeNotificationSender() {}
+WebSocketChannel::HandshakeNotificationSender::~HandshakeNotificationSender() {
+}
void WebSocketChannel::HandshakeNotificationSender::Send(
base::WeakPtr<HandshakeNotificationSender> sender) {
@@ -237,16 +240,17 @@ void WebSocketChannel::HandshakeNotificationSender::Send(
ChannelState WebSocketChannel::HandshakeNotificationSender::SendImmediately(
WebSocketEventInterface* event_interface) {
-
if (handshake_request_info_.get()) {
- if (CHANNEL_DELETED == event_interface->OnStartOpeningHandshake(
- handshake_request_info_.Pass()))
+ if (CHANNEL_DELETED ==
+ event_interface->OnStartOpeningHandshake(
+ handshake_request_info_.Pass()))
return CHANNEL_DELETED;
}
if (handshake_response_info_.get()) {
- if (CHANNEL_DELETED == event_interface->OnFinishOpeningHandshake(
- handshake_response_info_.Pass()))
+ if (CHANNEL_DELETED ==
+ event_interface->OnFinishOpeningHandshake(
+ handshake_response_info_.Pass()))
return CHANNEL_DELETED;
// TODO(yhirano): We can release |this| to save memory because
@@ -266,9 +270,11 @@ WebSocketChannel::PendingReceivedFrame::PendingReceivedFrame(
opcode_(opcode),
data_(data),
offset_(offset),
- size_(size) {}
+ size_(size) {
+}
-WebSocketChannel::PendingReceivedFrame::~PendingReceivedFrame() {}
+WebSocketChannel::PendingReceivedFrame::~PendingReceivedFrame() {
+}
void WebSocketChannel::PendingReceivedFrame::ResetOpcode() {
DCHECK(WebSocketFrameHeader::IsKnownDataOpCode(opcode_));
@@ -297,7 +303,8 @@ WebSocketChannel::WebSocketChannel(
sending_text_message_(false),
receiving_text_message_(false),
expecting_to_handle_continuation_(false),
- initial_frame_forwarded_(false) {}
+ initial_frame_forwarded_(false) {
+}
WebSocketChannel::~WebSocketChannel() {
// The stream may hold a pointer to read_frames_, and so it needs to be
@@ -326,8 +333,8 @@ void WebSocketChannel::SetState(State new_state) {
if (new_state == CONNECTED)
established_on_ = base::TimeTicks::Now();
if (state_ == CONNECTED && !established_on_.is_null()) {
- UMA_HISTOGRAM_LONG_TIMES(
- "Net.WebSocket.Duration", base::TimeTicks::Now() - established_on_);
+ UMA_HISTOGRAM_LONG_TIMES("Net.WebSocket.Duration",
+ base::TimeTicks::Now() - established_on_);
}
state_ = new_state;
@@ -421,8 +428,8 @@ void WebSocketChannel::SendFlowControl(int64 quota) {
const size_t bytes_to_send =
std::min(base::checked_cast<size_t>(quota), data_size);
const bool final = front.final() && data_size == bytes_to_send;
- const char* data = front.data() ?
- front.data()->data() + front.offset() : NULL;
+ const char* data =
+ front.data() ? front.data()->data() + front.offset() : NULL;
DCHECK(!bytes_to_send || data) << "Non empty data should not be null.";
const std::vector<char> data_vector(data, data + bytes_to_send);
DVLOG(3) << "Sending frame previously split due to quota to the "
@@ -874,8 +881,8 @@ ChannelState WebSocketChannel::HandleDataFrame(
? "Received unexpected continuation frame."
: "Received start of new message but previous message is unfinished.";
const std::string reason = got_continuation
- ? "Unexpected continuation"
- : "Previous data frame unfinished";
+ ? "Unexpected continuation"
+ : "Previous data frame unfinished";
return FailChannel(console_log, kWebSocketErrorProtocolError, reason);
}
expecting_to_handle_continuation_ = !final;
@@ -1035,8 +1042,7 @@ bool WebSocketChannel::ParseClose(const scoped_refptr<IOBuffer>& buffer,
<< "(the first byte is " << std::hex
<< static_cast<int>(buffer->data()[0]) << ")";
*code = kWebSocketErrorProtocolError;
- *message =
- "Received a broken close frame containing an invalid size body.";
+ *message = "Received a broken close frame containing an invalid size body.";
return false;
}

Powered by Google App Engine
This is Rietveld 408576698