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

Side by Side Diff: base/win/object_watcher.cc

Issue 565123002: Maintaing the proper order of initialization WeakPtrFactory (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 unified diff | Download patch
« base/cancelable_callback.h ('K') | « base/win/object_watcher.h ('k') | no next file » | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/win/object_watcher.h" 5 #include "base/win/object_watcher.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 9
10 namespace base { 10 namespace base {
11 namespace win { 11 namespace win {
12 12
13 //----------------------------------------------------------------------------- 13 //-----------------------------------------------------------------------------
14 14
15 ObjectWatcher::ObjectWatcher() 15 ObjectWatcher::ObjectWatcher()
16 : weak_factory_(this), 16 : object_(NULL),
17 object_(NULL),
18 wait_object_(NULL), 17 wait_object_(NULL),
19 origin_loop_(NULL) { 18 origin_loop_(NULL),
19 weak_factory_(this) {
20 } 20 }
21 21
22 ObjectWatcher::~ObjectWatcher() { 22 ObjectWatcher::~ObjectWatcher() {
23 StopWatching(); 23 StopWatching();
24 } 24 }
25 25
26 bool ObjectWatcher::StartWatching(HANDLE object, Delegate* delegate) { 26 bool ObjectWatcher::StartWatching(HANDLE object, Delegate* delegate) {
27 CHECK(delegate); 27 CHECK(delegate);
28 if (wait_object_) { 28 if (wait_object_) {
29 NOTREACHED() << "Already watching an object"; 29 NOTREACHED() << "Already watching an object";
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 } 102 }
103 103
104 void ObjectWatcher::WillDestroyCurrentMessageLoop() { 104 void ObjectWatcher::WillDestroyCurrentMessageLoop() {
105 // Need to shutdown the watch so that we don't try to access the MessageLoop 105 // Need to shutdown the watch so that we don't try to access the MessageLoop
106 // after this point. 106 // after this point.
107 StopWatching(); 107 StopWatching();
108 } 108 }
109 109
110 } // namespace win 110 } // namespace win
111 } // namespace base 111 } // namespace base
OLDNEW
« base/cancelable_callback.h ('K') | « base/win/object_watcher.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698