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

Side by Side Diff: extensions/browser/api/serial/serial_connection.h

Issue 780713002: Fix remaining WeakPtrFactory ordering problems (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 EXTENSIONS_BROWSER_API_SERIAL_SERIAL_CONNECTION_H_ 5 #ifndef EXTENSIONS_BROWSER_API_SERIAL_SERIAL_CONNECTION_H_
6 #define EXTENSIONS_BROWSER_API_SERIAL_SERIAL_CONNECTION_H_ 6 #define EXTENSIONS_BROWSER_API_SERIAL_SERIAL_CONNECTION_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 // task upon construction and implicitly cancels the task upon 122 // task upon construction and implicitly cancels the task upon
123 // destruction if it hasn't run yet. 123 // destruction if it hasn't run yet.
124 class TimeoutTask { 124 class TimeoutTask {
125 public: 125 public:
126 TimeoutTask(const base::Closure& closure, const base::TimeDelta& delay); 126 TimeoutTask(const base::Closure& closure, const base::TimeDelta& delay);
127 ~TimeoutTask(); 127 ~TimeoutTask();
128 128
129 private: 129 private:
130 void Run() const; 130 void Run() const;
131 131
132 base::WeakPtrFactory<TimeoutTask> weak_factory_;
133 base::Closure closure_; 132 base::Closure closure_;
134 base::TimeDelta delay_; 133 base::TimeDelta delay_;
134 base::WeakPtrFactory<TimeoutTask> weak_factory_;
135 }; 135 };
136 136
137 // Handles a receive timeout. 137 // Handles a receive timeout.
138 void OnReceiveTimeout(); 138 void OnReceiveTimeout();
139 139
140 // Handles a send timeout. 140 // Handles a send timeout.
141 void OnSendTimeout(); 141 void OnSendTimeout();
142 142
143 // Receives read completion notification from the |io_handler_|. 143 // Receives read completion notification from the |io_handler_|.
144 void OnAsyncReadComplete(int bytes_read, device::serial::ReceiveError error); 144 void OnAsyncReadComplete(int bytes_read, device::serial::ReceiveError error);
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 template <> 205 template <>
206 struct TypeConverter<device::serial::ConnectionOptionsPtr, 206 struct TypeConverter<device::serial::ConnectionOptionsPtr,
207 extensions::core_api::serial::ConnectionOptions> { 207 extensions::core_api::serial::ConnectionOptions> {
208 static device::serial::ConnectionOptionsPtr Convert( 208 static device::serial::ConnectionOptionsPtr Convert(
209 const extensions::core_api::serial::ConnectionOptions& input); 209 const extensions::core_api::serial::ConnectionOptions& input);
210 }; 210 };
211 211
212 } // namespace mojo 212 } // namespace mojo
213 213
214 #endif // EXTENSIONS_BROWSER_API_SERIAL_SERIAL_CONNECTION_H_ 214 #endif // EXTENSIONS_BROWSER_API_SERIAL_SERIAL_CONNECTION_H_
OLDNEW
« no previous file with comments | « extensions/browser/api/hid/hid_device_manager.cc ('k') | extensions/browser/api/serial/serial_connection.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698