summaryrefslogtreecommitdiffstats
path: root/base/location.h
diff options
context:
space:
mode:
authorisherman@chromium.org <isherman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-13 00:39:26 +0000
committerisherman@chromium.org <isherman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-13 00:39:26 +0000
commit1cb05dbbcafd3f35999606af6c8316058ce7b93a (patch)
treedfa6794b8a9c83a91d4c1bb487ab7551e3514fe3 /base/location.h
parent543f27572597201d5fae77066c9146a6a87d41d8 (diff)
downloadchromium_src-1cb05dbbcafd3f35999606af6c8316058ce7b93a.zip
chromium_src-1cb05dbbcafd3f35999606af6c8316058ce7b93a.tar.gz
chromium_src-1cb05dbbcafd3f35999606af6c8316058ce7b93a.tar.bz2
[UMA] Use proper C++ objects to serialize tracked_objects across process boundaries.
See https://chromiumcodereview.appspot.com/9702014/ for the original code review. Uploading to a new issue due to an AppEngine error... BUG=103480 TEST=none (refactoring, no functional change expected) TBR=jam@chromium.org,jar@chromium.org,eroman@chromium.org,jhawkins@chromium.org,ajwong@chromium.org Review URL: http://codereview.chromium.org/10077001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@132109 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/location.h')
-rw-r--r--base/location.h22
1 files changed, 14 insertions, 8 deletions
diff --git a/base/location.h b/base/location.h
index fc9d360..05a4f66 100644
--- a/base/location.h
+++ b/base/location.h
@@ -8,10 +8,7 @@
#include <string>
#include "base/base_export.h"
-
-namespace base {
-class DictionaryValue;
-}
+#include "base/basictypes.h"
namespace tracked_objects {
@@ -61,10 +58,6 @@ class BASE_EXPORT Location {
// Write function_name_ in HTML with '<' and '>' properly encoded.
void WriteFunctionName(std::string* output) const;
- // Construct a Value* representation. The caller assumes ownership of the
- // memory in the returned instance.
- base::DictionaryValue* ToValue() const;
-
private:
const char* function_name_;
const char* file_name_;
@@ -72,6 +65,19 @@ class BASE_EXPORT Location {
const void* program_counter_;
};
+// A "snapshotted" representation of the Location class that can safely be
+// passed across process boundaries.
+struct BASE_EXPORT LocationSnapshot {
+ // The default constructor is exposed to support the IPC serialization macros.
+ LocationSnapshot();
+ explicit LocationSnapshot(const tracked_objects::Location& location);
+ ~LocationSnapshot();
+
+ std::string file_name;
+ std::string function_name;
+ int line_number;
+};
+
BASE_EXPORT const void* GetProgramCounter();
// Define a macro to record the current source location.