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

Unified Diff: net/base/net_log.cc

Issue 15662008: Make net and ipc explicitly use the base namespace for Values. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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
« no previous file with comments | « net/base/file_stream_net_log_parameters.cc ('k') | net/base/net_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/net_log.cc
diff --git a/net/base/net_log.cc b/net/base/net_log.cc
index ec4d4727b6a261c0b4f3c89906f2e549cdbcde81..b1ec72f21937a4d305e42738f2eb4992a6fa6698 100644
--- a/net/base/net_log.cc
+++ b/net/base/net_log.cc
@@ -20,53 +20,53 @@ namespace {
// bytes transferred and, if the log level indicates bytes should be logged and
// |byte_count| > 0, the bytes themselves. The bytes are hex-encoded, since
// base::StringValue only supports UTF-8.
-Value* BytesTransferredCallback(int byte_count,
- const char* bytes,
- NetLog::LogLevel log_level) {
- DictionaryValue* dict = new DictionaryValue();
+base::Value* BytesTransferredCallback(int byte_count,
+ const char* bytes,
+ NetLog::LogLevel log_level) {
+ base::DictionaryValue* dict = new base::DictionaryValue();
dict->SetInteger("byte_count", byte_count);
if (NetLog::IsLoggingBytes(log_level) && byte_count > 0)
dict->SetString("hex_encoded_bytes", base::HexEncode(bytes, byte_count));
return dict;
}
-Value* SourceEventParametersCallback(const NetLog::Source source,
- NetLog::LogLevel /* log_level */) {
+base::Value* SourceEventParametersCallback(const NetLog::Source source,
+ NetLog::LogLevel /* log_level */) {
if (!source.IsValid())
return NULL;
- DictionaryValue* event_params = new DictionaryValue();
+ base::DictionaryValue* event_params = new base::DictionaryValue();
source.AddToEventParameters(event_params);
return event_params;
}
-Value* NetLogIntegerCallback(const char* name,
- int value,
- NetLog::LogLevel /* log_level */) {
- DictionaryValue* event_params = new DictionaryValue();
+base::Value* NetLogIntegerCallback(const char* name,
+ int value,
+ NetLog::LogLevel /* log_level */) {
+ base::DictionaryValue* event_params = new base::DictionaryValue();
event_params->SetInteger(name, value);
return event_params;
}
-Value* NetLogInt64Callback(const char* name,
- int64 value,
- NetLog::LogLevel /* log_level */) {
- DictionaryValue* event_params = new DictionaryValue();
+base::Value* NetLogInt64Callback(const char* name,
+ int64 value,
+ NetLog::LogLevel /* log_level */) {
+ base::DictionaryValue* event_params = new base::DictionaryValue();
event_params->SetString(name, base::Int64ToString(value));
return event_params;
}
-Value* NetLogStringCallback(const char* name,
- const std::string* value,
- NetLog::LogLevel /* log_level */) {
- DictionaryValue* event_params = new DictionaryValue();
+base::Value* NetLogStringCallback(const char* name,
+ const std::string* value,
+ NetLog::LogLevel /* log_level */) {
+ base::DictionaryValue* event_params = new base::DictionaryValue();
event_params->SetString(name, *value);
return event_params;
}
-Value* NetLogString16Callback(const char* name,
- const base::string16* value,
- NetLog::LogLevel /* log_level */) {
- DictionaryValue* event_params = new DictionaryValue();
+base::Value* NetLogString16Callback(const char* name,
+ const base::string16* value,
+ NetLog::LogLevel /* log_level */) {
+ base::DictionaryValue* event_params = new base::DictionaryValue();
event_params->SetString(name, *value);
return event_params;
}
@@ -86,8 +86,9 @@ bool NetLog::Source::IsValid() const {
return id != kInvalidId;
}
-void NetLog::Source::AddToEventParameters(DictionaryValue* event_params) const {
- DictionaryValue* dict = new DictionaryValue();
+void NetLog::Source::AddToEventParameters(
+ base::DictionaryValue* event_params) const {
+ base::DictionaryValue* dict = new base::DictionaryValue();
dict->SetInteger("type", static_cast<int>(type));
dict->SetInteger("id", static_cast<int>(id));
event_params->Set("source_dependency", dict);
@@ -99,8 +100,8 @@ NetLog::ParametersCallback NetLog::Source::ToEventParametersCallback() const {
// static
bool NetLog::Source::FromEventParameters(Value* event_params, Source* source) {
- DictionaryValue* dict;
- DictionaryValue* source_dict;
+ base::DictionaryValue* dict;
+ base::DictionaryValue* source_dict;
int source_id;
int source_type;
if (!event_params ||
@@ -118,13 +119,13 @@ bool NetLog::Source::FromEventParameters(Value* event_params, Source* source) {
return true;
}
-Value* NetLog::Entry::ToValue() const {
- DictionaryValue* entry_dict(new DictionaryValue());
+base::Value* NetLog::Entry::ToValue() const {
+ base::DictionaryValue* entry_dict(new base::DictionaryValue());
entry_dict->SetString("time", TickCountToString(time_));
// Set the entry source.
- DictionaryValue* source_dict = new DictionaryValue();
+ base::DictionaryValue* source_dict = new base::DictionaryValue();
source_dict->SetInteger("id", source_.id);
source_dict->SetInteger("type", static_cast<int>(source_.type));
entry_dict->Set("source", source_dict);
@@ -143,7 +144,7 @@ Value* NetLog::Entry::ToValue() const {
return entry_dict;
}
-Value* NetLog::Entry::ParametersToValue() const {
+base::Value* NetLog::Entry::ParametersToValue() const {
if (parameters_callback_)
return parameters_callback_->Run(log_level_);
return NULL;
@@ -299,7 +300,7 @@ const char* NetLog::EventTypeToString(EventType event) {
// static
base::Value* NetLog::GetEventTypesAsValue() {
- DictionaryValue* dict = new DictionaryValue();
+ base::DictionaryValue* dict = new base::DictionaryValue();
for (int i = 0; i < EVENT_COUNT; ++i) {
dict->SetInteger(EventTypeToString(static_cast<EventType>(i)), i);
}
@@ -320,7 +321,7 @@ const char* NetLog::SourceTypeToString(SourceType source) {
// static
base::Value* NetLog::GetSourceTypesAsValue() {
- DictionaryValue* dict = new DictionaryValue();
+ base::DictionaryValue* dict = new base::DictionaryValue();
for (int i = 0; i < SOURCE_COUNT; ++i) {
dict->SetInteger(SourceTypeToString(static_cast<SourceType>(i)), i);
}
« no previous file with comments | « net/base/file_stream_net_log_parameters.cc ('k') | net/base/net_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698