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

Side by Side Diff: base/synchronization/waitable_event_watcher_win.cc

Issue 686963002: Switching profiler instrumentations from ScopedProfile to ScopedTracker (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « base/process/kill_win.cc ('k') | chrome/browser/chromeos/drive/local_file_reader.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/synchronization/waitable_event_watcher.h" 5 #include "base/synchronization/waitable_event_watcher.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/profiler/scoped_profile.h" 8 #include "base/profiler/scoped_tracker.h"
9 #include "base/synchronization/waitable_event.h" 9 #include "base/synchronization/waitable_event.h"
10 #include "base/win/object_watcher.h" 10 #include "base/win/object_watcher.h"
11 11
12 namespace base { 12 namespace base {
13 13
14 WaitableEventWatcher::WaitableEventWatcher() 14 WaitableEventWatcher::WaitableEventWatcher()
15 : event_(NULL) { 15 : event_(NULL) {
16 } 16 }
17 17
18 WaitableEventWatcher::~WaitableEventWatcher() { 18 WaitableEventWatcher::~WaitableEventWatcher() {
(...skipping 11 matching lines...) Expand all
30 callback_.Reset(); 30 callback_.Reset();
31 event_ = NULL; 31 event_ = NULL;
32 watcher_.StopWatching(); 32 watcher_.StopWatching();
33 } 33 }
34 34
35 WaitableEvent* WaitableEventWatcher::GetWatchedEvent() { 35 WaitableEvent* WaitableEventWatcher::GetWatchedEvent() {
36 return event_; 36 return event_;
37 } 37 }
38 38
39 void WaitableEventWatcher::OnObjectSignaled(HANDLE h) { 39 void WaitableEventWatcher::OnObjectSignaled(HANDLE h) {
40 // TODO(vadimt): Remove ScopedProfile below once crbug.com/418183 is fixed. 40 // TODO(vadimt): Remove ScopedTracker below once crbug.com/418183 is fixed.
41 tracked_objects::ScopedProfile tracking_profile( 41 tracked_objects::ScopedTracker tracking_profile(
42 FROM_HERE_WITH_EXPLICIT_FUNCTION( 42 FROM_HERE_WITH_EXPLICIT_FUNCTION("WaitableEventWatche_OnObjectSignaled"));
43 "WaitableEventWatche_OnObjectSignaled"));
44 43
45 WaitableEvent* event = event_; 44 WaitableEvent* event = event_;
46 EventCallback callback = callback_; 45 EventCallback callback = callback_;
47 event_ = NULL; 46 event_ = NULL;
48 callback_.Reset(); 47 callback_.Reset();
49 DCHECK(event); 48 DCHECK(event);
50 49
51 callback.Run(event); 50 callback.Run(event);
52 } 51 }
53 52
54 } // namespace base 53 } // namespace base
OLDNEW
« no previous file with comments | « base/process/kill_win.cc ('k') | chrome/browser/chromeos/drive/local_file_reader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698