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

Unified Diff: net/base/net_log.h

Issue 1017913003: Add some instrumentation to investigate a possible UAF. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add OS_NACL guard Created 5 years, 9 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 | « no previous file | net/base/net_log.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/net_log.h
diff --git a/net/base/net_log.h b/net/base/net_log.h
index 5fb27917aba09cb0ec5f63990a39f78aa83a43bf..b78f8686c1d03b4155700314630b8cbcfae32ed8 100644
--- a/net/base/net_log.h
+++ b/net/base/net_log.h
@@ -7,10 +7,22 @@
#include <string>
+#include "build/build_config.h"
+
+// TODO(eroman): Temporary while investigating crbug.com/467797.
+// Note base::Debug::StackTrace() is not supported in NACL builds
+// so conditionally disabled it there.
+#ifndef OS_NACL
+#define TEMP_INSTRUMENTATION_467797
+#endif
+
#include "base/atomicops.h"
#include "base/basictypes.h"
#include "base/callback_forward.h"
#include "base/compiler_specific.h"
+#ifdef TEMP_INSTRUMENTATION_467797
+#include "base/debug/stack_trace.h"
+#endif
#include "base/observer_list.h"
#include "base/strings/string16.h"
#include "base/synchronization/lock.h"
@@ -332,6 +344,7 @@ class NET_EXPORT NetLog {
class NET_EXPORT BoundNetLog {
public:
BoundNetLog() : net_log_(NULL) {}
+ ~BoundNetLog();
// Add a log entry to the NetLog for the bound source.
void AddEntry(NetLog::EventType type, NetLog::EventPhase phase) const;
@@ -388,12 +401,29 @@ class NET_EXPORT BoundNetLog {
NetLog* net_log() const { return net_log_; }
private:
+#ifdef TEMP_INSTRUMENTATION_467797
+ // TODO(eroman): Temporary while investigating crbug.com/467797
+ enum Liveness {
+ ALIVE = 0xCA11AB13,
+ DEAD = 0xDEADBEEF,
+ };
+#endif
+
BoundNetLog(const NetLog::Source& source, NetLog* net_log)
: source_(source), net_log_(net_log) {
}
+ // TODO(eroman): Temporary while investigating crbug.com/467797
+ void CrashIfInvalid() const;
+
NetLog::Source source_;
NetLog* net_log_;
+
+#ifdef TEMP_INSTRUMENTATION_467797
+ // TODO(eroman): Temporary while investigating crbug.com/467797
+ Liveness liveness_ = ALIVE;
+ base::debug::StackTrace stack_trace_;
+#endif
};
} // namespace net
« no previous file with comments | « no previous file | net/base/net_log.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698