Commit 70fbaadf authored by eustas@chromium.org's avatar eustas@chromium.org

DevTools: make network conditions emulation scoped (blink)

BUG=245436

Review URL: https://codereview.chromium.org/347513004

git-svn-id: svn://svn.chromium.org/blink/trunk@176422 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 3e4802b9
...@@ -82,6 +82,7 @@ namespace { ...@@ -82,6 +82,7 @@ namespace {
// Keep in sync with kDevToolsRequestInitiator defined in devtools_network_controller.cc // Keep in sync with kDevToolsRequestInitiator defined in devtools_network_controller.cc
const char kDevToolsRequestInitiator[] = "X-DevTools-Request-Initiator"; const char kDevToolsRequestInitiator[] = "X-DevTools-Request-Initiator";
const char kDevToolsEmulateNetworkConditionsClientId[] = "X-DevTools-Emulate-Network-Conditions-Client-Id";
static PassRefPtr<JSONObject> buildObjectForHeaders(const HTTPHeaderMap& headers) static PassRefPtr<JSONObject> buildObjectForHeaders(const HTTPHeaderMap& headers)
{ {
...@@ -298,6 +299,10 @@ void InspectorResourceAgent::willSendRequest(unsigned long identifier, DocumentL ...@@ -298,6 +299,10 @@ void InspectorResourceAgent::willSendRequest(unsigned long identifier, DocumentL
// Ignore the request initiated internally. // Ignore the request initiated internally.
if (initiatorInfo.name == FetchInitiatorTypeNames::internal) if (initiatorInfo.name == FetchInitiatorTypeNames::internal)
return; return;
if (!m_hostId.isEmpty())
request.addHTTPHeaderField(kDevToolsEmulateNetworkConditionsClientId, AtomicString(m_hostId));
String requestId = IdentifiersFactory::requestId(identifier); String requestId = IdentifiersFactory::requestId(identifier);
m_resourcesData->resourceCreated(requestId, m_pageAgent->loaderId(loader)); m_resourcesData->resourceCreated(requestId, m_pageAgent->loaderId(loader));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment