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

Side by Side Diff: tools/android/forwarder2/device_controller.h

Issue 555093002: Fix WeakPtrFactory ordering problems in src/tools (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
« no previous file with comments | « no previous file | tools/android/forwarder2/device_controller.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) 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 #ifndef TOOLS_ANDROID_FORWARDER2_DEVICE_CONTROLLER_H_ 5 #ifndef TOOLS_ANDROID_FORWARDER2_DEVICE_CONTROLLER_H_
6 #define TOOLS_ANDROID_FORWARDER2_DEVICE_CONTROLLER_H_ 6 #define TOOLS_ANDROID_FORWARDER2_DEVICE_CONTROLLER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 void AcceptHostCommandSoon(); 43 void AcceptHostCommandSoon();
44 void AcceptHostCommandInternal(); 44 void AcceptHostCommandInternal();
45 45
46 // Note that this can end up being called after the DeviceController is 46 // Note that this can end up being called after the DeviceController is
47 // destroyed which is why a weak pointer is used. 47 // destroyed which is why a weak pointer is used.
48 static void DeleteListenerOnError( 48 static void DeleteListenerOnError(
49 const base::WeakPtr<DeviceController>& device_controller_ptr, 49 const base::WeakPtr<DeviceController>& device_controller_ptr,
50 scoped_ptr<DeviceListener> device_listener); 50 scoped_ptr<DeviceListener> device_listener);
51 51
52 base::WeakPtrFactory<DeviceController> weak_ptr_factory_;
53 const scoped_ptr<Socket> host_socket_; 52 const scoped_ptr<Socket> host_socket_;
54 // Used to notify the controller to exit. 53 // Used to notify the controller to exit.
55 const int exit_notifier_fd_; 54 const int exit_notifier_fd_;
56 // Lets ensure DeviceListener instances are deleted on the thread they were 55 // Lets ensure DeviceListener instances are deleted on the thread they were
57 // created on. 56 // created on.
58 const scoped_refptr<base::SingleThreadTaskRunner> construction_task_runner_; 57 const scoped_refptr<base::SingleThreadTaskRunner> construction_task_runner_;
59 ListenersMap listeners_; 58 ListenersMap listeners_;
60 59
60 base::WeakPtrFactory<DeviceController> weak_ptr_factory_;
digit1 2014/09/09 14:50:00 lgtm, but you probably want to add a comment here
61
61 DISALLOW_COPY_AND_ASSIGN(DeviceController); 62 DISALLOW_COPY_AND_ASSIGN(DeviceController);
62 }; 63 };
63 64
64 } // namespace forwarder 65 } // namespace forwarder
65 66
66 #endif // TOOLS_ANDROID_FORWARDER2_DEVICE_CONTROLLER_H_ 67 #endif // TOOLS_ANDROID_FORWARDER2_DEVICE_CONTROLLER_H_
OLDNEW
« no previous file with comments | « no previous file | tools/android/forwarder2/device_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698