blob: 650841310cbe952f1121ffea04c6d9ba0497d4e7 [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 SERVICES_NETWORK_NETWORK_SERVICE_NETWORK_DELEGATE_H_
#define SERVICES_NETWORK_NETWORK_SERVICE_NETWORK_DELEGATE_H_
#include "base/component_export.h"
#include "base/macros.h"
#include "net/base/network_delegate_impl.h"
namespace network {
class NetworkContext;
class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkServiceNetworkDelegate
: public net::NetworkDelegateImpl {
public:
// |network_context| is guaranteed to outlive this class.
explicit NetworkServiceNetworkDelegate(NetworkContext* network_context);
private:
// net::NetworkDelegateImpl implementation.
bool OnCanGetCookies(const net::URLRequest& request,
const net::CookieList& cookie_list,
bool allowed_from_caller) override;
bool OnCanSetCookie(const net::URLRequest& request,
const net::CanonicalCookie& cookie,
net::CookieOptions* options,
bool allowed_from_caller) override;
bool OnCanAccessFile(const net::URLRequest& request,
const base::FilePath& original_path,
const base::FilePath& absolute_path) const override;
NetworkContext* network_context_;
DISALLOW_COPY_AND_ASSIGN(NetworkServiceNetworkDelegate);
};
} // namespace network
#endif // SERVICES_NETWORK_NETWORK_SERVICE_NETWORK_DELEGATE_H_