Commit 7bf92606 authored by donnd's avatar donnd Committed by Commit bot

Update NavigationHandleImpl#GetResponseHeaders method.

Now GetResponseHeaders won't check the navigation state, instead it will just return a nullptr if there are no response headers available.
In some cases the response headers are not available, but in the previous code there's no safe way to know that.
This removes the CHECK for the navigation state that was causing this problem.

BUG=526291
CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_site_isolation

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

Cr-Commit-Position: refs/heads/master@{#374747}
parent c4ba17c5
......@@ -170,9 +170,6 @@ bool NavigationHandleImpl::IsSamePage() {
}
const net::HttpResponseHeaders* NavigationHandleImpl::GetResponseHeaders() {
DCHECK(state_ >= WILL_REDIRECT_REQUEST)
<< "This accessor should only be called when the request encountered a "
"redirect or received a response";
return response_headers_.get();
}
......
......@@ -114,10 +114,10 @@ class CONTENT_EXPORT NavigationHandleImpl : public NavigationHandle {
NavigatorDelegate* GetDelegate() const;
// Returns the response headers for the request. This can only be accessed
// after a redirect was encountered or after the the navigation is ready to
// commit. It should not be modified, as modifications will not be reflected
// in the network stack.
// Returns the response headers for the request or nullptr if there are none.
// This should only be accessed after a redirect was encountered or after the
// navigation is ready to commit. The headers returned should not be modified,
// as modifications will not be reflected in the network stack.
const net::HttpResponseHeaders* GetResponseHeaders();
void set_net_error_code(net::Error net_error_code) {
......
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