Index: base/location.cc |
diff --git a/base/location.cc b/base/location.cc |
index adf6e210508bcc5a18f8e87b596c52d7e80f0d92..5a21fb1eb235741ddee7887a68f4721bb3665e1e 100644 |
--- a/base/location.cc |
+++ b/base/location.cc |
@@ -14,6 +14,10 @@ extern "C" { |
#include "base/location.h" |
#include "base/string_number_conversions.h" |
#include "base/stringprintf.h" |
+#include "base/values.h" |
+ |
+using base::DictionaryValue; |
+using base::Value; |
namespace tracked_objects { |
@@ -71,18 +75,30 @@ void Location::WriteFunctionName(std::string* output) const { |
} |
} |
-base::DictionaryValue* Location::ToValue() const { |
- base::DictionaryValue* dictionary = new base::DictionaryValue; |
- dictionary->Set("file_name", base::Value::CreateStringValue(file_name_)); |
- // Note: This function name is not escaped, and templates have less than |
+//------------------------------------------------------------------------------ |
+SerializedLocation::SerializedLocation() { |
+} |
+ |
+SerializedLocation::SerializedLocation( |
+ const tracked_objects::Location& location) |
+ : file_name(location.file_name()), |
+ function_name(location.function_name()), |
+ line_number(location.line_number()) { |
+} |
+ |
+SerializedLocation::~SerializedLocation() { |
+} |
+ |
+void SerializedLocation::ToValue(DictionaryValue* dictionary) const { |
+ dictionary->Set("file_name", Value::CreateStringValue(file_name)); |
+ // Note: This function name is not escaped, and templates have less-than |
// characters, which means this is not suitable for display as HTML unless |
// properly escaped. |
- dictionary->Set("function_name", |
- base::Value::CreateStringValue(function_name_)); |
- dictionary->Set("line_number", base::Value::CreateIntegerValue(line_number_)); |
- return dictionary; |
+ dictionary->Set("function_name", Value::CreateStringValue(function_name)); |
+ dictionary->Set("line_number", Value::CreateIntegerValue(line_number)); |
} |
+//------------------------------------------------------------------------------ |
#if defined(COMPILER_MSVC) |
__declspec(noinline) |
#endif |