Merge pull request #185 from deepak1556/devtools_network_transaction_patch
devtools: exclude devtools related http header from serviceworker context
This commit is contained in:
commit
395a2eb1cc
3 changed files with 11 additions and 6 deletions
|
@ -15,13 +15,11 @@
|
||||||
|
|
||||||
namespace brightray {
|
namespace brightray {
|
||||||
|
|
||||||
namespace {
|
// static
|
||||||
|
const char
|
||||||
const char kDevToolsEmulateNetworkConditionsClientId[] =
|
DevToolsNetworkTransaction::kDevToolsEmulateNetworkConditionsClientId[] =
|
||||||
"X-DevTools-Emulate-Network-Conditions-Client-Id";
|
"X-DevTools-Emulate-Network-Conditions-Client-Id";
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
DevToolsNetworkTransaction::DevToolsNetworkTransaction(
|
DevToolsNetworkTransaction::DevToolsNetworkTransaction(
|
||||||
DevToolsNetworkController* controller,
|
DevToolsNetworkController* controller,
|
||||||
scoped_ptr<net::HttpTransaction> transaction)
|
scoped_ptr<net::HttpTransaction> transaction)
|
||||||
|
|
|
@ -22,6 +22,8 @@ class DevToolsNetworkInterceptor;
|
||||||
|
|
||||||
class DevToolsNetworkTransaction : public net::HttpTransaction {
|
class DevToolsNetworkTransaction : public net::HttpTransaction {
|
||||||
public:
|
public:
|
||||||
|
static const char kDevToolsEmulateNetworkConditionsClientId[];
|
||||||
|
|
||||||
DevToolsNetworkTransaction(
|
DevToolsNetworkTransaction(
|
||||||
DevToolsNetworkController* controller,
|
DevToolsNetworkController* controller,
|
||||||
scoped_ptr<net::HttpTransaction> network_transaction);
|
scoped_ptr<net::HttpTransaction> network_transaction);
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
#include "browser/net/devtools_network_controller.h"
|
#include "browser/net/devtools_network_controller.h"
|
||||||
#include "browser/net/devtools_network_transaction.h"
|
#include "browser/net/devtools_network_transaction.h"
|
||||||
|
|
||||||
|
#include "content/public/browser/service_worker_context.h"
|
||||||
#include "net/base/net_errors.h"
|
#include "net/base/net_errors.h"
|
||||||
#include "net/http/http_network_layer.h"
|
#include "net/http/http_network_layer.h"
|
||||||
#include "net/http/http_network_transaction.h"
|
#include "net/http/http_network_transaction.h"
|
||||||
|
@ -18,6 +19,10 @@ DevToolsNetworkTransactionFactory::DevToolsNetworkTransactionFactory(
|
||||||
net::HttpNetworkSession* session)
|
net::HttpNetworkSession* session)
|
||||||
: controller_(controller),
|
: controller_(controller),
|
||||||
network_layer_(new net::HttpNetworkLayer(session)) {
|
network_layer_(new net::HttpNetworkLayer(session)) {
|
||||||
|
std::set<std::string> headers;
|
||||||
|
headers.insert(
|
||||||
|
DevToolsNetworkTransaction::kDevToolsEmulateNetworkConditionsClientId);
|
||||||
|
content::ServiceWorkerContext::AddExcludedHeadersForFetchEvent(headers);
|
||||||
}
|
}
|
||||||
|
|
||||||
DevToolsNetworkTransactionFactory::~DevToolsNetworkTransactionFactory() {
|
DevToolsNetworkTransactionFactory::~DevToolsNetworkTransactionFactory() {
|
||||||
|
|
Loading…
Reference in a new issue