| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2017 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_PROFILING_PROFILING_GLOBALS_H_ |
| 6 #define CHROME_PROFILING_PROFILING_GLOBALS_H_ |
| 7 |
| 8 #include <memory> |
| 9 |
| 10 #include "base/macros.h" |
| 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/threading/thread.h" |
| 13 |
| 14 namespace base { |
| 15 class MessageLoopForUI; |
| 16 class SingleThreadTaskRunner; |
| 17 class TaskRunner; |
| 18 } // namespace base |
| 19 |
| 20 namespace profiling { |
| 21 |
| 22 class ProfilingGlobals { |
| 23 public: |
| 24 static ProfilingGlobals* Get(); |
| 25 |
| 26 base::TaskRunner* GetIORunner(); |
| 27 |
| 28 // Returns non-null when inside RunMainMessageLoop. Call only on the |
| 29 // main thread (otherwise there's a shutdown race). |
| 30 scoped_refptr<base::SingleThreadTaskRunner> GetMainThread() const; |
| 31 |
| 32 void RunMainMessageLoop(); |
| 33 void QuitWhenIdle(); |
| 34 |
| 35 private: |
| 36 ProfilingGlobals(); |
| 37 ~ProfilingGlobals(); |
| 38 |
| 39 // Non-null inside RunMainMessageLoop. |
| 40 base::MessageLoopForUI* main_message_loop_ = nullptr; |
| 41 |
| 42 base::Thread io_thread_; |
| 43 |
| 44 DISALLOW_COPY_AND_ASSIGN(ProfilingGlobals); |
| 45 }; |
| 46 |
| 47 } // namespace profiling |
| 48 |
| 49 #endif // CHROME_PROFILING_PROFILING_GLOBALS_H_ |
| OLD | NEW |