Skip to content

Commit

Permalink
Replace tracked_objects::Location with base::Location.
Browse files Browse the repository at this point in the history
Part 1/4 to replace these namespace qualifications.

TBR=dcheng@chromium.org
TBR=armansito@chromium.org for chromeos/network

Bug: 763556
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I06ec01e1805744a7bba244b35ed09ace7af3152a
Reviewed-on: https://chromium-review.googlesource.com/662560
Commit-Queue: Brett Wilson <brettw@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Brett Wilson <brettw@chromium.org>
Cr-Commit-Position: refs/heads/master@{#501189}
  • Loading branch information
Brett Wilson authored and Commit Bot committed Sep 12, 2017
1 parent c10c886 commit e1a7042
Show file tree
Hide file tree
Showing 87 changed files with 196 additions and 226 deletions.
2 changes: 1 addition & 1 deletion cc/scheduler/begin_frame_tracker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace cc {

BeginFrameTracker::BeginFrameTracker(const tracked_objects::Location& location)
BeginFrameTracker::BeginFrameTracker(const base::Location& location)
: location_(location),
location_string_(location.ToString()),
current_finished_at_(base::TimeTicks() +
Expand Down
4 changes: 2 additions & 2 deletions cc/scheduler/begin_frame_tracker.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace cc {
// TODO(mithro): Record stats about the viz::BeginFrameArgs
class CC_EXPORT BeginFrameTracker {
public:
explicit BeginFrameTracker(const tracked_objects::Location& location);
explicit BeginFrameTracker(const base::Location& location);
~BeginFrameTracker();

// The Start and Finish methods manage the period that a BFA should be
Expand Down Expand Up @@ -85,7 +85,7 @@ class CC_EXPORT BeginFrameTracker {
// the BFA object. Can be called at any time.
bool HasFinished() const { return !current_finished_at_.is_null(); }

const tracked_objects::Location location_;
const base::Location location_;
const std::string location_string_;

base::TimeTicks current_updated_at_;
Expand Down
4 changes: 2 additions & 2 deletions cc/tiles/image_controller_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ class WorkerTaskRunner : public base::SequencedTaskRunner {
public:
WorkerTaskRunner() { thread_.Start(); }

bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here,
bool PostNonNestableDelayedTask(const base::Location& from_here,
base::OnceClosure task,
base::TimeDelta delay) override {
return PostDelayedTask(from_here, std::move(task), delay);
}

bool PostDelayedTask(const tracked_objects::Location& from_here,
bool PostDelayedTask(const base::Location& from_here,
base::OnceClosure task,
base::TimeDelta delay) override {
thread_.PostTask(std::move(task));
Expand Down
4 changes: 2 additions & 2 deletions cc/tiles/tile_manager_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ namespace {
// posted should run synchronously.
class SynchronousSimpleTaskRunner : public base::TestSimpleTaskRunner {
public:
bool PostDelayedTask(const tracked_objects::Location& from_here,
bool PostDelayedTask(const base::Location& from_here,
base::OnceClosure task,
base::TimeDelta delay) override {
TestSimpleTaskRunner::PostDelayedTask(from_here, std::move(task), delay);
Expand All @@ -67,7 +67,7 @@ class SynchronousSimpleTaskRunner : public base::TestSimpleTaskRunner {
return true;
}

bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here,
bool PostNonNestableDelayedTask(const base::Location& from_here,
base::OnceClosure task,
base::TimeDelta delay) override {
return PostDelayedTask(from_here, std::move(task), delay);
Expand Down
2 changes: 1 addition & 1 deletion cc/trees/blocking_task_runner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ bool BlockingTaskRunner::BelongsToCurrentThread() {
return base::PlatformThread::CurrentId() == thread_id_;
}

bool BlockingTaskRunner::PostTask(const tracked_objects::Location& from_here,
bool BlockingTaskRunner::PostTask(const base::Location& from_here,
base::OnceClosure task) {
base::AutoLock lock(lock_);
DCHECK(task_runner_.get() || capture_);
Expand Down
3 changes: 1 addition & 2 deletions cc/trees/blocking_task_runner.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ class CC_EXPORT BlockingTaskRunner {
// is true. When |capture_| is true, tasks posted will be caught and stored
// until the capturing stops. At that time the tasks will be run directly
// instead of being posted to the SingleThreadTaskRunner.
bool PostTask(const tracked_objects::Location& from_here,
base::OnceClosure task);
bool PostTask(const base::Location& from_here, base::OnceClosure task);

private:
explicit BlockingTaskRunner(
Expand Down
10 changes: 5 additions & 5 deletions chrome/browser/after_startup_task_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ using content::WebContentsObserver;
namespace {

struct AfterStartupTask {
AfterStartupTask(const tracked_objects::Location& from_here,
AfterStartupTask(const base::Location& from_here,
const scoped_refptr<base::TaskRunner>& task_runner,
base::OnceClosure task)
: from_here(from_here), task_runner(task_runner), task(std::move(task)) {}
~AfterStartupTask() {}

const tracked_objects::Location from_here;
const base::Location from_here;
const scoped_refptr<base::TaskRunner> task_runner;
base::OnceClosure task;
};
Expand Down Expand Up @@ -71,7 +71,7 @@ void ScheduleTask(std::unique_ptr<AfterStartupTask> queued_task) {
const int kMinDelaySec = 0;
const int kMaxDelaySec = 10;
scoped_refptr<base::TaskRunner> target_runner = queued_task->task_runner;
tracked_objects::Location from_here = queued_task->from_here;
base::Location from_here = queued_task->from_here;
target_runner->PostDelayedTask(
from_here, base::BindOnce(&RunTask, base::Passed(std::move(queued_task))),
base::TimeDelta::FromSeconds(base::RandInt(kMinDelaySec, kMaxDelaySec)));
Expand Down Expand Up @@ -215,7 +215,7 @@ AfterStartupTaskUtils::Runner::Runner(
AfterStartupTaskUtils::Runner::~Runner() = default;

bool AfterStartupTaskUtils::Runner::PostDelayedTask(
const tracked_objects::Location& from_here,
const base::Location& from_here,
base::OnceClosure task,
base::TimeDelta delay) {
DCHECK(delay.is_zero());
Expand All @@ -234,7 +234,7 @@ void AfterStartupTaskUtils::StartMonitoringStartup() {
}

void AfterStartupTaskUtils::PostTask(
const tracked_objects::Location& from_here,
const base::Location& from_here,
const scoped_refptr<base::TaskRunner>& destination_runner,
base::OnceClosure task) {
if (IsBrowserStartupComplete()) {
Expand Down
4 changes: 2 additions & 2 deletions chrome/browser/after_startup_task_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class AfterStartupTaskUtils {
explicit Runner(scoped_refptr<base::TaskRunner> destination_runner);

// Overrides from base::TaskRunner:
bool PostDelayedTask(const tracked_objects::Location& from_here,
bool PostDelayedTask(const base::Location& from_here,
base::OnceClosure task,
base::TimeDelta delay) override;
bool RunsTasksInCurrentSequence() const override;
Expand All @@ -45,7 +45,7 @@ class AfterStartupTaskUtils {
// for chrome. Tasks are queued until startup is complete.
// Note: see browser_thread.h
static void PostTask(
const tracked_objects::Location& from_here,
const base::Location& from_here,
const scoped_refptr<base::TaskRunner>& destination_runner,
base::OnceClosure task);

Expand Down
4 changes: 2 additions & 2 deletions chrome/browser/after_startup_task_utils_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class WrappedTaskRunner : public base::TaskRunner {
explicit WrappedTaskRunner(scoped_refptr<TaskRunner> real_runner)
: real_task_runner_(std::move(real_runner)) {}

bool PostDelayedTask(const tracked_objects::Location& from_here,
bool PostDelayedTask(const base::Location& from_here,
base::OnceClosure task,
base::TimeDelta delay) override {
++posted_task_count_;
Expand Down Expand Up @@ -91,7 +91,7 @@ class AfterStartupTaskTest : public testing::Test {

// Hop to the background sequence and call PostAfterStartupTask.
void PostAfterStartupTaskFromBackgroundSequence(
const tracked_objects::Location& from_here,
const base::Location& from_here,
scoped_refptr<base::TaskRunner> task_runner,
base::OnceClosure task) {
base::RunLoop run_loop;
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/android/vr_shell/vr_shell.cc
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ VrShell::~VrShell() {
g_instance = nullptr;
}

void VrShell::PostToGlThread(const tracked_objects::Location& from_here,
void VrShell::PostToGlThread(const base::Location& from_here,
const base::Closure& task) {
gl_thread_->message_loop()->task_runner()->PostTask(from_here, task);
}
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/android/vr_shell/vr_shell.h
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ class VrShell : device::GvrGamepadDataProvider,

private:
~VrShell() override;
void PostToGlThread(const tracked_objects::Location& from_here,
void PostToGlThread(const base::Location& from_here,
const base::Closure& task);
void SetUiState();

Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/chrome_content_browser_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -906,7 +906,7 @@ content::BrowserMainParts* ChromeContentBrowserClient::CreateBrowserMainParts(
}

void ChromeContentBrowserClient::PostAfterStartupTask(
const tracked_objects::Location& from_here,
const base::Location& from_here,
const scoped_refptr<base::TaskRunner>& task_runner,
base::OnceClosure task) {
AfterStartupTaskUtils::PostTask(from_here, task_runner, std::move(task));
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/chrome_content_browser_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient {

content::BrowserMainParts* CreateBrowserMainParts(
const content::MainFunctionParams& parameters) override;
void PostAfterStartupTask(const tracked_objects::Location& from_here,
void PostAfterStartupTask(const base::Location& from_here,
const scoped_refptr<base::TaskRunner>& task_runner,
base::OnceClosure task) override;
bool IsBrowserStartupComplete() override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const int kRetryLimit = 100;
void DBusBoolRedirectCallback(const base::Closure& on_true,
const base::Closure& on_false,
const base::Closure& on_failure,
const tracked_objects::Location& from_here,
const base::Location& from_here,
chromeos::DBusMethodCallStatus status,
bool value) {
if (status != chromeos::DBUS_METHOD_CALL_SUCCESS) {
Expand All @@ -76,7 +76,7 @@ void DBusBoolRedirectCallback(const base::Closure& on_true,
void DBusStringCallback(
const base::Callback<void(const std::string&)> on_success,
const base::Closure& on_failure,
const tracked_objects::Location& from_here,
const base::Location& from_here,
chromeos::DBusMethodCallStatus status,
bool result,
const std::string& data) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class FakeTaskRunner : public base::TaskRunner {

private:
// base::TaskRunner overrides.
bool PostDelayedTask(const tracked_objects::Location& from_here,
bool PostDelayedTask(const base::Location& from_here,
base::OnceClosure task,
base::TimeDelta delay) override {
std::move(task).Run();
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/chromeos/login/users/mock_user_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace {

class FakeTaskRunner : public base::TaskRunner {
public:
bool PostDelayedTask(const tracked_objects::Location& from_here,
bool PostDelayedTask(const base::Location& from_here,
base::OnceClosure task,
base::TimeDelta delay) override {
std::move(task).Run();
Expand Down
32 changes: 15 additions & 17 deletions chrome/browser/chromeos/platform_keys/platform_keys_nss.cc
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class NSSOperationState {

// Called if an error occurred during the execution of the NSS operation
// described by this object.
virtual void OnError(const tracked_objects::Location& from,
virtual void OnError(const base::Location& from,
const std::string& error_message) = 0;

crypto::ScopedPK11Slot slot_;
Expand Down Expand Up @@ -163,12 +163,12 @@ class GenerateRSAKeyState : public NSSOperationState {
const subtle::GenerateKeyCallback& callback);
~GenerateRSAKeyState() override {}

void OnError(const tracked_objects::Location& from,
void OnError(const base::Location& from,
const std::string& error_message) override {
CallBack(from, std::string() /* no public key */, error_message);
}

void CallBack(const tracked_objects::Location& from,
void CallBack(const base::Location& from,
const std::string& public_key_spki_der,
const std::string& error_message) {
origin_task_runner_->PostTask(
Expand All @@ -191,12 +191,12 @@ class SignRSAState : public NSSOperationState {
const subtle::SignCallback& callback);
~SignRSAState() override {}

void OnError(const tracked_objects::Location& from,
void OnError(const base::Location& from,
const std::string& error_message) override {
CallBack(from, std::string() /* no signature */, error_message);
}

void CallBack(const tracked_objects::Location& from,
void CallBack(const base::Location& from,
const std::string& signature,
const std::string& error_message) {
origin_task_runner_->PostTask(
Expand Down Expand Up @@ -232,13 +232,13 @@ class SelectCertificatesState : public NSSOperationState {
const subtle::SelectCertificatesCallback& callback);
~SelectCertificatesState() override {}

void OnError(const tracked_objects::Location& from,
void OnError(const base::Location& from,
const std::string& error_message) override {
CallBack(from, std::unique_ptr<net::CertificateList>() /* no matches */,
error_message);
}

void CallBack(const tracked_objects::Location& from,
void CallBack(const base::Location& from,
std::unique_ptr<net::CertificateList> matches,
const std::string& error_message) {
origin_task_runner_->PostTask(
Expand All @@ -260,14 +260,14 @@ class GetCertificatesState : public NSSOperationState {
explicit GetCertificatesState(const GetCertificatesCallback& callback);
~GetCertificatesState() override {}

void OnError(const tracked_objects::Location& from,
void OnError(const base::Location& from,
const std::string& error_message) override {
CallBack(from,
std::unique_ptr<net::CertificateList>() /* no certificates */,
error_message);
}

void CallBack(const tracked_objects::Location& from,
void CallBack(const base::Location& from,
std::unique_ptr<net::CertificateList> certs,
const std::string& error_message) {
origin_task_runner_->PostTask(
Expand All @@ -287,13 +287,12 @@ class ImportCertificateState : public NSSOperationState {
const ImportCertificateCallback& callback);
~ImportCertificateState() override {}

void OnError(const tracked_objects::Location& from,
void OnError(const base::Location& from,
const std::string& error_message) override {
CallBack(from, error_message);
}

void CallBack(const tracked_objects::Location& from,
const std::string& error_message) {
void CallBack(const base::Location& from, const std::string& error_message) {
origin_task_runner_->PostTask(from, base::Bind(callback_, error_message));
}

Expand All @@ -310,13 +309,12 @@ class RemoveCertificateState : public NSSOperationState {
const RemoveCertificateCallback& callback);
~RemoveCertificateState() override {}

void OnError(const tracked_objects::Location& from,
void OnError(const base::Location& from,
const std::string& error_message) override {
CallBack(from, error_message);
}

void CallBack(const tracked_objects::Location& from,
const std::string& error_message) {
void CallBack(const base::Location& from, const std::string& error_message) {
origin_task_runner_->PostTask(from, base::Bind(callback_, error_message));
}

Expand All @@ -332,14 +330,14 @@ class GetTokensState : public NSSOperationState {
explicit GetTokensState(const GetTokensCallback& callback);
~GetTokensState() override {}

void OnError(const tracked_objects::Location& from,
void OnError(const base::Location& from,
const std::string& error_message) override {
CallBack(from,
std::unique_ptr<std::vector<std::string>>() /* no token ids */,
error_message);
}

void CallBack(const tracked_objects::Location& from,
void CallBack(const base::Location& from,
std::unique_ptr<std::vector<std::string>> token_ids,
const std::string& error_message) {
origin_task_runner_->PostTask(
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/data_usage/tab_id_provider.cc
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class TabIdProvider::CallbackRunner {
};

TabIdProvider::TabIdProvider(base::TaskRunner* task_runner,
const tracked_objects::Location& from_here,
const base::Location& from_here,
const TabIdGetter& tab_id_getter)
: is_tab_info_ready_(false), tab_info_(-1), weak_ptr_factory_(this) {
std::unique_ptr<CallbackRunner> callback_runner(new CallbackRunner());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class MockSyncChangeProcessor : public syncer::SyncChangeProcessor {

// syncer::SyncChangeProcessor implementation.
syncer::SyncError ProcessSyncChanges(
const tracked_objects::Location& from_here,
const base::Location& from_here,
const syncer::SyncChangeList& change_list) override {
if (fail_all_requests_) {
return syncer::SyncError(
Expand Down Expand Up @@ -256,7 +256,7 @@ class ExtensionSettingsSyncTest : public testing::Test {
}

template <typename Func>
void PostOnBackendSequenceAndWait(const tracked_objects::Location& from_here,
void PostOnBackendSequenceAndWait(const base::Location& from_here,
Func func) {
GetBackendTaskRunner()->PostTask(
from_here, base::Bind(&ExtensionSettingsSyncTest::RunFunc<Func>, func));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ syncer::SyncMergeResult SyncStorageBackend::MergeDataAndStartSyncing(
}

syncer::SyncError SyncStorageBackend::ProcessSyncChanges(
const tracked_objects::Location& from_here,
const base::Location& from_here,
const syncer::SyncChangeList& sync_changes) {
DCHECK(IsOnBackendSequence());
DCHECK(sync_processor_.get());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class SyncStorageBackend : public syncer::SyncableService {
std::unique_ptr<syncer::SyncChangeProcessor> sync_processor,
std::unique_ptr<syncer::SyncErrorFactory> sync_error_factory) override;
syncer::SyncError ProcessSyncChanges(
const tracked_objects::Location& from_here,
const base::Location& from_here,
const syncer::SyncChangeList& change_list) override;
void StopSyncing(syncer::ModelType type) override;

Expand Down
Loading

0 comments on commit e1a7042

Please sign in to comment.