Commit 656dfe07 authored by Minggang Wang's avatar Minggang Wang Committed by Commit Bot

[OnionSoup] Add NotifyUpdateUserGestureCarryoverInfo() to ResourceLoadInfoNotifier interface

Currently, NotifyUpdateUserGestureCarryoverInfo() declared in
resource_load_stats.h is used to update information to determine whether
a user gesture should carryover to future navigations, when a request
is initiated.

This patch adds NotifyUpdateUserGestureCarryoverInfo() into
mojo interface ResourceLoadInfoNotifier for Android only to replace it.
Thus, we could call it inside Blink, which is part of OnionSoup
for loaders.

After this patch, all functions defined in resource_load_stats.h/cc
are removed and resource_load_stats.h/cc are deleted.

Bug: 1110032
Change-Id: I8a8eb6f71b827792332806c97dd4038e4be81ba8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2427154
Commit-Queue: Minggang Wang <minggang.wang@intel.com>
Reviewed-by: default avatarMakoto Shimazu <shimazu@chromium.org>
Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
Reviewed-by: default avatarHiroki Nakagawa <nhiroki@chromium.org>
Cr-Commit-Position: refs/heads/master@{#816583}
parent cc61c1e0
...@@ -91,8 +91,6 @@ target(link_target_type, "renderer") { ...@@ -91,8 +91,6 @@ target(link_target_type, "renderer") {
"loader/request_extra_data.h", "loader/request_extra_data.h",
"loader/resource_dispatcher.cc", "loader/resource_dispatcher.cc",
"loader/resource_dispatcher.h", "loader/resource_dispatcher.h",
"loader/resource_load_stats.cc",
"loader/resource_load_stats.h",
"loader/sync_load_context.cc", "loader/sync_load_context.cc",
"loader/sync_load_context.h", "loader/sync_load_context.h",
"loader/sync_load_response.cc", "loader/sync_load_response.cc",
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
#include "base/bind.h" #include "base/bind.h"
#include "base/macros.h" #include "base/macros.h"
#include "content/renderer/loader/resource_load_stats.h"
#include "content/renderer/loader/web_url_loader_impl.h" #include "content/renderer/loader/web_url_loader_impl.h"
#include "content/renderer/render_frame_impl.h" #include "content/renderer/render_frame_impl.h"
#include "services/network/public/cpp/url_loader_completion_status.h" #include "services/network/public/cpp/url_loader_completion_status.h"
......
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
#include "content/public/renderer/request_peer.h" #include "content/public/renderer/request_peer.h"
#include "content/public/renderer/resource_dispatcher_delegate.h" #include "content/public/renderer/resource_dispatcher_delegate.h"
#include "content/renderer/loader/request_extra_data.h" #include "content/renderer/loader/request_extra_data.h"
#include "content/renderer/loader/resource_load_stats.h"
#include "content/renderer/loader/sync_load_context.h" #include "content/renderer/loader/sync_load_context.h"
#include "content/renderer/loader/sync_load_response.h" #include "content/renderer/loader/sync_load_response.h"
#include "content/renderer/loader/url_loader_client_impl.h" #include "content/renderer/loader/url_loader_client_impl.h"
...@@ -518,7 +517,7 @@ int ResourceDispatcher::StartAsync( ...@@ -518,7 +517,7 @@ int ResourceDispatcher::StartAsync(
DCHECK(!(request->is_main_frame && DCHECK(!(request->is_main_frame &&
blink::IsRequestDestinationFrame(request->destination))); blink::IsRequestDestinationFrame(request->destination)));
if (request->has_user_gesture) { if (request->has_user_gesture) {
NotifyUpdateUserGestureCarryoverInfo(request->render_frame_id); resource_load_info_notifier_wrapper->NotifyUpdateUserGestureCarryoverInfo();
} }
#endif #endif
......
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "content/renderer/loader/resource_load_stats.h"
#include "base/bind.h"
#include "content/renderer/render_frame_impl.h"
#include "content/renderer/render_thread_impl.h"
namespace content {
namespace {
#if defined(OS_ANDROID)
void UpdateUserGestureCarryoverInfo(int render_frame_id) {
RenderFrameImpl* frame = RenderFrameImpl::FromRoutingID(render_frame_id);
if (frame)
frame->GetFrameHost()->UpdateUserGestureCarryoverInfo();
}
#endif
} // namespace
#if defined(OS_ANDROID)
void NotifyUpdateUserGestureCarryoverInfo(int render_frame_id) {
auto task_runner = RenderThreadImpl::DeprecatedGetMainTaskRunner();
if (!task_runner)
return;
if (task_runner->BelongsToCurrentThread()) {
UpdateUserGestureCarryoverInfo(render_frame_id);
return;
}
task_runner->PostTask(
FROM_HERE,
base::BindOnce(UpdateUserGestureCarryoverInfo, render_frame_id));
}
#endif
} // namespace content
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CONTENT_RENDERER_LOADER_RESOURCE_LOAD_STATS_H_
#define CONTENT_RENDERER_LOADER_RESOURCE_LOAD_STATS_H_
#include "build/build_config.h"
namespace content {
#if defined(OS_ANDROID)
void NotifyUpdateUserGestureCarryoverInfo(int render_frame_id);
#endif
} // namespace content
#endif // CONTENT_RENDERER_LOADER_RESOURCE_LOAD_STATS_H_
...@@ -3034,6 +3034,12 @@ void RenderFrameImpl::AddAutoplayFlags(const url::Origin& origin, ...@@ -3034,6 +3034,12 @@ void RenderFrameImpl::AddAutoplayFlags(const url::Origin& origin,
// blink::mojom::ResourceLoadInfoNotifier implementation // blink::mojom::ResourceLoadInfoNotifier implementation
// -------------------------- // --------------------------
#if defined(OS_ANDROID)
void RenderFrameImpl::NotifyUpdateUserGestureCarryoverInfo() {
GetFrameHost()->UpdateUserGestureCarryoverInfo();
}
#endif
void RenderFrameImpl::NotifyResourceRedirectReceived( void RenderFrameImpl::NotifyResourceRedirectReceived(
const net::RedirectInfo& redirect_info, const net::RedirectInfo& redirect_info,
network::mojom::URLResponseHeadPtr redirect_response) {} network::mojom::URLResponseHeadPtr redirect_response) {}
......
...@@ -460,6 +460,9 @@ class CONTENT_EXPORT RenderFrameImpl ...@@ -460,6 +460,9 @@ class CONTENT_EXPORT RenderFrameImpl
const int32_t flags) override; const int32_t flags) override;
// blink::mojom::ResourceLoadInfoNotifier implementation: // blink::mojom::ResourceLoadInfoNotifier implementation:
#if defined(OS_ANDROID)
void NotifyUpdateUserGestureCarryoverInfo() override;
#endif
void NotifyResourceRedirectReceived( void NotifyResourceRedirectReceived(
const net::RedirectInfo& redirect_info, const net::RedirectInfo& redirect_info,
network::mojom::URLResponseHeadPtr redirect_response) override; network::mojom::URLResponseHeadPtr redirect_response) override;
......
...@@ -12,6 +12,11 @@ import "url/mojom/url.mojom"; ...@@ -12,6 +12,11 @@ import "url/mojom/url.mojom";
// This interface is used to notify loading stats of the resource. // This interface is used to notify loading stats of the resource.
interface ResourceLoadInfoNotifier { interface ResourceLoadInfoNotifier {
// Called to update information to determine whether a user gesture should
// carryover to future navigations, when a request is initiated.
[EnableIf=is_android]
NotifyUpdateUserGestureCarryoverInfo();
// Called to notify the request has been redirected. // Called to notify the request has been redirected.
NotifyResourceRedirectReceived(network.mojom.URLRequestRedirectInfo redirect_info, NotifyResourceRedirectReceived(network.mojom.URLRequestRedirectInfo redirect_info,
network.mojom.URLResponseHead redirect_response); network.mojom.URLResponseHead redirect_response);
......
...@@ -34,14 +34,17 @@ class WeakWrapperResourceLoadInfoNotifier; ...@@ -34,14 +34,17 @@ class WeakWrapperResourceLoadInfoNotifier;
class BLINK_PLATFORM_EXPORT ResourceLoadInfoNotifierWrapper { class BLINK_PLATFORM_EXPORT ResourceLoadInfoNotifierWrapper {
public: public:
explicit ResourceLoadInfoNotifierWrapper( explicit ResourceLoadInfoNotifierWrapper(
base::WeakPtr<blink::WeakWrapperResourceLoadInfoNotifier> base::WeakPtr<WeakWrapperResourceLoadInfoNotifier>
weak_wrapper_resource_load_info_notifier); weak_wrapper_resource_load_info_notifier);
ResourceLoadInfoNotifierWrapper( ResourceLoadInfoNotifierWrapper(
base::WeakPtr<blink::WeakWrapperResourceLoadInfoNotifier> base::WeakPtr<WeakWrapperResourceLoadInfoNotifier>
weak_wrapper_resource_load_info_notifier, weak_wrapper_resource_load_info_notifier,
scoped_refptr<base::SingleThreadTaskRunner> task_runner); scoped_refptr<base::SingleThreadTaskRunner> task_runner);
~ResourceLoadInfoNotifierWrapper(); ~ResourceLoadInfoNotifierWrapper();
#if defined(OS_ANDROID)
void NotifyUpdateUserGestureCarryoverInfo();
#endif
void NotifyResourceLoadInitiated( void NotifyResourceLoadInitiated(
int64_t request_id, int64_t request_id,
const GURL& request_url, const GURL& request_url,
...@@ -65,13 +68,13 @@ class BLINK_PLATFORM_EXPORT ResourceLoadInfoNotifierWrapper { ...@@ -65,13 +68,13 @@ class BLINK_PLATFORM_EXPORT ResourceLoadInfoNotifierWrapper {
// |weak_wrapper_resource_load_info_notifier_| should only be dereferenced on // |weak_wrapper_resource_load_info_notifier_| should only be dereferenced on
// the same thread as |task_runner_| runs on. // the same thread as |task_runner_| runs on.
base::WeakPtr<blink::WeakWrapperResourceLoadInfoNotifier> base::WeakPtr<WeakWrapperResourceLoadInfoNotifier>
weak_wrapper_resource_load_info_notifier_; weak_wrapper_resource_load_info_notifier_;
scoped_refptr<base::SingleThreadTaskRunner> task_runner_; scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
// This struct holds the loading stats passed to // This struct holds the loading stats passed to
// |weak_wrapper_resource_load_info_notifier_|. // |weak_wrapper_resource_load_info_notifier_|.
blink::mojom::ResourceLoadInfoPtr resource_load_info_; mojom::ResourceLoadInfoPtr resource_load_info_;
}; };
} // namespace blink } // namespace blink
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include "base/threading/thread_checker.h" #include "base/threading/thread_checker.h"
#include "build/build_config.h"
#include "services/network/public/mojom/url_response_head.mojom-forward.h" #include "services/network/public/mojom/url_response_head.mojom-forward.h"
#include "third_party/blink/public/common/loader/previews_state.h" #include "third_party/blink/public/common/loader/previews_state.h"
#include "third_party/blink/public/mojom/loader/resource_load_info.mojom-forward.h" #include "third_party/blink/public/mojom/loader/resource_load_info.mojom-forward.h"
...@@ -26,6 +27,9 @@ class BLINK_PLATFORM_EXPORT WeakWrapperResourceLoadInfoNotifier ...@@ -26,6 +27,9 @@ class BLINK_PLATFORM_EXPORT WeakWrapperResourceLoadInfoNotifier
// blink::mojom::ResourceLoadInfoNotifier overrides, these methods should be // blink::mojom::ResourceLoadInfoNotifier overrides, these methods should be
// called from the same thread. // called from the same thread.
#if defined(OS_ANDROID)
void NotifyUpdateUserGestureCarryoverInfo() override;
#endif
void NotifyResourceRedirectReceived( void NotifyResourceRedirectReceived(
const net::RedirectInfo& redirect_info, const net::RedirectInfo& redirect_info,
network::mojom::URLResponseHeadPtr redirect_response) override; network::mojom::URLResponseHeadPtr redirect_response) override;
......
...@@ -20,14 +20,14 @@ ...@@ -20,14 +20,14 @@
namespace blink { namespace blink {
ResourceLoadInfoNotifierWrapper::ResourceLoadInfoNotifierWrapper( ResourceLoadInfoNotifierWrapper::ResourceLoadInfoNotifierWrapper(
base::WeakPtr<blink::WeakWrapperResourceLoadInfoNotifier> base::WeakPtr<WeakWrapperResourceLoadInfoNotifier>
weak_wrapper_resource_load_info_notifier) weak_wrapper_resource_load_info_notifier)
: ResourceLoadInfoNotifierWrapper( : ResourceLoadInfoNotifierWrapper(
std::move(weak_wrapper_resource_load_info_notifier), std::move(weak_wrapper_resource_load_info_notifier),
base::ThreadTaskRunnerHandle::Get()) {} base::ThreadTaskRunnerHandle::Get()) {}
ResourceLoadInfoNotifierWrapper::ResourceLoadInfoNotifierWrapper( ResourceLoadInfoNotifierWrapper::ResourceLoadInfoNotifierWrapper(
base::WeakPtr<blink::WeakWrapperResourceLoadInfoNotifier> base::WeakPtr<WeakWrapperResourceLoadInfoNotifier>
weak_wrapper_resource_load_info_notifier, weak_wrapper_resource_load_info_notifier,
scoped_refptr<base::SingleThreadTaskRunner> task_runner) scoped_refptr<base::SingleThreadTaskRunner> task_runner)
: weak_wrapper_resource_load_info_notifier_( : weak_wrapper_resource_load_info_notifier_(
...@@ -39,6 +39,23 @@ ResourceLoadInfoNotifierWrapper::ResourceLoadInfoNotifierWrapper( ...@@ -39,6 +39,23 @@ ResourceLoadInfoNotifierWrapper::ResourceLoadInfoNotifierWrapper(
ResourceLoadInfoNotifierWrapper::~ResourceLoadInfoNotifierWrapper() = default; ResourceLoadInfoNotifierWrapper::~ResourceLoadInfoNotifierWrapper() = default;
#if defined(OS_ANDROID)
void ResourceLoadInfoNotifierWrapper::NotifyUpdateUserGestureCarryoverInfo() {
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
if (task_runner_->BelongsToCurrentThread()) {
if (weak_wrapper_resource_load_info_notifier_) {
weak_wrapper_resource_load_info_notifier_
->NotifyUpdateUserGestureCarryoverInfo();
}
return;
}
task_runner_->PostTask(
FROM_HERE, base::BindOnce(&mojom::ResourceLoadInfoNotifier::
NotifyUpdateUserGestureCarryoverInfo,
weak_wrapper_resource_load_info_notifier_));
}
#endif
void ResourceLoadInfoNotifierWrapper::NotifyResourceLoadInitiated( void ResourceLoadInfoNotifierWrapper::NotifyResourceLoadInitiated(
int64_t request_id, int64_t request_id,
const GURL& request_url, const GURL& request_url,
...@@ -51,14 +68,14 @@ void ResourceLoadInfoNotifierWrapper::NotifyResourceLoadInitiated( ...@@ -51,14 +68,14 @@ void ResourceLoadInfoNotifierWrapper::NotifyResourceLoadInitiated(
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
DCHECK(!resource_load_info_); DCHECK(!resource_load_info_);
resource_load_info_ = blink::mojom::ResourceLoadInfo::New(); resource_load_info_ = mojom::ResourceLoadInfo::New();
resource_load_info_->method = http_method; resource_load_info_->method = http_method;
resource_load_info_->original_url = request_url; resource_load_info_->original_url = request_url;
resource_load_info_->final_url = request_url; resource_load_info_->final_url = request_url;
resource_load_info_->request_destination = request_destination; resource_load_info_->request_destination = request_destination;
resource_load_info_->request_id = request_id; resource_load_info_->request_id = request_id;
resource_load_info_->referrer = referrer; resource_load_info_->referrer = referrer;
resource_load_info_->network_info = blink::mojom::CommonNetworkInfo::New(); resource_load_info_->network_info = mojom::CommonNetworkInfo::New();
resource_load_info_->request_priority = request_priority; resource_load_info_->request_priority = request_priority;
} }
...@@ -70,15 +87,14 @@ void ResourceLoadInfoNotifierWrapper::NotifyResourceRedirectReceived( ...@@ -70,15 +87,14 @@ void ResourceLoadInfoNotifierWrapper::NotifyResourceRedirectReceived(
resource_load_info_->final_url = redirect_info.new_url; resource_load_info_->final_url = redirect_info.new_url;
resource_load_info_->method = redirect_info.new_method; resource_load_info_->method = redirect_info.new_method;
resource_load_info_->referrer = GURL(redirect_info.new_referrer); resource_load_info_->referrer = GURL(redirect_info.new_referrer);
blink::mojom::RedirectInfoPtr net_redirect_info = mojom::RedirectInfoPtr net_redirect_info = mojom::RedirectInfo::New();
blink::mojom::RedirectInfo::New();
net_redirect_info->origin_of_new_url = net_redirect_info->origin_of_new_url =
url::Origin::Create(redirect_info.new_url); url::Origin::Create(redirect_info.new_url);
net_redirect_info->network_info = blink::mojom::CommonNetworkInfo::New(); net_redirect_info->network_info = mojom::CommonNetworkInfo::New();
net_redirect_info->network_info->network_accessed = net_redirect_info->network_info->network_accessed =
redirect_response->network_accessed; redirect_response->network_accessed;
net_redirect_info->network_info->always_access_network = net_redirect_info->network_info->always_access_network =
blink::network_utils::AlwaysAccessNetwork(redirect_response->headers); network_utils::AlwaysAccessNetwork(redirect_response->headers);
net_redirect_info->network_info->remote_endpoint = net_redirect_info->network_info->remote_endpoint =
redirect_response->remote_endpoint; redirect_response->remote_endpoint;
resource_load_info_->redirect_info_chain.push_back( resource_load_info_->redirect_info_chain.push_back(
...@@ -107,7 +123,7 @@ void ResourceLoadInfoNotifierWrapper::NotifyResourceResponseReceived( ...@@ -107,7 +123,7 @@ void ResourceLoadInfoNotifierWrapper::NotifyResourceResponseReceived(
resource_load_info_->network_info->network_accessed = resource_load_info_->network_info->network_accessed =
response_head->network_accessed; response_head->network_accessed;
resource_load_info_->network_info->always_access_network = resource_load_info_->network_info->always_access_network =
blink::network_utils::AlwaysAccessNetwork(response_head->headers); network_utils::AlwaysAccessNetwork(response_head->headers);
resource_load_info_->network_info->remote_endpoint = resource_load_info_->network_info->remote_endpoint =
response_head->remote_endpoint; response_head->remote_endpoint;
...@@ -128,12 +144,12 @@ void ResourceLoadInfoNotifierWrapper::NotifyResourceResponseReceived( ...@@ -128,12 +144,12 @@ void ResourceLoadInfoNotifierWrapper::NotifyResourceResponseReceived(
} }
task_runner_->PostTask( task_runner_->PostTask(
FROM_HERE, FROM_HERE,
base::BindOnce(&blink::mojom::ResourceLoadInfoNotifier:: base::BindOnce(
NotifyResourceResponseReceived, &mojom::ResourceLoadInfoNotifier::NotifyResourceResponseReceived,
weak_wrapper_resource_load_info_notifier_, weak_wrapper_resource_load_info_notifier_,
resource_load_info_->request_id, resource_load_info_->request_id, resource_load_info_->final_url,
resource_load_info_->final_url, std::move(response_head), std::move(response_head), resource_load_info_->request_destination,
resource_load_info_->request_destination, previews_state)); previews_state));
} }
void ResourceLoadInfoNotifierWrapper::NotifyResourceTransferSizeUpdated( void ResourceLoadInfoNotifierWrapper::NotifyResourceTransferSizeUpdated(
...@@ -149,8 +165,8 @@ void ResourceLoadInfoNotifierWrapper::NotifyResourceTransferSizeUpdated( ...@@ -149,8 +165,8 @@ void ResourceLoadInfoNotifierWrapper::NotifyResourceTransferSizeUpdated(
} }
task_runner_->PostTask( task_runner_->PostTask(
FROM_HERE, FROM_HERE,
base::BindOnce(&blink::mojom::ResourceLoadInfoNotifier:: base::BindOnce(
NotifyResourceTransferSizeUpdated, &mojom::ResourceLoadInfoNotifier::NotifyResourceTransferSizeUpdated,
weak_wrapper_resource_load_info_notifier_, weak_wrapper_resource_load_info_notifier_,
resource_load_info_->request_id, transfer_size_diff)); resource_load_info_->request_id, transfer_size_diff));
} }
...@@ -158,9 +174,9 @@ void ResourceLoadInfoNotifierWrapper::NotifyResourceTransferSizeUpdated( ...@@ -158,9 +174,9 @@ void ResourceLoadInfoNotifierWrapper::NotifyResourceTransferSizeUpdated(
void ResourceLoadInfoNotifierWrapper::NotifyResourceLoadCompleted( void ResourceLoadInfoNotifierWrapper::NotifyResourceLoadCompleted(
const network::URLLoaderCompletionStatus& status) { const network::URLLoaderCompletionStatus& status) {
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
blink::RecordLoadHistograms( RecordLoadHistograms(url::Origin::Create(resource_load_info_->final_url),
url::Origin::Create(resource_load_info_->final_url), resource_load_info_->request_destination,
resource_load_info_->request_destination, status.error_code); status.error_code);
resource_load_info_->was_cached = status.exists_in_cache; resource_load_info_->was_cached = status.exists_in_cache;
resource_load_info_->net_error = status.error_code; resource_load_info_->net_error = status.error_code;
...@@ -177,7 +193,7 @@ void ResourceLoadInfoNotifierWrapper::NotifyResourceLoadCompleted( ...@@ -177,7 +193,7 @@ void ResourceLoadInfoNotifierWrapper::NotifyResourceLoadCompleted(
task_runner_->PostTask( task_runner_->PostTask(
FROM_HERE, FROM_HERE,
base::BindOnce( base::BindOnce(
&blink::mojom::ResourceLoadInfoNotifier::NotifyResourceLoadCompleted, &mojom::ResourceLoadInfoNotifier::NotifyResourceLoadCompleted,
weak_wrapper_resource_load_info_notifier_, weak_wrapper_resource_load_info_notifier_,
std::move(resource_load_info_), status)); std::move(resource_load_info_), status));
} }
...@@ -185,8 +201,7 @@ void ResourceLoadInfoNotifierWrapper::NotifyResourceLoadCompleted( ...@@ -185,8 +201,7 @@ void ResourceLoadInfoNotifierWrapper::NotifyResourceLoadCompleted(
void ResourceLoadInfoNotifierWrapper::NotifyResourceLoadCanceled( void ResourceLoadInfoNotifierWrapper::NotifyResourceLoadCanceled(
int net_error) { int net_error) {
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
blink::RecordLoadHistograms( RecordLoadHistograms(url::Origin::Create(resource_load_info_->final_url),
url::Origin::Create(resource_load_info_->final_url),
resource_load_info_->request_destination, net_error); resource_load_info_->request_destination, net_error);
if (task_runner_->BelongsToCurrentThread()) { if (task_runner_->BelongsToCurrentThread()) {
...@@ -199,7 +214,7 @@ void ResourceLoadInfoNotifierWrapper::NotifyResourceLoadCanceled( ...@@ -199,7 +214,7 @@ void ResourceLoadInfoNotifierWrapper::NotifyResourceLoadCanceled(
task_runner_->PostTask( task_runner_->PostTask(
FROM_HERE, FROM_HERE,
base::BindOnce( base::BindOnce(
&blink::mojom::ResourceLoadInfoNotifier::NotifyResourceLoadCanceled, &mojom::ResourceLoadInfoNotifier::NotifyResourceLoadCanceled,
weak_wrapper_resource_load_info_notifier_, weak_wrapper_resource_load_info_notifier_,
resource_load_info_->request_id)); resource_load_info_->request_id));
} }
......
...@@ -21,6 +21,14 @@ void WeakWrapperResourceLoadInfoNotifier::NotifyResourceRedirectReceived( ...@@ -21,6 +21,14 @@ void WeakWrapperResourceLoadInfoNotifier::NotifyResourceRedirectReceived(
redirect_info, std::move(redirect_response)); redirect_info, std::move(redirect_response));
} }
#if defined(OS_ANDROID)
void WeakWrapperResourceLoadInfoNotifier::
NotifyUpdateUserGestureCarryoverInfo() {
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
resource_load_info_notifier_->NotifyUpdateUserGestureCarryoverInfo();
}
#endif
void WeakWrapperResourceLoadInfoNotifier::NotifyResourceResponseReceived( void WeakWrapperResourceLoadInfoNotifier::NotifyResourceResponseReceived(
int64_t request_id, int64_t request_id,
const GURL& final_url, const GURL& final_url,
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include "base/test/scoped_feature_list.h" #include "base/test/scoped_feature_list.h"
#include "base/test/task_environment.h" #include "base/test/task_environment.h"
#include "build/build_config.h"
#include "mojo/public/cpp/bindings/remote.h" #include "mojo/public/cpp/bindings/remote.h"
#include "mojo/public/cpp/system/data_pipe_utils.h" #include "mojo/public/cpp/system/data_pipe_utils.h"
#include "net/http/http_util.h" #include "net/http/http_util.h"
...@@ -127,6 +128,9 @@ class WorkerMainScriptLoaderTest : public testing::Test { ...@@ -127,6 +128,9 @@ class WorkerMainScriptLoaderTest : public testing::Test {
const FakeResourceLoadInfoNotifier&) = delete; const FakeResourceLoadInfoNotifier&) = delete;
// blink::mojom::ResourceLoadInfoNotifier overrides. // blink::mojom::ResourceLoadInfoNotifier overrides.
#if defined(OS_ANDROID)
void NotifyUpdateUserGestureCarryoverInfo() override {}
#endif
void NotifyResourceRedirectReceived( void NotifyResourceRedirectReceived(
const net::RedirectInfo& redirect_info, const net::RedirectInfo& redirect_info,
network::mojom::URLResponseHeadPtr redirect_response) override {} network::mojom::URLResponseHeadPtr redirect_response) 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