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

Side by Side Diff: chrome/browser/task_management/sampling/task_manager_io_thread_helper.cc

Issue 2197483003: Move the Mac Task Manager to the new backend code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: mark Created 4 years, 4 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/BUILD.gn ('k') | chrome/browser/task_management/task_manager_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #include "chrome/browser/task_management/sampling/task_manager_io_thread_helper. h" 5 #include "chrome/browser/task_management/sampling/task_manager_io_thread_helper. h"
6 6
7 #include "chrome/browser/task_management/sampling/task_manager_impl.h" 7 #include "chrome/browser/task_management/sampling/task_manager_impl.h"
8 #include "content/public/browser/browser_thread.h" 8 #include "content/public/browser/browser_thread.h"
9 #include "content/public/browser/resource_request_info.h" 9 #include "content/public/browser/resource_request_info.h"
10 10
11 namespace task_management { 11 namespace task_management {
12 12
13 namespace { 13 namespace {
14 14
15 TaskManagerIoThreadHelper* g_io_thread_helper = nullptr; 15 TaskManagerIoThreadHelper* g_io_thread_helper = nullptr;
16 16
17 } // namespace 17 } // namespace
18 18
19 IoThreadHelperManager::IoThreadHelperManager() { 19 IoThreadHelperManager::IoThreadHelperManager() {
20 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 20 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
21 21
22 content::BrowserThread::PostTask( 22 content::BrowserThread::PostTask(
23 content::BrowserThread::IO, 23 content::BrowserThread::IO,
24 FROM_HERE, 24 FROM_HERE,
25 base::Bind(&TaskManagerIoThreadHelper::CreateInstance)); 25 base::Bind(&TaskManagerIoThreadHelper::CreateInstance));
26 } 26 }
27 27
28 IoThreadHelperManager::~IoThreadHelperManager() { 28 IoThreadHelperManager::~IoThreadHelperManager() {
29 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 29 // This may be called at exit time when the main thread is no longer
30 // registered as the UI thread.
31 DCHECK(
32 content::BrowserThread::CurrentlyOn(content::BrowserThread::UI) ||
33 !content::BrowserThread::IsMessageLoopValid(content::BrowserThread::UI));
30 34
31 content::BrowserThread::PostTask( 35 content::BrowserThread::PostTask(
32 content::BrowserThread::IO, 36 content::BrowserThread::IO,
33 FROM_HERE, 37 FROM_HERE,
34 base::Bind(&TaskManagerIoThreadHelper::DeleteInstance)); 38 base::Bind(&TaskManagerIoThreadHelper::DeleteInstance));
35 } 39 }
36 40
37 // static 41 // static
38 void TaskManagerIoThreadHelper::CreateInstance() { 42 void TaskManagerIoThreadHelper::CreateInstance() {
39 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); 43 DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 base::Bind(&TaskManagerIoThreadHelper::OnMultipleBytesReadIO, 118 base::Bind(&TaskManagerIoThreadHelper::OnMultipleBytesReadIO,
115 weak_factory_.GetWeakPtr()), 119 weak_factory_.GetWeakPtr()),
116 base::TimeDelta::FromSeconds(1)); 120 base::TimeDelta::FromSeconds(1));
117 } 121 }
118 122
119 bytes_read_buffer_.push_back( 123 bytes_read_buffer_.push_back(
120 BytesReadParam(origin_pid, child_id, route_id, bytes_read)); 124 BytesReadParam(origin_pid, child_id, route_id, bytes_read));
121 } 125 }
122 126
123 } // namespace task_management 127 } // namespace task_management
OLDNEW
« no previous file with comments | « chrome/browser/BUILD.gn ('k') | chrome/browser/task_management/task_manager_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698