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.
|
|
|
|
|
|
|
|
#include "atom/browser/loader/layered_resource_handler.h"
|
|
|
|
|
|
|
|
namespace atom {
|
|
|
|
|
|
|
|
LayeredResourceHandler::LayeredResourceHandler(
|
|
|
|
net::URLRequest* request,
|
|
|
|
std::unique_ptr<content::ResourceHandler> next_handler,
|
|
|
|
Delegate* delegate)
|
|
|
|
: content::LayeredResourceHandler(request, std::move(next_handler)),
|
|
|
|
delegate_(delegate) {}
|
|
|
|
|
|
|
|
LayeredResourceHandler::~LayeredResourceHandler() {}
|
|
|
|
|
2017-04-11 05:58:42 +00:00
|
|
|
void LayeredResourceHandler::OnResponseStarted(
|
2017-02-27 06:10:49 +00:00
|
|
|
content::ResourceResponse* response,
|
2017-04-11 05:58:42 +00:00
|
|
|
std::unique_ptr<content::ResourceController> controller) {
|
2017-02-27 06:10:49 +00:00
|
|
|
if (delegate_)
|
|
|
|
delegate_->OnResponseStarted(response);
|
2017-04-11 05:58:42 +00:00
|
|
|
next_handler_->OnResponseStarted(response, std::move(controller));
|
2017-02-27 06:10:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace atom
|