-
Notifications
You must be signed in to change notification settings - Fork 893
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19222 from brave/issues/31524
Queue ad events until ads library is initialized.
- Loading branch information
Showing
18 changed files
with
535 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
components/brave_ads/core/internal/ads_client_notifier_queue.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* Copyright (c) 2023 The Brave Authors. All rights reserved. | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at https://mozilla.org/MPL/2.0/. */ | ||
|
||
#include "brave/components/brave_ads/core/internal/ads_client_notifier_queue.h" | ||
|
||
#include <utility> | ||
|
||
namespace brave_ads { | ||
|
||
AdsClientNotifierQueue::AdsClientNotifierQueue() = default; | ||
|
||
AdsClientNotifierQueue::~AdsClientNotifierQueue() = default; | ||
|
||
void AdsClientNotifierQueue::Add(base::OnceClosure notifier) { | ||
queue_.push(std::move(notifier)); | ||
} | ||
|
||
void AdsClientNotifierQueue::Process() { | ||
while (!queue_.empty()) { | ||
std::move(queue_.front()).Run(); | ||
queue_.pop(); | ||
} | ||
} | ||
|
||
} // namespace brave_ads |
Oops, something went wrong.