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

Side by Side Diff: content/browser/tracing/background_tracing_manager_impl.cc

Issue 2034663003: Remove use of deprecated MessageLoop methods in content. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 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 unified diff | Download patch
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 "content/browser/tracing/background_tracing_manager_impl.h" 5 #include "content/browser/tracing/background_tracing_manager_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/json/json_writer.h" 10 #include "base/json/json_writer.h"
11 #include "base/location.h"
11 #include "base/macros.h" 12 #include "base/macros.h"
12 #include "base/metrics/histogram_macros.h" 13 #include "base/metrics/histogram_macros.h"
13 #include "base/rand_util.h" 14 #include "base/rand_util.h"
15 #include "base/single_thread_task_runner.h"
16 #include "base/threading/thread_task_runner_handle.h"
14 #include "base/time/time.h" 17 #include "base/time/time.h"
15 #include "content/browser/tracing/background_tracing_rule.h" 18 #include "content/browser/tracing/background_tracing_rule.h"
16 #include "content/public/browser/browser_thread.h" 19 #include "content/public/browser/browser_thread.h"
17 #include "content/public/browser/content_browser_client.h" 20 #include "content/public/browser/content_browser_client.h"
18 #include "content/public/browser/tracing_delegate.h" 21 #include "content/public/browser/tracing_delegate.h"
19 #include "content/public/common/content_client.h" 22 #include "content/public/common/content_client.h"
20 #include "content/public/common/content_switches.h" 23 #include "content/public/common/content_switches.h"
21 24
22 namespace content { 25 namespace content {
23 26
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 // we have to wait until initialization is finished to validate that the 135 // we have to wait until initialization is finished to validate that the
133 // scenario can run. 136 // scenario can run.
134 if (BrowserThread::IsThreadInitialized(BrowserThread::IO)) { 137 if (BrowserThread::IsThreadInitialized(BrowserThread::IO)) {
135 // TODO(oysteine): Retry when time_until_allowed has elapsed. 138 // TODO(oysteine): Retry when time_until_allowed has elapsed.
136 if (config && delegate_ && 139 if (config && delegate_ &&
137 !delegate_->IsAllowedToBeginBackgroundScenario( 140 !delegate_->IsAllowedToBeginBackgroundScenario(
138 *config.get(), requires_anonymized_data)) { 141 *config.get(), requires_anonymized_data)) {
139 return false; 142 return false;
140 } 143 }
141 } else { 144 } else {
142 base::MessageLoop::current()->PostTask( 145 base::ThreadTaskRunnerHandle::Get()->PostTask(
143 FROM_HERE, 146 FROM_HERE,
144 base::Bind(&BackgroundTracingManagerImpl::ValidateStartupScenario, 147 base::Bind(&BackgroundTracingManagerImpl::ValidateStartupScenario,
145 base::Unretained(this))); 148 base::Unretained(this)));
146 } 149 }
147 150
148 std::unique_ptr<const content::BackgroundTracingConfigImpl> config_impl( 151 std::unique_ptr<const content::BackgroundTracingConfigImpl> config_impl(
149 static_cast<BackgroundTracingConfigImpl*>(config.release())); 152 static_cast<BackgroundTracingConfigImpl*>(config.release()));
150 153
151 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); 154 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
152 155
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
548 case BackgroundTracingConfigImpl::CategoryPreset::BLINK_STYLE: 551 case BackgroundTracingConfigImpl::CategoryPreset::BLINK_STYLE:
549 return "blink_style"; 552 return "blink_style";
550 case BackgroundTracingConfigImpl::CategoryPreset::CATEGORY_PRESET_UNSET: 553 case BackgroundTracingConfigImpl::CategoryPreset::CATEGORY_PRESET_UNSET:
551 NOTREACHED(); 554 NOTREACHED();
552 } 555 }
553 NOTREACHED(); 556 NOTREACHED();
554 return ""; 557 return "";
555 } 558 }
556 559
557 } // namspace content 560 } // namspace content
OLDNEW
« no previous file with comments | « content/browser/service_worker/service_worker_client_utils.cc ('k') | content/public/test/mock_render_process_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698