blob: 897f8e4abfd66f30ae8001ac689ac7a3f3d23ba4 [file] [log] [blame]
// Copyright 2018 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 <string>
#include "base/macros.h"
#include "content/public/common/url_loader_throttle.h"
namespace content {
class ResourceContext;
// Used to watch navigation responses to look for mime types that are handled by
// extensions. When it finds such a response, it will intercept it by extracting
// the URLLoader interface pointer. It will create a random string and send that
// to the extension which handles the mime type. It will also write that string
// into the object tag for the plugin, which will cause the pepper plugin to
// make a request for that URL. The renderer would have gotten a
// TransferrableURLLoader that allows it to map from that URL to the original
// URLLoader interface pointer.
class PluginResponseInterceptorURLLoaderThrottle
: public content::URLLoaderThrottle {
content::ResourceContext* resource_context,
int resource_type,
int frame_tree_node_id);
~PluginResponseInterceptorURLLoaderThrottle() override;
// content::URLLoaderThrottle overrides;
void WillProcessResponse(const GURL& response_url,
network::ResourceResponseHead* response_head,
bool* defer) override;
content::ResourceContext* const resource_context_;
const int resource_type_;
const int frame_tree_node_id_;