Upstream version 7.35.144.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / devtools / refcounted_adb_thread.h
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
13     : public base::RefCountedThreadSafe<RefCountedAdbThread> {
14  public:
15   static scoped_refptr<RefCountedAdbThread> GetInstance();
16   base::MessageLoop* message_loop();
17
18  private:
19   friend class base::RefCountedThreadSafe<RefCountedAdbThread>;
20   static RefCountedAdbThread* instance_;
21   static void StopThread(base::Thread* thread);
22
23   RefCountedAdbThread();
24   virtual ~RefCountedAdbThread();
25   base::Thread* thread_;
26 };
27
28 #endif  // CHROME_BROWSER_DEVTOOLS_REFCOUNTED_ADB_THREAD_H_