2017-02-27 06:10:49 +00:00
|
|
|
// Copyright (c) 2017 GitHub, Inc.
|
|
|
|
// Use of this source code is governed by the MIT license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
|
|
|
#ifndef ATOM_BROWSER_LOADER_LAYERED_RESOURCE_HANDLER_H_
|
|
|
|
#define ATOM_BROWSER_LOADER_LAYERED_RESOURCE_HANDLER_H_
|
|
|
|
|
2018-09-13 00:25:56 +00:00
|
|
|
#include <memory>
|
|
|
|
|
2019-03-05 05:08:55 +00:00
|
|
|
#include "content/browser/loader/layered_resource_handler.h" // nogncheck
|
2018-04-11 10:45:42 +00:00
|
|
|
#include "services/network/public/cpp/resource_response.h"
|
2017-02-27 06:10:49 +00:00
|
|
|
|
|
|
|
namespace atom {
|
|
|
|
|
|
|
|
// Resource handler that notifies on various stages of a resource request.
|
|
|
|
class LayeredResourceHandler : public content::LayeredResourceHandler {
|
|
|
|
public:
|
|
|
|
class Delegate {
|
|
|
|
public:
|
|
|
|
Delegate() {}
|
|
|
|
virtual ~Delegate() {}
|
|
|
|
|
2018-04-11 10:45:42 +00:00
|
|
|
virtual void OnResponseStarted(network::ResourceResponse* response) = 0;
|
2017-02-27 06:10:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
LayeredResourceHandler(net::URLRequest* request,
|
|
|
|
std::unique_ptr<content::ResourceHandler> next_handler,
|
|
|
|
Delegate* delegate);
|
|
|
|
~LayeredResourceHandler() override;
|
|
|
|
|
|
|
|
// content::LayeredResourceHandler:
|
2017-04-11 05:58:42 +00:00
|
|
|
void OnResponseStarted(
|
2018-04-11 10:45:42 +00:00
|
|
|
network::ResourceResponse* response,
|
2017-04-11 05:58:42 +00:00
|
|
|
std::unique_ptr<content::ResourceController> controller) override;
|
2017-02-27 06:10:49 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
Delegate* delegate_;
|
|
|
|
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(LayeredResourceHandler);
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace atom
|
|
|
|
|
|
|
|
#endif // ATOM_BROWSER_LOADER_LAYERED_RESOURCE_HANDLER_H_
|