| Index: content/browser/content_resource_dispatcher_host.cc
|
| diff --git a/content/browser/content_resource_dispatcher_host.cc b/content/browser/content_resource_dispatcher_host.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..693a54a8147f4ad58f2386fac70e2672ed83e24a
|
| --- /dev/null
|
| +++ b/content/browser/content_resource_dispatcher_host.cc
|
| @@ -0,0 +1,56 @@
|
| +// Copyright 2016 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 "content/browser/content_resource_dispatcher_host.h"
|
| +
|
| +#include "base/logging.h"
|
| +#include "content/browser/loader/resource_dispatcher_host_impl.h"
|
| +
|
| +namespace content {
|
| +
|
| +namespace {
|
| +
|
| +static ContentResourceDispatcherHost* g_content_resource_dispatcher_host;
|
| +
|
| +} // namespace
|
| +
|
| +// static
|
| +ResourceDispatcherHost* ResourceDispatcherHost::Get() {
|
| + return g_content_resource_dispatcher_host;
|
| +}
|
| +
|
| +ContentResourceDispatcherHost::ContentResourceDispatcherHost()
|
| + : child_(nullptr),
|
| + content_resource_dispatcher_host_delegate_(
|
| + new ContentResourceDispatcherHostDelegate()) {
|
| + DCHECK(!g_content_resource_dispatcher_host);
|
| + g_content_resource_dispatcher_host = this;
|
| +}
|
| +
|
| +ContentResourceDispatcherHost::~ContentResourceDispatcherHost() {
|
| + DCHECK(g_content_resource_dispatcher_host);
|
| + g_content_resource_dispatcher_host = nullptr;
|
| +}
|
| +
|
| +void ContentResourceDispatcherHost::SetChild(
|
| + ResourceDispatcherHostImpl* child) {
|
| + child_ = child;
|
| +}
|
| +
|
| +void ContentResourceDispatcherHost::SetDelegate(
|
| + ResourceDispatcherHostDelegate* delegate) {
|
| + content_resource_dispatcher_host_delegate_->SetChild(delegate);
|
| + child_->SetDelegate(content_resource_dispatcher_host_delegate_.get());
|
| +}
|
| +
|
| +void ContentResourceDispatcherHost::SetAllowCrossOriginAuthPrompt(bool value) {
|
| + child_->SetAllowCrossOriginAuthPrompt(value);
|
| +}
|
| +
|
| +void ContentResourceDispatcherHost::ClearLoginDelegateForRequest(
|
| + net::URLRequest* request) {
|
| + child_->ClearLoginDelegateForRequest(request);
|
| +}
|
| +
|
| +} // namespace content
|
|
|