diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-16 01:05:46 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-16 01:05:46 +0000 |
commit | b30a3f5c4fc1e62eaffa8db57bc5681665df3643 (patch) | |
tree | b5703b6ef2d6e879473861f0d85252f813144749 /net/websockets | |
parent | fe62fc852bd3c1c162ee1f41992096f59387dc31 (diff) | |
download | chromium_src-b30a3f5c4fc1e62eaffa8db57bc5681665df3643.zip chromium_src-b30a3f5c4fc1e62eaffa8db57bc5681665df3643.tar.gz chromium_src-b30a3f5c4fc1e62eaffa8db57bc5681665df3643.tar.bz2 |
Convert LOG(INFO) to VLOG(1) - net/.
Also converts COOKIE_DLOG (since VLOG can be toggled on a granular basis), removes some unneeded "endl"s and {}s, aligns "<<"s per style guide, and changes KeygenHandler::GenKeyAndSignChallenge() to avoid using "goto".
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/3846001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62831 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/websockets')
-rw-r--r-- | net/websockets/websocket_handshake.cc | 5 | ||||
-rw-r--r-- | net/websockets/websocket_handshake_draft75.cc | 10 | ||||
-rw-r--r-- | net/websockets/websocket_throttle.cc | 4 | ||||
-rw-r--r-- | net/websockets/websocket_throttle_unittest.cc | 36 |
4 files changed, 26 insertions, 29 deletions
diff --git a/net/websockets/websocket_handshake.cc b/net/websockets/websocket_handshake.cc index 480e395..f86f6ac 100644 --- a/net/websockets/websocket_handshake.cc +++ b/net/websockets/websocket_handshake.cc @@ -93,13 +93,12 @@ int WebSocketHandshake::ReadServerHandshake(const char* data, size_t len) { if (headers->response_code() != 101) { mode_ = MODE_FAILED; - DLOG(INFO) << "Bad response code: " << headers->response_code(); + DVLOG(1) << "Bad response code: " << headers->response_code(); return eoh; } mode_ = MODE_NORMAL; if (!ProcessHeaders(*headers) || !CheckResponseHeaders()) { - DLOG(INFO) << "Process Headers failed: " - << std::string(data, eoh); + DVLOG(1) << "Process Headers failed: " << std::string(data, eoh); mode_ = MODE_FAILED; return eoh; } diff --git a/net/websockets/websocket_handshake_draft75.cc b/net/websockets/websocket_handshake_draft75.cc index 78805fb..a504267 100644 --- a/net/websockets/websocket_handshake_draft75.cc +++ b/net/websockets/websocket_handshake_draft75.cc @@ -83,8 +83,7 @@ int WebSocketHandshakeDraft75::ReadServerHandshake( return -1; if (memcmp(p, kUpgradeHeader, kUpgradeHeaderLength)) { mode_ = MODE_FAILED; - DLOG(INFO) << "Bad Upgrade Header " - << std::string(p, kUpgradeHeaderLength); + DVLOG(1) << "Bad Upgrade Header " << std::string(p, kUpgradeHeaderLength); return p - data; } p += kUpgradeHeaderLength; @@ -93,8 +92,8 @@ int WebSocketHandshakeDraft75::ReadServerHandshake( return -1; if (memcmp(p, kConnectionHeader, kConnectionHeaderLength)) { mode_ = MODE_FAILED; - DLOG(INFO) << "Bad Connection Header " - << std::string(p, kConnectionHeaderLength); + DVLOG(1) << "Bad Connection Header " + << std::string(p, kConnectionHeaderLength); return p - data; } p += kConnectionHeaderLength; @@ -107,8 +106,7 @@ int WebSocketHandshakeDraft75::ReadServerHandshake( scoped_refptr<HttpResponseHeaders> headers( new HttpResponseHeaders(HttpUtil::AssembleRawHeaders(data, eoh))); if (!ProcessHeaders(*headers)) { - DLOG(INFO) << "Process Headers failed: " - << std::string(data, eoh); + DVLOG(1) << "Process Headers failed: " << std::string(data, eoh); mode_ = MODE_FAILED; } switch (mode_) { diff --git a/net/websockets/websocket_throttle.cc b/net/websockets/websocket_throttle.cc index 614990e..2d62815 100644 --- a/net/websockets/websocket_throttle.cc +++ b/net/websockets/websocket_throttle.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -76,7 +76,7 @@ void WebSocketThrottle::PutInQueue(WebSocketJob* job) { } else { iter->second->push_back(job); job->SetWaiting(); - DLOG(INFO) << "Waiting on " << addrkey; + DVLOG(1) << "Waiting on " << addrkey; } } } diff --git a/net/websockets/websocket_throttle_unittest.cc b/net/websockets/websocket_throttle_unittest.cc index 6d8c619..c4bf59f 100644 --- a/net/websockets/websocket_throttle_unittest.cc +++ b/net/websockets/websocket_throttle_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -90,7 +90,7 @@ TEST_F(WebSocketThrottleTest, Throttle) { WebSocketThrottleTest::MockSocketStreamConnect(s1, addr); DeleteAddrInfo(addr); - DLOG(INFO) << "socket1"; + DVLOG(1) << "socket1"; TestCompletionCallback callback_s1; // Trying to open connection to host1 will start without wait. EXPECT_EQ(OK, w1->OnStartOpenConnection(s1, &callback_s1)); @@ -110,7 +110,7 @@ TEST_F(WebSocketThrottleTest, Throttle) { WebSocketThrottleTest::MockSocketStreamConnect(s2, addr); DeleteAddrInfo(addr); - DLOG(INFO) << "socket2"; + DVLOG(1) << "socket2"; TestCompletionCallback callback_s2; // Trying to open connection to host2 will wait for w1. EXPECT_EQ(ERR_IO_PENDING, w2->OnStartOpenConnection(s2, &callback_s2)); @@ -129,7 +129,7 @@ TEST_F(WebSocketThrottleTest, Throttle) { WebSocketThrottleTest::MockSocketStreamConnect(s3, addr); DeleteAddrInfo(addr); - DLOG(INFO) << "socket3"; + DVLOG(1) << "socket3"; TestCompletionCallback callback_s3; // Trying to open connection to host3 will wait for w1. EXPECT_EQ(ERR_IO_PENDING, w3->OnStartOpenConnection(s3, &callback_s3)); @@ -148,7 +148,7 @@ TEST_F(WebSocketThrottleTest, Throttle) { WebSocketThrottleTest::MockSocketStreamConnect(s4, addr); DeleteAddrInfo(addr); - DLOG(INFO) << "socket4"; + DVLOG(1) << "socket4"; TestCompletionCallback callback_s4; // Trying to open connection to host4 will wait for w1, w2. EXPECT_EQ(ERR_IO_PENDING, w4->OnStartOpenConnection(s4, &callback_s4)); @@ -166,7 +166,7 @@ TEST_F(WebSocketThrottleTest, Throttle) { WebSocketThrottleTest::MockSocketStreamConnect(s5, addr); DeleteAddrInfo(addr); - DLOG(INFO) << "socket5"; + DVLOG(1) << "socket5"; TestCompletionCallback callback_s5; // Trying to open connection to host5 will wait for w1, w4 EXPECT_EQ(ERR_IO_PENDING, w5->OnStartOpenConnection(s5, &callback_s5)); @@ -184,7 +184,7 @@ TEST_F(WebSocketThrottleTest, Throttle) { WebSocketThrottleTest::MockSocketStreamConnect(s6, addr); DeleteAddrInfo(addr); - DLOG(INFO) << "socket6"; + DVLOG(1) << "socket6"; TestCompletionCallback callback_s6; // Trying to open connection to host6 will wait for w1, w4, w5 EXPECT_EQ(ERR_IO_PENDING, w6->OnStartOpenConnection(s6, &callback_s6)); @@ -194,7 +194,7 @@ TEST_F(WebSocketThrottleTest, Throttle) { // 1.2.3.6 | w1 w4 w5 w6 // Receive partial response on w1, still connecting. - DLOG(INFO) << "socket1 1"; + DVLOG(1) << "socket1 1"; static const char kHeader[] = "HTTP/1.1 101 WebSocket Protocol\r\n"; w1->OnReceivedData(s1.get(), kHeader, sizeof(kHeader) - 1); EXPECT_FALSE(callback_s2.have_result()); @@ -204,7 +204,7 @@ TEST_F(WebSocketThrottleTest, Throttle) { EXPECT_FALSE(callback_s6.have_result()); // Receive rest of handshake response on w1. - DLOG(INFO) << "socket1 2"; + DVLOG(1) << "socket1 2"; static const char kHeader2[] = "Upgrade: WebSocket\r\n" "Connection: Upgrade\r\n" @@ -226,7 +226,7 @@ TEST_F(WebSocketThrottleTest, Throttle) { // 1.2.3.6 | w4 w5 w6 // Closing s1 doesn't change waiting queue. - DLOG(INFO) << "socket1 close"; + DVLOG(1) << "socket1 close"; w1->OnClose(s1.get()); MessageLoopForIO::current()->RunAllPending(); EXPECT_FALSE(callback_s4.have_result()); @@ -237,7 +237,7 @@ TEST_F(WebSocketThrottleTest, Throttle) { // 1.2.3.6 | w4 w5 w6 // w5 can close while waiting in queue. - DLOG(INFO) << "socket5 close"; + DVLOG(1) << "socket5 close"; // w5 close() closes SocketStream that change state to STATE_CLOSE, calls // DoLoop(), so OnClose() callback will be called. w5->OnClose(s5.get()); @@ -250,7 +250,7 @@ TEST_F(WebSocketThrottleTest, Throttle) { s5->DetachDelegate(); // w6 close abnormally (e.g. renderer finishes) while waiting in queue. - DLOG(INFO) << "socket6 close abnormally"; + DVLOG(1) << "socket6 close abnormally"; w6->DetachDelegate(); MessageLoopForIO::current()->RunAllPending(); EXPECT_FALSE(callback_s4.have_result()); @@ -260,7 +260,7 @@ TEST_F(WebSocketThrottleTest, Throttle) { // 1.2.3.6 | w4 // Closing s2 kicks w4 to start connecting. - DLOG(INFO) << "socket2 close"; + DVLOG(1) << "socket2 close"; w2->OnClose(s2.get()); MessageLoopForIO::current()->RunAllPending(); EXPECT_TRUE(callback_s4.have_result()); @@ -270,13 +270,13 @@ TEST_F(WebSocketThrottleTest, Throttle) { // 1.2.3.6 | w4 s2->DetachDelegate(); - DLOG(INFO) << "socket3 close"; + DVLOG(1) << "socket3 close"; w3->OnClose(s3.get()); MessageLoopForIO::current()->RunAllPending(); s3->DetachDelegate(); w4->OnClose(s4.get()); s4->DetachDelegate(); - DLOG(INFO) << "Done"; + DVLOG(1) << "Done"; MessageLoopForIO::current()->RunAllPending(); } @@ -293,15 +293,15 @@ TEST_F(WebSocketThrottleTest, NoThrottleForDuplicateAddress) { WebSocketThrottleTest::MockSocketStreamConnect(s1, addr); DeleteAddrInfo(addr); - DLOG(INFO) << "socket1"; + DVLOG(1) << "socket1"; TestCompletionCallback callback_s1; // Trying to open connection to localhost will start without wait. EXPECT_EQ(OK, w1->OnStartOpenConnection(s1, &callback_s1)); - DLOG(INFO) << "socket1 close"; + DVLOG(1) << "socket1 close"; w1->OnClose(s1.get()); s1->DetachDelegate(); - DLOG(INFO) << "Done"; + DVLOG(1) << "Done"; MessageLoopForIO::current()->RunAllPending(); } |