| OLD | NEW |
| 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_FORWARDER_H_ | 5 #ifndef TOOLS_ANDROID_FORWARDER2_FORWARDER_H_ |
| 6 #define TOOLS_ANDROID_FORWARDER2_FORWARDER_H_ | 6 #define TOOLS_ANDROID_FORWARDER2_FORWARDER_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | |
| 9 #include "base/logging.h" | |
| 10 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 11 #include "tools/android/forwarder2/socket.h" | 9 #include "base/threading/thread.h" |
| 12 #include "tools/android/forwarder2/thread.h" | |
| 13 | 10 |
| 14 namespace forwarder2 { | 11 namespace forwarder2 { |
| 15 | 12 |
| 16 class Forwarder : public Thread { | 13 class Socket; |
| 17 public: | |
| 18 Forwarder(scoped_ptr<Socket> socket1, scoped_ptr<Socket> socket2); | |
| 19 virtual ~Forwarder(); | |
| 20 | 14 |
| 21 // This object self deletes after running, so one cannot join. | 15 void StartForwarder(scoped_ptr<Socket> socket1, scoped_ptr<Socket> socket2); |
| 22 // Thread: | |
| 23 virtual void Join() OVERRIDE; | |
| 24 | 16 |
| 25 protected: | 17 } // namespace forwarder2 |
| 26 // Thread: | |
| 27 // This object self deletes after running. | |
| 28 virtual void Run() OVERRIDE; | |
| 29 | |
| 30 private: | |
| 31 scoped_ptr<Socket> socket1_; | |
| 32 scoped_ptr<Socket> socket2_; | |
| 33 | |
| 34 DISALLOW_COPY_AND_ASSIGN(Forwarder); | |
| 35 }; | |
| 36 | |
| 37 } // namespace forwarder | |
| 38 | 18 |
| 39 #endif // TOOLS_ANDROID_FORWARDER2_FORWARDER_H_ | 19 #endif // TOOLS_ANDROID_FORWARDER2_FORWARDER_H_ |
| OLD | NEW |