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

Unified Diff: base/win/object_watcher.cc

Issue 10535041: Log stack trace when ObjectWatcher::StartWatching() is called. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 | « base/win/object_watcher.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/win/object_watcher.cc
diff --git a/base/win/object_watcher.cc b/base/win/object_watcher.cc
index ebe596f3a6ec0686ed8cce3e2ae60a00f826b8d5..0b9d7a0f5ac94d47319f2751aeadb196476e9b97 100644
--- a/base/win/object_watcher.cc
+++ b/base/win/object_watcher.cc
@@ -5,6 +5,7 @@
#include "base/win/object_watcher.h"
#include "base/bind.h"
+#include "base/debug/alias.h"
#include "base/logging.h"
namespace base {
@@ -40,6 +41,7 @@ bool ObjectWatcher::StartWatching(HANDLE object, Delegate* delegate) {
delegate);
object_ = object;
origin_loop_ = MessageLoop::current();
+ stack_trace_ = base::debug::StackTrace();
if (!RegisterWaitForSingleObject(&wait_object_, object, DoneWaiting,
this, INFINITE, wait_flags)) {
@@ -97,6 +99,10 @@ void ObjectWatcher::Signal(Delegate* delegate) {
// StartWatching(). As a result, we save any state we need and clear previous
// watcher state before signaling the delegate.
HANDLE object = object_;
+ // Alias the stack trace where the watch was started so it'll be available in
+ // minidumps.
+ base::debug::StackTrace stack_trace = stack_trace_;
+ base::debug::Alias(&stack_trace);
StopWatching();
delegate->OnObjectSignaled(object);
}
« no previous file with comments | « base/win/object_watcher.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698