enabling network emulation in devtools
This commit is contained in:
parent
ab878c5f98
commit
a1e646f1b3
19 changed files with 1292 additions and 3 deletions
47
brightray/browser/net/devtools_network_protocol_handler.h
Normal file
47
brightray/browser/net/devtools_network_protocol_handler.h
Normal file
|
@ -0,0 +1,47 @@
|
|||
// 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/memory/scoped_ptr.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);
|
||||
|
||||
private:
|
||||
scoped_ptr<base::DictionaryValue> CanEmulateNetworkConditions(
|
||||
content::DevToolsAgentHost* agent_host,
|
||||
int command_id,
|
||||
const base::DictionaryValue* params);
|
||||
scoped_ptr<base::DictionaryValue> EmulateNetworkConditions(
|
||||
content::DevToolsAgentHost* agent_host,
|
||||
int command_id,
|
||||
const base::DictionaryValue* params);
|
||||
void UpdateNetworkState(
|
||||
content::DevToolsAgentHost* agent_host,
|
||||
scoped_ptr<DevToolsNetworkConditions> conditions);
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(DevToolsNetworkProtocolHandler);
|
||||
};
|
||||
|
||||
} // namespace brightray
|
||||
|
||||
#endif // BROWSER_DEVTOOLS_NETWORK_PROTOCOL_HANDLER_H_
|
Loading…
Add table
Add a link
Reference in a new issue