Commit a954e94f authored by carlosk's avatar carlosk Committed by Commit bot

Rename NavigationHandle::GetRequestContextType to request_context_type.

At some point during discussions of the browser side mixed-content move
patch (https://crrev.com/1905033002) it was suggested that this getter
was doing just a simple value return and so it should be renamed
accordingly. This spin off change does that.

BUG=576270
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation

Review-Url: https://codereview.chromium.org/2577583002
Cr-Commit-Position: refs/heads/master@{#438905}
parent 2eb89f84
...@@ -140,11 +140,6 @@ NavigatorDelegate* NavigationHandleImpl::GetDelegate() const { ...@@ -140,11 +140,6 @@ NavigatorDelegate* NavigationHandleImpl::GetDelegate() const {
return frame_tree_node_->navigator()->GetDelegate(); return frame_tree_node_->navigator()->GetDelegate();
} }
RequestContextType NavigationHandleImpl::GetRequestContextType() const {
DCHECK_GE(state_, WILL_SEND_REQUEST);
return request_context_type_;
}
const GURL& NavigationHandleImpl::GetURL() { const GURL& NavigationHandleImpl::GetURL() {
return url_; return url_;
} }
......
...@@ -150,7 +150,10 @@ class CONTENT_EXPORT NavigationHandleImpl : public NavigationHandle { ...@@ -150,7 +150,10 @@ class CONTENT_EXPORT NavigationHandleImpl : public NavigationHandle {
// expose the NavigationHandle when navigating to an InterstialPage. // expose the NavigationHandle when navigating to an InterstialPage.
NavigatorDelegate* GetDelegate() const; NavigatorDelegate* GetDelegate() const;
RequestContextType GetRequestContextType() const; RequestContextType request_context_type() const {
DCHECK_GE(state_, WILL_SEND_REQUEST);
return request_context_type_;
}
// Get the unique id from the NavigationEntry associated with this // Get the unique id from the NavigationEntry associated with this
// NavigationHandle. Note that a synchronous, renderer-initiated navigation // NavigationHandle. Note that a synchronous, renderer-initiated navigation
......
...@@ -150,8 +150,8 @@ class TestNavigationThrottle : public NavigationThrottle { ...@@ -150,8 +150,8 @@ class TestNavigationThrottle : public NavigationThrottle {
NavigationHandleImpl* navigation_handle_impl = NavigationHandleImpl* navigation_handle_impl =
static_cast<NavigationHandleImpl*>(navigation_handle()); static_cast<NavigationHandleImpl*>(navigation_handle());
CHECK_NE(REQUEST_CONTEXT_TYPE_UNSPECIFIED, CHECK_NE(REQUEST_CONTEXT_TYPE_UNSPECIFIED,
navigation_handle_impl->GetRequestContextType()); navigation_handle_impl->request_context_type());
request_context_type_ = navigation_handle_impl->GetRequestContextType(); request_context_type_ = navigation_handle_impl->request_context_type();
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, did_call_will_start_); BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, did_call_will_start_);
return will_start_result_; return will_start_result_;
...@@ -161,7 +161,7 @@ class TestNavigationThrottle : public NavigationThrottle { ...@@ -161,7 +161,7 @@ class TestNavigationThrottle : public NavigationThrottle {
NavigationHandleImpl* navigation_handle_impl = NavigationHandleImpl* navigation_handle_impl =
static_cast<NavigationHandleImpl*>(navigation_handle()); static_cast<NavigationHandleImpl*>(navigation_handle());
CHECK_EQ(request_context_type_, CHECK_EQ(request_context_type_,
navigation_handle_impl->GetRequestContextType()); navigation_handle_impl->request_context_type());
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
did_call_will_redirect_); did_call_will_redirect_);
...@@ -172,7 +172,7 @@ class TestNavigationThrottle : public NavigationThrottle { ...@@ -172,7 +172,7 @@ class TestNavigationThrottle : public NavigationThrottle {
NavigationHandleImpl* navigation_handle_impl = NavigationHandleImpl* navigation_handle_impl =
static_cast<NavigationHandleImpl*>(navigation_handle()); static_cast<NavigationHandleImpl*>(navigation_handle());
CHECK_EQ(request_context_type_, CHECK_EQ(request_context_type_,
navigation_handle_impl->GetRequestContextType()); navigation_handle_impl->request_context_type());
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
did_call_will_process_); did_call_will_process_);
......
...@@ -197,21 +197,21 @@ class NavigationHandleImplTest : public RenderViewHostImplTestHarness { ...@@ -197,21 +197,21 @@ class NavigationHandleImplTest : public RenderViewHostImplTestHarness {
TEST_F(NavigationHandleImplTest, SimpleDataChecks) { TEST_F(NavigationHandleImplTest, SimpleDataChecks) {
SimulateWillStartRequest(); SimulateWillStartRequest();
EXPECT_EQ(REQUEST_CONTEXT_TYPE_LOCATION, EXPECT_EQ(REQUEST_CONTEXT_TYPE_LOCATION,
test_handle()->GetRequestContextType()); test_handle()->request_context_type());
EXPECT_EQ(net::HttpResponseInfo::CONNECTION_INFO_UNKNOWN, EXPECT_EQ(net::HttpResponseInfo::CONNECTION_INFO_UNKNOWN,
test_handle()->GetConnectionInfo()); test_handle()->GetConnectionInfo());
test_handle()->Resume(); test_handle()->Resume();
SimulateWillRedirectRequest(); SimulateWillRedirectRequest();
EXPECT_EQ(REQUEST_CONTEXT_TYPE_LOCATION, EXPECT_EQ(REQUEST_CONTEXT_TYPE_LOCATION,
test_handle()->GetRequestContextType()); test_handle()->request_context_type());
EXPECT_EQ(net::HttpResponseInfo::CONNECTION_INFO_HTTP1_1, EXPECT_EQ(net::HttpResponseInfo::CONNECTION_INFO_HTTP1_1,
test_handle()->GetConnectionInfo()); test_handle()->GetConnectionInfo());
test_handle()->Resume(); test_handle()->Resume();
SimulateWillProcessResponse(); SimulateWillProcessResponse();
EXPECT_EQ(REQUEST_CONTEXT_TYPE_LOCATION, EXPECT_EQ(REQUEST_CONTEXT_TYPE_LOCATION,
test_handle()->GetRequestContextType()); test_handle()->request_context_type());
EXPECT_EQ(net::HttpResponseInfo::CONNECTION_INFO_QUIC_35, EXPECT_EQ(net::HttpResponseInfo::CONNECTION_INFO_QUIC_35,
test_handle()->GetConnectionInfo()); test_handle()->GetConnectionInfo());
} }
......
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