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

Unified Diff: chrome/profiling/profiling_globals.h

Issue 2937133002: Launch browser when --memlog is specified on the command line. (Closed)
Patch Set: Fix Created 3 years, 6 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/profiling/DEPS ('k') | chrome/profiling/profiling_globals.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/profiling/profiling_globals.h
diff --git a/chrome/profiling/profiling_globals.h b/chrome/profiling/profiling_globals.h
new file mode 100644
index 0000000000000000000000000000000000000000..84060a7664e1f4ffc4ce675aa87775bf2f35e92b
--- /dev/null
+++ b/chrome/profiling/profiling_globals.h
@@ -0,0 +1,49 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_PROFILING_PROFILING_GLOBALS_H_
+#define CHROME_PROFILING_PROFILING_GLOBALS_H_
+
+#include <memory>
+
+#include "base/macros.h"
+#include "base/memory/ref_counted.h"
+#include "base/threading/thread.h"
+
+namespace base {
+class MessageLoopForUI;
+class SingleThreadTaskRunner;
+class TaskRunner;
+} // namespace base
+
+namespace profiling {
+
+class ProfilingGlobals {
+ public:
+ static ProfilingGlobals* Get();
+
+ base::TaskRunner* GetIORunner();
+
+ // Returns non-null when inside RunMainMessageLoop. Call only on the
+ // main thread (otherwise there's a shutdown race).
+ scoped_refptr<base::SingleThreadTaskRunner> GetMainThread() const;
+
+ void RunMainMessageLoop();
+ void QuitWhenIdle();
+
+ private:
+ ProfilingGlobals();
+ ~ProfilingGlobals();
+
+ // Non-null inside RunMainMessageLoop.
+ base::MessageLoopForUI* main_message_loop_ = nullptr;
+
+ base::Thread io_thread_;
+
+ DISALLOW_COPY_AND_ASSIGN(ProfilingGlobals);
+};
+
+} // namespace profiling
+
+#endif // CHROME_PROFILING_PROFILING_GLOBALS_H_
« no previous file with comments | « chrome/profiling/DEPS ('k') | chrome/profiling/profiling_globals.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698