2015-09-26 18:19:27 +00:00
|
|
|
// Copyright 2014 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 BROWSER_DEVTOOLS_NETWORK_PROTOCOL_HANDLER_H_
|
|
|
|
#define BROWSER_DEVTOOLS_NETWORK_PROTOCOL_HANDLER_H_
|
|
|
|
|
|
|
|
#include "base/macros.h"
|
|
|
|
#include "base/values.h"
|
|
|
|
|
|
|
|
namespace content {
|
|
|
|
class DevToolsAgentHost;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace brightray {
|
|
|
|
|
|
|
|
class DevToolsNetworkConditions;
|
|
|
|
|
|
|
|
class DevToolsNetworkProtocolHandler {
|
|
|
|
public:
|
|
|
|
DevToolsNetworkProtocolHandler();
|
|
|
|
~DevToolsNetworkProtocolHandler();
|
|
|
|
|
|
|
|
base::DictionaryValue* HandleCommand(
|
|
|
|
content::DevToolsAgentHost* agent_host,
|
|
|
|
base::DictionaryValue* command);
|
2016-03-13 21:05:22 +00:00
|
|
|
void DevToolsAgentStateChanged(content::DevToolsAgentHost* agent_host,
|
|
|
|
bool attached);
|
2015-09-26 18:19:27 +00:00
|
|
|
|
|
|
|
private:
|
2016-05-23 01:59:07 +00:00
|
|
|
std::unique_ptr<base::DictionaryValue> CanEmulateNetworkConditions(
|
2015-09-26 18:19:27 +00:00
|
|
|
content::DevToolsAgentHost* agent_host,
|
|
|
|
int command_id,
|
|
|
|
const base::DictionaryValue* params);
|
2016-05-23 01:59:07 +00:00
|
|
|
std::unique_ptr<base::DictionaryValue> EmulateNetworkConditions(
|
2015-09-26 18:19:27 +00:00
|
|
|
content::DevToolsAgentHost* agent_host,
|
|
|
|
int command_id,
|
|
|
|
const base::DictionaryValue* params);
|
|
|
|
void UpdateNetworkState(
|
|
|
|
content::DevToolsAgentHost* agent_host,
|
2016-05-23 01:59:07 +00:00
|
|
|
std::unique_ptr<DevToolsNetworkConditions> conditions);
|
2015-09-26 18:19:27 +00:00
|
|
|
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(DevToolsNetworkProtocolHandler);
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace brightray
|
|
|
|
|
|
|
|
#endif // BROWSER_DEVTOOLS_NETWORK_PROTOCOL_HANDLER_H_
|