Commit 7af49afa authored by Peter Kasting's avatar Peter Kasting Committed by Commit Bot

Add RenderProcessHost::BlockStateChangedCallback type alias.

This makes it easier to track down and/or change types.

Also renames CallbackList -> RepeatingCallbackList.

Bug: 1113007
Change-Id: Ib934071a88a991178dee8a99f722770f4e3f3957
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2354614Reviewed-by: default avatarAaron Colwell <acolwell@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Reviewed-by: default avatarNasko Oskov <nasko@chromium.org>
Reviewed-by: default avatarKen Buchanan <kenrb@chromium.org>
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#798495}
parent 5e101a15
......@@ -1315,7 +1315,8 @@ class CONTENT_EXPORT NavigationRequest
// The subscription to the notification of the changing of the render
// process's blocked state.
std::unique_ptr<base::CallbackList<void(bool)>::Subscription>
std::unique_ptr<
RenderProcessHost::BlockStateChangedCallbackList::Subscription>
render_process_blocked_state_changed_subscription_;
// The headers used for the request. The value of this comes from
......
......@@ -3763,9 +3763,9 @@ bool RenderProcessHostImpl::IsBlocked() {
return is_blocked_;
}
std::unique_ptr<base::CallbackList<void(bool)>::Subscription>
std::unique_ptr<RenderProcessHost::BlockStateChangedCallbackList::Subscription>
RenderProcessHostImpl::RegisterBlockStateChangedCallback(
const base::RepeatingCallback<void(bool)>& cb) {
const BlockStateChangedCallback& cb) {
return blocked_state_changed_callback_list_.Add(cb);
}
......
......@@ -213,7 +213,7 @@ class CONTENT_EXPORT RenderProcessHostImpl
bool IsBlocked() override;
std::unique_ptr<base::CallbackList<void(bool)>::Subscription>
RegisterBlockStateChangedCallback(
const base::RepeatingCallback<void(bool)>& cb) override;
const BlockStateChangedCallback& cb) override;
void Cleanup() override;
void AddPendingView() override;
void RemovePendingView() override;
......@@ -1107,7 +1107,7 @@ class CONTENT_EXPORT RenderProcessHostImpl
bool is_blocked_;
// The clients who want to know when the blocked state has changed.
base::CallbackList<void(bool)> blocked_state_changed_callback_list_;
BlockStateChangedCallbackList blocked_state_changed_callback_list_;
// Records the last time we regarded the child process active.
base::TimeTicks child_process_activity_time_;
......
......@@ -1246,7 +1246,8 @@ class CONTENT_EXPORT RenderWidgetHostImpl
base::OneShotTimer input_event_ack_timeout_;
base::TimeTicks input_event_ack_start_time_;
std::unique_ptr<base::CallbackList<void(bool)>::Subscription>
std::unique_ptr<
RenderProcessHost::BlockStateChangedCallbackList::Subscription>
render_process_blocked_state_changed_subscription_;
std::unique_ptr<TimeoutMonitor> new_content_rendering_timeout_;
......
......@@ -284,9 +284,10 @@ class CONTENT_EXPORT RenderProcessHost : public IPC::Sender,
virtual void SetBlocked(bool blocked) = 0;
virtual bool IsBlocked() = 0;
virtual std::unique_ptr<base::CallbackList<void(bool)>::Subscription>
RegisterBlockStateChangedCallback(
const base::RepeatingCallback<void(bool)>& cb) = 0;
using BlockStateChangedCallbackList = base::RepeatingCallbackList<void(bool)>;
using BlockStateChangedCallback = BlockStateChangedCallbackList::CallbackType;
virtual std::unique_ptr<BlockStateChangedCallbackList::Subscription>
RegisterBlockStateChangedCallback(const BlockStateChangedCallback& cb) = 0;
// Schedules the host for deletion and removes it from the all_hosts list.
virtual void Cleanup() = 0;
......
......@@ -261,9 +261,9 @@ bool MockRenderProcessHost::IsBlocked() {
return false;
}
std::unique_ptr<base::CallbackList<void(bool)>::Subscription>
std::unique_ptr<RenderProcessHost::BlockStateChangedCallbackList::Subscription>
MockRenderProcessHost::RegisterBlockStateChangedCallback(
const base::RepeatingCallback<void(bool)>& cb) {
const BlockStateChangedCallback& cb) {
return nullptr;
}
......
......@@ -112,9 +112,9 @@ class MockRenderProcessHost : public RenderProcessHost {
bool IsInitializedAndNotDead() override;
void SetBlocked(bool blocked) override;
bool IsBlocked() override;
std::unique_ptr<base::CallbackList<void(bool)>::Subscription>
std::unique_ptr<BlockStateChangedCallbackList::Subscription>
RegisterBlockStateChangedCallback(
const base::RepeatingCallback<void(bool)>& cb) override;
const BlockStateChangedCallback& cb) override;
void Cleanup() override;
void AddPendingView() override;
void RemovePendingView() override;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment