electron/atom/browser/loader/layered_resource_handler.cc

30 lines
876 B
C++
Raw Normal View History

// 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"
#include <memory>
#include <utility>
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(
network::ResourceResponse* response,
2017-04-11 05:58:42 +00:00
std::unique_ptr<content::ResourceController> controller) {
if (delegate_)
delegate_->OnResponseStarted(response);
2017-04-11 05:58:42 +00:00
next_handler_->OnResponseStarted(response, std::move(controller));
}
} // namespace atom