summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authornick@chromium.org <nick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-26 01:27:23 +0000
committernick@chromium.org <nick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-26 01:27:23 +0000
commit8e8503072f1bf91c59b15b54274ec907505b0376 (patch)
tree785724f75d438826a64b71c3994a06dedd992ffe /chrome
parent08a3ef61e987b2347bdd1bacc6252aa2a323b5ad (diff)
downloadchromium_src-8e8503072f1bf91c59b15b54274ec907505b0376.zip
chromium_src-8e8503072f1bf91c59b15b54274ec907505b0376.tar.gz
chromium_src-8e8503072f1bf91c59b15b54274ec907505b0376.tar.bz2
Use base/logging from chrome/browser/sync. Add a macro to libjingle's
logging.h to suppress the definition of LOG() and friends unless explicitly requested. Fix gyp paths to overrides files. Review URL: http://codereview.chromium.org/225001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27316 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/sync/notifier/base/async_dns_lookup.cc10
-rw-r--r--chrome/browser/sync/notifier/communicator/single_login_attempt.cc5
-rw-r--r--chrome/browser/sync/notifier/communicator/xmpp_connection_generator.cc34
-rw-r--r--chrome/browser/sync/notifier/communicator/xmpp_socket_adapter.cc19
-rw-r--r--chrome/browser/sync/notifier/gaia_auth/gaiaauth.cc2
-rw-r--r--chrome/browser/sync/notifier/gaia_auth/gaiahelper.cc7
-rw-r--r--chrome/browser/sync/notifier/gaia_auth/win/win32window.cc9
7 files changed, 45 insertions, 41 deletions
diff --git a/chrome/browser/sync/notifier/base/async_dns_lookup.cc b/chrome/browser/sync/notifier/base/async_dns_lookup.cc
index ca39525..a9fcd0c 100644
--- a/chrome/browser/sync/notifier/base/async_dns_lookup.cc
+++ b/chrome/browser/sync/notifier/base/async_dns_lookup.cc
@@ -15,11 +15,11 @@
#include <vector>
+#include "base/logging.h"
#include "chrome/browser/sync/notifier/base/nethelpers.h"
#include "chrome/browser/sync/notifier/gaia_auth/inet_aton.h"
#include "talk/base/byteorder.h"
#include "talk/base/common.h"
-#include "talk/base/logging.h"
#include "talk/base/socketaddress.h"
#include "talk/base/thread.h"
@@ -49,7 +49,7 @@ void AsyncDNSLookup::DoWork() {
talk_base::CritScope scope(&cs_);
ip_list_.push_back(talk_base::NetworkToHost32(addr.s_addr));
} else {
- LOG_F(LS_VERBOSE) << "(" << hostname << ")";
+ LOG(INFO) << "(" << hostname << ")";
hostent ent;
char buffer[8192];
int errcode = 0;
@@ -68,8 +68,8 @@ void AsyncDNSLookup::DoWork() {
break;
}
uint32 ip = talk_base::NetworkToHost32(*addr);
- LOG_F(LS_VERBOSE) << "(" << hostname << ") resolved to: "
- << talk_base::SocketAddress::IPToString(ip);
+ LOG(INFO) << "(" << hostname << ") resolved to: "
+ << talk_base::SocketAddress::IPToString(ip);
ip_list_.push_back(ip);
}
// Maintain the invariant that either the list is not empty or the
@@ -88,7 +88,7 @@ void AsyncDNSLookup::DoWork() {
error_ = errcode;
}
}
- LOG_F(LS_ERROR) << "(" << hostname << ") error: " << error_;
+ LOG(ERROR) << "(" << hostname << ") error: " << error_;
}
}
}
diff --git a/chrome/browser/sync/notifier/communicator/single_login_attempt.cc b/chrome/browser/sync/notifier/communicator/single_login_attempt.cc
index 04bd31a..7639455 100644
--- a/chrome/browser/sync/notifier/communicator/single_login_attempt.cc
+++ b/chrome/browser/sync/notifier/communicator/single_login_attempt.cc
@@ -6,6 +6,7 @@
#include "chrome/browser/sync/notifier/communicator/single_login_attempt.h"
+#include "base/logging.h"
#include "chrome/browser/sync/notifier/communicator/connection_options.h"
#include "chrome/browser/sync/notifier/communicator/connection_settings.h"
#include "chrome/browser/sync/notifier/communicator/const_communicator.h"
@@ -463,7 +464,7 @@ void SingleLoginAttempt::OnClientStateChangeClosed(
void SingleLoginAttempt::HandleConnectionPasswordError(
const buzz::CaptchaChallenge& captcha_challenge) {
- LOG(LS_VERBOSE) << "SingleLoginAttempt::HandleConnectionPasswordError";
+ LOG(INFO) << "SingleLoginAttempt::HandleConnectionPasswordError";
// Clear the auth cookie.
std::string current_auth_cookie =
@@ -486,7 +487,7 @@ void SingleLoginAttempt::HandleConnectionError(
int subcode,
const buzz::XmlElement* stream_error,
const buzz::CaptchaChallenge& captcha_challenge) {
- LOG_F(LS_VERBOSE) << "(" << code << ", " << subcode << ")";
+ LOG(INFO) << "(" << code << ", " << subcode << ")";
// Save off the error code information, so we can use it to tell the user
// what went wrong if all else fails.
diff --git a/chrome/browser/sync/notifier/communicator/xmpp_connection_generator.cc b/chrome/browser/sync/notifier/communicator/xmpp_connection_generator.cc
index 871f1f7..6221f2e 100644
--- a/chrome/browser/sync/notifier/communicator/xmpp_connection_generator.cc
+++ b/chrome/browser/sync/notifier/communicator/xmpp_connection_generator.cc
@@ -14,6 +14,7 @@
#include <vector>
+#include "base/logging.h"
#include "chrome/browser/sync/notifier/base/async_dns_lookup.h"
#include "chrome/browser/sync/notifier/base/signal_thread_task.h"
#include "chrome/browser/sync/notifier/communicator/connection_options.h"
@@ -21,7 +22,6 @@
#include "chrome/browser/sync/notifier/communicator/product_info.h"
#include "talk/base/autodetectproxy.h"
#include "talk/base/httpcommon.h"
-#include "talk/base/logging.h"
#include "talk/base/task.h"
#include "talk/base/thread.h"
#include "talk/xmpp/prexmppauth.h"
@@ -55,7 +55,7 @@ XmppConnectionGenerator::XmppConnectionGenerator(
}
XmppConnectionGenerator::~XmppConnectionGenerator() {
- LOG(LS_VERBOSE) << "XmppConnectionGenerator::~XmppConnectionGenerator";
+ LOG(INFO) << "XmppConnectionGenerator::~XmppConnectionGenerator";
}
const talk_base::ProxyInfo& XmppConnectionGenerator::proxy() const {
@@ -70,7 +70,7 @@ const talk_base::ProxyInfo& XmppConnectionGenerator::proxy() const {
// Starts resolving proxy information.
void XmppConnectionGenerator::StartGenerating() {
- LOG(LS_VERBOSE) << "XmppConnectionGenerator::StartGenerating";
+ LOG(INFO) << "XmppConnectionGenerator::StartGenerating";
talk_base::AutoDetectProxy* proxy_detect =
new talk_base::AutoDetectProxy(GetUserAgentString());
@@ -102,7 +102,7 @@ void XmppConnectionGenerator::StartGenerating() {
void XmppConnectionGenerator::OnProxyDetect(
talk_base::AutoDetectProxy* proxy_detect) {
- LOG(LS_VERBOSE) << "XmppConnectionGenerator::OnProxyDetect";
+ LOG(INFO) << "XmppConnectionGenerator::OnProxyDetect";
ASSERT(settings_list_.get());
ASSERT(proxy_detect);
@@ -144,10 +144,10 @@ void XmppConnectionGenerator::UseNextConnection() {
void XmppConnectionGenerator::OnServerDNSResolved(
AsyncDNSLookup* dns_lookup) {
- LOG(LS_VERBOSE) << "XmppConnectionGenerator::OnServerDNSResolved";
+ LOG(INFO) << "XmppConnectionGenerator::OnServerDNSResolved";
// Print logging info.
- LOG(LS_VERBOSE) << " server: " <<
+ LOG(INFO) << " server: " <<
server_list_[server_index_].server.ToString() <<
" error: " << dns_lookup->error();
if (first_dns_error_ == 0 && dns_lookup->error() != 0) {
@@ -159,7 +159,7 @@ void XmppConnectionGenerator::OnServerDNSResolved(
}
for (int i = 0; i < static_cast<int>(dns_lookup->ip_list().size()); ++i) {
- LOG(LS_VERBOSE)
+ LOG(INFO)
<< " ip " << i << " : "
<< talk_base::SocketAddress::IPToString(dns_lookup->ip_list()[i]);
}
@@ -187,23 +187,23 @@ static const char* ProtocolToString(cricket::ProtocolType proto) {
}
void XmppConnectionGenerator::UseCurrentConnection() {
- LOG(LS_VERBOSE) << "XmppConnectionGenerator::UseCurrentConnection";
+ LOG(INFO) << "XmppConnectionGenerator::UseCurrentConnection";
ConnectionSettings* settings = settings_list_->GetSettings(settings_index_);
- LOG(LS_INFO) << "*** Attempting "
- << ProtocolToString(settings->protocol()) << " connection to "
- << settings->server().IPAsString() << ":"
- << settings->server().port()
- << " (via " << ProxyToString(settings->proxy().type)
- << " proxy @ " << settings->proxy().address.IPAsString() << ":"
- << settings->proxy().address.port() << ")";
+ LOG(INFO) << "*** Attempting "
+ << ProtocolToString(settings->protocol()) << " connection to "
+ << settings->server().IPAsString() << ":"
+ << settings->server().port()
+ << " (via " << ProxyToString(settings->proxy().type)
+ << " proxy @ " << settings->proxy().address.IPAsString() << ":"
+ << settings->proxy().address.port() << ")";
SignalNewSettings(*settings);
}
void XmppConnectionGenerator::HandleExhaustedConnections() {
- LOG_F(LS_VERBOSE) << "(" << buzz::XmppEngine::ERROR_SOCKET
- << ", " << first_dns_error_ << ")";
+ LOG(INFO) << "(" << buzz::XmppEngine::ERROR_SOCKET
+ << ", " << first_dns_error_ << ")";
SignalExhaustedSettings(successfully_resolved_dns_, first_dns_error_);
}
diff --git a/chrome/browser/sync/notifier/communicator/xmpp_socket_adapter.cc b/chrome/browser/sync/notifier/communicator/xmpp_socket_adapter.cc
index fbdf600..03c1977 100644
--- a/chrome/browser/sync/notifier/communicator/xmpp_socket_adapter.cc
+++ b/chrome/browser/sync/notifier/communicator/xmpp_socket_adapter.cc
@@ -7,6 +7,7 @@
#include <iomanip>
#include <string>
+#include "base/logging.h"
#include "chrome/browser/sync/notifier/communicator/product_info.h"
#include "talk/base/byteorder.h"
#include "talk/base/common.h"
@@ -74,7 +75,7 @@ bool XmppSocketAdapter::Connect(const talk_base::SocketAddress& addr) {
return false;
}
- LOG(LS_INFO) << "XmppSocketAdapter::Connect(" << addr.ToString() << ")";
+ LOG(INFO) << "XmppSocketAdapter::Connect(" << addr.ToString() << ")";
// Clean up any previous socket - cannot delete socket on close because close
// happens during the child socket's stack callback.
@@ -248,8 +249,8 @@ bool XmppSocketAdapter::Close() {
if (state_ != STATE_CLOSED) {
// The socket was closed manually, not directly due to error.
if (error_ != ERROR_NONE) {
- LOG(LS_INFO) << "XmppSocketAdapter::Close - previous Error: " << error_
- << " WSAError: " << wsa_error_;
+ LOG(INFO) << "XmppSocketAdapter::Close - previous Error: " << error_
+ << " WSAError: " << wsa_error_;
error_ = ERROR_NONE;
wsa_error_ = 0;
}
@@ -262,8 +263,8 @@ void XmppSocketAdapter::NotifyClose() {
if (state_ == STATE_CLOSED) {
SetError(ERROR_WRONGSTATE);
} else {
- LOG(LS_INFO) << "XmppSocketAdapter::NotifyClose - Error: " << error_
- << " WSAError: " << wsa_error_;
+ LOG(INFO) << "XmppSocketAdapter::NotifyClose - Error: " << error_
+ << " WSAError: " << wsa_error_;
state_ = STATE_CLOSED;
SignalClosed();
FreeState();
@@ -273,19 +274,19 @@ void XmppSocketAdapter::NotifyClose() {
void XmppSocketAdapter::OnConnectEvent(talk_base::AsyncSocket *socket) {
if (state_ == STATE_CONNECTING) {
state_ = STATE_OPEN;
- LOG(LS_INFO) << "XmppSocketAdapter::OnConnectEvent - STATE_OPEN";
+ LOG(INFO) << "XmppSocketAdapter::OnConnectEvent - STATE_OPEN";
SignalConnected();
#if defined(FEATURE_ENABLE_SSL)
} else if (state_ == STATE_TLS_CONNECTING) {
state_ = STATE_TLS_OPEN;
- LOG(LS_INFO) << "XmppSocketAdapter::OnConnectEvent - STATE_TLS_OPEN";
+ LOG(INFO) << "XmppSocketAdapter::OnConnectEvent - STATE_TLS_OPEN";
SignalSSLConnected();
if (write_buffer_length_ > 0) {
HandleWritable();
}
#endif // defined(FEATURE_ENABLE_SSL)
} else {
- LOG(LS_INFO) << "XmppSocketAdapter::OnConnectEvent - state is " << state_;
+ LOG(INFO) << "XmppSocketAdapter::OnConnectEvent - state is " << state_;
ASSERT(false);
}
}
@@ -300,7 +301,7 @@ void XmppSocketAdapter::OnWriteEvent(talk_base::AsyncSocket *socket) {
void XmppSocketAdapter::OnCloseEvent(talk_base::AsyncSocket *socket,
int error) {
- LOG(LS_INFO) << "XmppSocketAdapter::OnCloseEvent(" << error << ")";
+ LOG(INFO) << "XmppSocketAdapter::OnCloseEvent(" << error << ")";
SetWSAError(error);
if (error == SOCKET_EACCES) {
SignalAuthenticationError(); // Proxy needs authentication.
diff --git a/chrome/browser/sync/notifier/gaia_auth/gaiaauth.cc b/chrome/browser/sync/notifier/gaia_auth/gaiaauth.cc
index cf30d07..8ff7c6f 100644
--- a/chrome/browser/sync/notifier/gaia_auth/gaiaauth.cc
+++ b/chrome/browser/sync/notifier/gaia_auth/gaiaauth.cc
@@ -4,11 +4,11 @@
#include <string>
+#include "base/logging.h"
#include "chrome/browser/sync/notifier/gaia_auth/gaiaauth.h"
#include "talk/base/asynchttprequest.h"
#include "talk/base/firewallsocketserver.h"
#include "talk/base/httpclient.h"
-#include "talk/base/logging.h"
#include "talk/base/physicalsocketserver.h"
#include "talk/base/signalthread.h"
#include "talk/base/socketadapters.h"
diff --git a/chrome/browser/sync/notifier/gaia_auth/gaiahelper.cc b/chrome/browser/sync/notifier/gaia_auth/gaiahelper.cc
index 9d5f4eb..f20f3ed 100644
--- a/chrome/browser/sync/notifier/gaia_auth/gaiahelper.cc
+++ b/chrome/browser/sync/notifier/gaia_auth/gaiahelper.cc
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "chrome/browser/sync/notifier/gaia_auth/gaiahelper.h"
+#include "base/logging.h"
#include "talk/base/common.h"
#include "talk/base/cryptstring.h"
#include "talk/base/httpclient.h"
@@ -147,9 +148,9 @@ GaiaResponse GaiaParseSidResponse(const talk_base::HttpClient& client,
response.assign(stream->GetBuffer(), length);
}
- LOG(LS_INFO) << "GaiaAuth request to " << client.request().path;
- LOG(LS_INFO) << "GaiaAuth Status Code: " << status_code;
- LOG(LS_INFO) << response;
+ LOG(INFO) << "GaiaAuth request to " << client.request().path;
+ LOG(INFO) << "GaiaAuth Status Code: " << status_code;
+ LOG(INFO) << response;
if (status_code == talk_base::HC_FORBIDDEN) {
// The error URL may be the relative path to the captcha jpg.
diff --git a/chrome/browser/sync/notifier/gaia_auth/win/win32window.cc b/chrome/browser/sync/notifier/gaia_auth/win/win32window.cc
index 25ea0a3..720838e 100644
--- a/chrome/browser/sync/notifier/gaia_auth/win/win32window.cc
+++ b/chrome/browser/sync/notifier/gaia_auth/win/win32window.cc
@@ -4,10 +4,11 @@
//
// Originally from libjingle. Minor alterations to compile it in Chrome.
-#include "talk/base/common.h"
-#include "talk/base/logging.h"
#include "talk/base/win32window.h"
+#include "base/logging.h"
+#include "talk/base/common.h"
+
namespace talk_base {
///////////////////////////////////////////////////////////////////////////////
@@ -42,7 +43,7 @@ bool Win32Window::Create(HWND parent, const wchar_t* title, DWORD style,
wcex.lpszClassName = kWindowBaseClassName;
window_class_ = ::RegisterClassEx(&wcex);
if (!window_class_) {
- LOG_GLE(LS_ERROR) << "RegisterClassEx failed";
+ LOG(ERROR) << "RegisterClassEx failed: " << GetLastError();
return false;
}
}
@@ -97,7 +98,7 @@ LRESULT Win32Window::WndProc(HWND hwnd, UINT uMsg,
if (WM_DESTROY == uMsg) {
for (HWND child = ::GetWindow(hwnd, GW_CHILD); child;
child = ::GetWindow(child, GW_HWNDNEXT)) {
- LOG(LS_INFO) << "Child window: " << static_cast<void*>(child);
+ LOG(INFO) << "Child window: " << static_cast<void*>(child);
}
}
if (WM_NCDESTROY == uMsg) {