2015-09-26 18:19:27 +00:00
|
|
|
// Copyright (c) 2015 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-CHROMIUM file.
|
|
|
|
|
2017-05-18 22:05:25 +00:00
|
|
|
#ifndef BRIGHTRAY_BROWSER_NET_DEVTOOLS_NETWORK_CONTROLLER_H_
|
|
|
|
#define BRIGHTRAY_BROWSER_NET_DEVTOOLS_NETWORK_CONTROLLER_H_
|
2015-09-26 18:19:27 +00:00
|
|
|
|
2017-04-04 04:26:50 +00:00
|
|
|
#include <memory>
|
|
|
|
#include <string>
|
2017-05-18 22:29:22 +00:00
|
|
|
#include <unordered_map>
|
2017-04-04 04:26:50 +00:00
|
|
|
|
2015-09-26 18:19:27 +00:00
|
|
|
#include "base/macros.h"
|
2017-04-04 04:26:50 +00:00
|
|
|
#include "base/threading/thread_checker.h"
|
2015-09-26 18:19:27 +00:00
|
|
|
|
|
|
|
namespace brightray {
|
|
|
|
|
|
|
|
class DevToolsNetworkConditions;
|
|
|
|
class DevToolsNetworkInterceptor;
|
|
|
|
class DevToolsNetworkTransaction;
|
|
|
|
|
|
|
|
class DevToolsNetworkController {
|
|
|
|
public:
|
|
|
|
DevToolsNetworkController();
|
|
|
|
virtual ~DevToolsNetworkController();
|
|
|
|
|
|
|
|
void SetNetworkState(const std::string& client_id,
|
2016-05-23 01:59:07 +00:00
|
|
|
std::unique_ptr<DevToolsNetworkConditions> conditions);
|
2017-04-04 04:26:50 +00:00
|
|
|
|
2016-03-13 21:05:22 +00:00
|
|
|
DevToolsNetworkInterceptor* GetInterceptor(const std::string& client_id);
|
2015-09-26 18:19:27 +00:00
|
|
|
|
|
|
|
private:
|
2017-03-23 22:47:30 +00:00
|
|
|
using InterceptorMap =
|
2017-04-04 04:26:50 +00:00
|
|
|
std::unordered_map<std::string,
|
|
|
|
std::unique_ptr<DevToolsNetworkInterceptor>>;
|
2016-03-13 21:05:22 +00:00
|
|
|
|
2016-05-23 01:59:07 +00:00
|
|
|
std::unique_ptr<DevToolsNetworkInterceptor> appcache_interceptor_;
|
2015-09-26 18:19:27 +00:00
|
|
|
InterceptorMap interceptors_;
|
|
|
|
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(DevToolsNetworkController);
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace brightray
|
|
|
|
|
2017-05-18 22:05:25 +00:00
|
|
|
#endif // BRIGHTRAY_BROWSER_NET_DEVTOOLS_NETWORK_CONTROLLER_H_
|