Commit 44dcfabf authored by Julie Jeongeun Kim's avatar Julie Jeongeun Kim Committed by Chromium LUCI CQ

Deprecate blink::mojom::ResourceType in PluginResponseInterceptorURLLoaderThrottle

This CL replaces blink::mojom::ResourceType with
network::mojom::RequestDestination in
PluginResponseInterceptorURLLoaderThrottle since
blink::mojom::ResourceType is deprecated[1].

It replaces |resource_type_| with |request_destination_| in
PluginResponseInterceptorURLLoaderThrottle and uses it to
check if the request is for the main frame.

[1] https://crbug.com/960143

Bug: 1059639
Change-Id: Id4e5803ea8bbbb35b0953773184e4ac86ec40d3b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2637121Reviewed-by: default avatarTommy Li <tommycli@chromium.org>
Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Julie Kim <jkim@igalia.com>
Cr-Commit-Position: refs/heads/master@{#845090}
parent 3d306ff0
......@@ -6061,6 +6061,7 @@ static_library("browser") {
"//ppapi/host",
"//ppapi/proxy:ipc",
"//services/device/public/mojom",
"//services/network/public/mojom",
]
if (is_chromeos_ash) {
deps += [ "//chromeos/cryptohome" ]
......
......@@ -4538,7 +4538,7 @@ ChromeContentBrowserClient::CreateURLLoaderThrottles(
#if BUILDFLAG(ENABLE_PLUGINS)
result.push_back(std::make_unique<PluginResponseInterceptorURLLoaderThrottle>(
request.resource_type, frame_tree_node_id));
request.destination, frame_tree_node_id));
#endif
auto delegate =
......
......@@ -24,13 +24,14 @@
#include "mojo/public/cpp/bindings/remote.h"
#include "mojo/public/cpp/system/data_pipe.h"
#include "services/network/public/mojom/url_response_head.mojom.h"
#include "third_party/blink/public/mojom/loader/resource_load_info.mojom-shared.h"
#include "third_party/blink/public/mojom/loader/transferrable_url_loader.mojom.h"
PluginResponseInterceptorURLLoaderThrottle::
PluginResponseInterceptorURLLoaderThrottle(int resource_type,
int frame_tree_node_id)
: resource_type_(resource_type), frame_tree_node_id_(frame_tree_node_id) {}
PluginResponseInterceptorURLLoaderThrottle(
network::mojom::RequestDestination request_destination,
int frame_tree_node_id)
: request_destination_(request_destination),
frame_tree_node_id_(frame_tree_node_id) {}
PluginResponseInterceptorURLLoaderThrottle::
~PluginResponseInterceptorURLLoaderThrottle() = default;
......@@ -123,8 +124,8 @@ void PluginResponseInterceptorURLLoaderThrottle::WillProcessResponse(
transferrable_loader->head = std::move(deep_copied_response);
transferrable_loader->head->intercepted_by_plugin = true;
bool embedded = resource_type_ !=
static_cast<int>(blink::mojom::ResourceType::kMainFrame);
bool embedded =
request_destination_ != network::mojom::RequestDestination::kDocument;
content::GetUIThreadTaskRunner({})->PostTask(
FROM_HERE,
base::BindOnce(
......
......@@ -9,6 +9,7 @@
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "services/network/public/mojom/fetch_api.mojom-shared.h"
#include "third_party/blink/public/common/loader/url_loader_throttle.h"
// Used to watch navigation responses to look for mime types that are handled by
......@@ -23,7 +24,7 @@ class PluginResponseInterceptorURLLoaderThrottle
: public blink::URLLoaderThrottle {
public:
PluginResponseInterceptorURLLoaderThrottle(
int resource_type,
network::mojom::RequestDestination request_destination,
int frame_tree_node_id);
~PluginResponseInterceptorURLLoaderThrottle() override;
......@@ -36,7 +37,7 @@ class PluginResponseInterceptorURLLoaderThrottle
// layer chance to initialize its browser side state.
void ResumeLoad();
const int resource_type_;
const network::mojom::RequestDestination request_destination_;
const int frame_tree_node_id_;
base::WeakPtrFactory<PluginResponseInterceptorURLLoaderThrottle>
......
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