Skip to content

Commit

Permalink
Remove X-DevTools-Request ID
Browse files Browse the repository at this point in the history
We no longer need this.

BUG=546953

Review-Url: https://codereview.chromium.org/2872513003
Cr-Commit-Position: refs/heads/master@{#470077}
  • Loading branch information
alexclarke authored and Commit bot committed May 8, 2017
1 parent 015a085 commit 8d71c3f
Show file tree
Hide file tree
Showing 8 changed files with 3 additions and 32 deletions.
5 changes: 0 additions & 5 deletions chrome/browser/devtools/devtools_network_transaction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ const char
DevToolsNetworkTransaction::kDevToolsEmulateNetworkConditionsClientId[] =
"X-DevTools-Emulate-Network-Conditions-Client-Id";

// Keep in sync with X_DevTools_Request_Id defined in HTTPNames.json5.
const char DevToolsNetworkTransaction::kDevToolsRequestId[] =
"X-DevTools-Request-Id";

DevToolsNetworkTransaction::DevToolsNetworkTransaction(
DevToolsNetworkController* controller,
std::unique_ptr<net::HttpTransaction> network_transaction)
Expand Down Expand Up @@ -127,7 +123,6 @@ int DevToolsNetworkTransaction::Start(const net::HttpRequestInfo* request,
kDevToolsEmulateNetworkConditionsClientId, &client_id);
custom_request_->extra_headers.RemoveHeader(
kDevToolsEmulateNetworkConditionsClientId);
custom_request_->extra_headers.RemoveHeader(kDevToolsRequestId);

if (request_->upload_data_stream) {
custom_upload_data_stream_.reset(
Expand Down
1 change: 0 additions & 1 deletion chrome/browser/devtools/devtools_network_transaction.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ class DevToolsNetworkTransaction
: public net::HttpTransaction {
public:
static const char kDevToolsEmulateNetworkConditionsClientId[];
static const char kDevToolsRequestId[];

DevToolsNetworkTransaction(
DevToolsNetworkController* controller,
Expand Down
6 changes: 0 additions & 6 deletions headless/public/util/generic_url_request_job.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ bool IsMethodSafe(const std::string& method) {
method == "TRACE";
}

// Keep in sync with X_DevTools_Request_Id defined in HTTPNames.json5.
const char kDevtoolsRequestId[] = "X-DevTools-Request-Id";

} // namespace

uint64_t GenericURLRequestJob::next_request_id_ = 0;
Expand Down Expand Up @@ -66,9 +63,6 @@ void GenericURLRequestJob::SetExtraRequestHeaders(
const net::HttpRequestHeaders& headers) {
DCHECK(origin_task_runner_->RunsTasksOnCurrentThread());
extra_request_headers_ = headers;

// TODO(alexclarke): Remove kDevtoolsRequestId
extra_request_headers_.RemoveHeader(kDevtoolsRequestId);
}

void GenericURLRequestJob::Start() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -703,10 +703,6 @@ void InspectorNetworkAgent::WillSendRequest(
request.AddHTTPHeaderField(
HTTPNames::X_DevTools_Emulate_Network_Conditions_Client_Id,
AtomicString(host_id_));

request.SetHTTPHeaderField(
HTTPNames::X_DevTools_Request_Id,
AtomicString(IdentifiersFactory::RequestId(identifier)));
}

void InspectorNetworkAgent::MarkResourceAsCached(unsigned long identifier) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ bool FetchUtils::IsSimpleHeader(const AtomicString& name,
EqualIgnoringASCIICase(name, "content-language") ||
EqualIgnoringASCIICase(
name, HTTPNames::X_DevTools_Emulate_Network_Conditions_Client_Id) ||
EqualIgnoringASCIICase(name, HTTPNames::X_DevTools_Request_Id) ||
EqualIgnoringASCIICase(name, "save-data"))
return true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,12 +250,9 @@ static bool ShouldIgnoreHeaderForCacheReuse(AtomicString header_name) {
// isn't complete.
DEFINE_STATIC_LOCAL(
HashSet<AtomicString>, headers,
({
"Cache-Control", "If-Modified-Since", "If-None-Match", "Origin",
"Pragma", "Purpose", "Referer", "User-Agent",
HTTPNames::X_DevTools_Emulate_Network_Conditions_Client_Id,
HTTPNames::X_DevTools_Request_Id,
}));
({"Cache-Control", "If-Modified-Since", "If-None-Match", "Origin",
"Pragma", "Purpose", "Referer", "User-Agent",
HTTPNames::X_DevTools_Emulate_Network_Conditions_Client_Id}));
return headers.Contains(header_name);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -587,12 +587,4 @@ TEST_F(RawResourceTest,
FetchInitiatorInfo())));
}

TEST_F(RawResourceTest, CanReuseDevToolsRequestIdHeader) {
ResourceRequest request("data:text/html,");
request.SetHTTPHeaderField(HTTPNames::X_DevTools_Request_Id, "12345");
Resource* raw = RawResource::Create(request, Resource::kRaw);
EXPECT_TRUE(raw->CanReuse(FetchParameters(ResourceRequest("data:text/html,"),
FetchInitiatorInfo())));
}

} // namespace blink
1 change: 0 additions & 1 deletion third_party/WebKit/Source/platform/network/HTTPNames.json5
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
"X-Content-Type-Options",
"X-DNS-Prefetch-Control",
"X-DevTools-Emulate-Network-Conditions-Client-Id",
"X-DevTools-Request-Id",
"X-Frame-Options",
"X-SourceMap",
"X-XSS-Protection",
Expand Down

0 comments on commit 8d71c3f

Please sign in to comment.