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

Unified Diff: src/log.cc

Issue 13655: Make Logger::SuspectReadEvent extract the class name from the object. (Closed)
Patch Set: Created 12 years 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 | « src/log.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/log.cc
diff --git a/src/log.cc b/src/log.cc
index d145480f07ae3264df7a7ec1328f63058bcb9275..4fa398c8e2a6a45e17a4a61b68148365dfbba97a 100644
--- a/src/log.cc
+++ b/src/log.cc
@@ -593,12 +593,15 @@ void Logger::ResourceEvent(const char* name, const char* tag) {
}
-void Logger::SuspectReadEvent(String* name, String* obj) {
+void Logger::SuspectReadEvent(String* name, Object* obj) {
#ifdef ENABLE_LOGGING_AND_PROFILING
if (logfile_ == NULL || !FLAG_log_suspect) return;
+ String* class_name = obj->IsJSObject()
+ ? JSObject::cast(obj)->class_name()
+ : Heap::empty_string();
ScopedLock sl(mutex_);
fprintf(logfile_, "suspect-read,");
- obj->PrintOn(logfile_);
+ class_name->PrintOn(logfile_);
fprintf(logfile_, ",\"");
name->PrintOn(logfile_);
fprintf(logfile_, "\"\n");
« no previous file with comments | « src/log.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698