1 // Copyright 2013 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef CHROME_BROWSER_DEVTOOLS_REFCOUNTED_ADB_THREAD_H_ 6 #define CHROME_BROWSER_DEVTOOLS_REFCOUNTED_ADB_THREAD_H_ 7 8 #include "base/memory/ref_counted.h" 9 #include "base/message_loop/message_loop.h" 10 #include "base/threading/thread.h" 11 12 class RefCountedAdbThread : public base::RefCounted<RefCountedAdbThread> { 13 public: 14 static scoped_refptr<RefCountedAdbThread> GetInstance(); 15 base::MessageLoop* message_loop(); 16 17 private: 18 friend class base::RefCounted<RefCountedAdbThread>; 19 static RefCountedAdbThread* instance_; 20 static void StopThread(base::Thread* thread); 21 22 RefCountedAdbThread(); 23 virtual ~RefCountedAdbThread(); 24 base::Thread* thread_; 25 }; 26 27 #endif // CHROME_BROWSER_DEVTOOLS_REFCOUNTED_ADB_THREAD_H_ 28