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

Unified Diff: chrome/common/custom_handlers/protocol_handler.cc

Issue 10559049: Add ToString method for easy DLOG and debug support (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Only include ToString in debug builds. Created 8 years, 6 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: chrome/common/custom_handlers/protocol_handler.cc
diff --git a/chrome/common/custom_handlers/protocol_handler.cc b/chrome/common/custom_handlers/protocol_handler.cc
index 4d61a415c62a3b1650c7044844f3fde115371492..b31facc06e473cf0a5bb134bfafdd401ad923d0e 100644
--- a/chrome/common/custom_handlers/protocol_handler.cc
+++ b/chrome/common/custom_handlers/protocol_handler.cc
@@ -5,9 +5,11 @@
#include "chrome/common/custom_handlers/protocol_handler.h"
#include "base/string_util.h"
+#include "base/stringprintf.h"
Peter Kasting 2012/06/22 23:45:48 Nit: This include not needed
Steve McKay 2012/06/27 22:34:38 Done.
#include "base/utf_string_conversions.h"
#include "net/base/escape.h"
+
ProtocolHandler::ProtocolHandler(const std::string& protocol,
const GURL& url,
const string16& title)
@@ -70,6 +72,15 @@ DictionaryValue* ProtocolHandler::Encode() const {
return d;
}
+# if !defined(NDEBUG)
Peter Kasting 2012/06/22 23:45:48 Nit: No space after # (2 places)
Steve McKay 2012/06/27 22:34:38 Done.
+std::string ProtocolHandler::ToString() const {
+ return "{ protocol=" + protocol_ +
+ ", url=" + url_.spec() +
+ ", title=" + UTF16ToASCII(title_) +
+ " }";
+}
+# endif
+
bool ProtocolHandler::operator==(const ProtocolHandler& other) const {
return protocol_ == other.protocol_ &&
url_ == other.url_ &&

Powered by Google App Engine
This is Rietveld 408576698