blob: 7a8a54f9f3b7969281a99ba5890300a8462e40a8 [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.
#ifndef CHROMECAST_BROWSER_EXTENION_REQUEST_PROTOCOL_HANDLER_H_
#define CHROMECAST_BROWSER_EXTENION_REQUEST_PROTOCOL_HANDLER_H_
#include "net/url_request/url_request_job_factory.h"
namespace content {
class BrowserContext;
} // namespace content
namespace extensions {
class InfoMap;
}
namespace chromecast {
class ExtensionRequestProtocolHandler
: public net::URLRequestJobFactory::ProtocolHandler {
public:
explicit ExtensionRequestProtocolHandler(
content::BrowserContext* browser_context);
~ExtensionRequestProtocolHandler() override;
net::URLRequestJob* MaybeCreateJob(
net::URLRequest* request,
net::NetworkDelegate* network_delegate) const override;
private:
content::BrowserContext* const browser_context_;
mutable const extensions::InfoMap* info_map_ = nullptr;
mutable std::unique_ptr<net::URLRequestJobFactory::ProtocolHandler>
default_handler_;
};
} // namespace chromecast
#endif // CHROMECAST_BROWSER_EXTENION_REQUEST_PROTOCOL_HANDLER_H_