Commit 900d3d42 authored by dcheng's avatar dcheng Committed by Commit bot

Remove implicit conversions from scoped_refptr to T* in components/data_reduction_proxy/

This patch was generated by running the rewrite_scoped_refptr clang tool
on a Linux build.

BUG=110610

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

Cr-Commit-Position: refs/heads/master@{#291934}
parent 45252e8e
......@@ -314,8 +314,9 @@ DataReductionProxyRequestType GetDataReductionProxyRequestType(
return SHORT_BYPASS;
}
#endif
if (request->response_info().headers &&
HasDataReductionProxyViaHeader(request->response_info().headers, NULL)) {
if (request->response_info().headers.get() &&
HasDataReductionProxyViaHeader(request->response_info().headers.get(),
NULL)) {
return VIA_DATA_REDUCTION_PROXY;
}
return UNKNOWN_TYPE;
......
......@@ -351,9 +351,8 @@ TEST_F(DataReductionProxyProtocolTest, OverrideResponseAsRedirect) {
net::DEFAULT_PRIORITY,
NULL,
&context);
OverrideResponseAsRedirect(&request,
original_response_headers,
&override_response_headers);
OverrideResponseAsRedirect(
&request, original_response_headers.get(), &override_response_headers);
int expected_flags = net::LOAD_DISABLE_CACHE | net::LOAD_BYPASS_PROXY;
EXPECT_EQ(expected_flags, request.load_flags());
std::string override_headers;
......
......@@ -250,7 +250,7 @@ TEST_F(DataReductionProxyTamperDetectionTest, ChromeProxy) {
scoped_refptr<net::HttpResponseHeaders> headers(
new net::HttpResponseHeaders(raw_headers));
DataReductionProxyTamperDetection tamper_detection(headers, true, 0);
DataReductionProxyTamperDetection tamper_detection(headers.get(), true, 0);
bool tampered = tamper_detection.ValidateChromeProxyHeader(
test[i].received_fingerprint);
......@@ -374,7 +374,7 @@ TEST_F(DataReductionProxyTamperDetectionTest, Via) {
scoped_refptr<net::HttpResponseHeaders> headers(
new net::HttpResponseHeaders(raw_headers));
DataReductionProxyTamperDetection tamper_detection(headers, true, 0);
DataReductionProxyTamperDetection tamper_detection(headers.get(), true, 0);
bool has_chrome_proxy_via_header;
bool tampered = tamper_detection.ValidateViaHeader(
......@@ -507,7 +507,7 @@ TEST_F(DataReductionProxyTamperDetectionTest, OtherHeaders) {
scoped_refptr<net::HttpResponseHeaders> headers(
new net::HttpResponseHeaders(raw_headers));
DataReductionProxyTamperDetection tamper_detection(headers, true, 0);
DataReductionProxyTamperDetection tamper_detection(headers.get(), true, 0);
bool tampered = tamper_detection.ValidateOtherHeaders(
test[i].received_fingerprint);
......@@ -583,7 +583,7 @@ TEST_F(DataReductionProxyTamperDetectionTest, ContentLength) {
scoped_refptr<net::HttpResponseHeaders> headers(
new net::HttpResponseHeaders(raw_headers));
DataReductionProxyTamperDetection tamper_detection(headers, true, 0);
DataReductionProxyTamperDetection tamper_detection(headers.get(), true, 0);
bool tampered = tamper_detection.ValidateContentLengthHeader(
test[i].received_fingerprint);
......@@ -674,8 +674,8 @@ TEST_F(DataReductionProxyTamperDetectionTest, GetHeaderValues) {
StringsToVector(test[i].expected_output_values);
std::vector<std::string> output_values =
DataReductionProxyTamperDetection::GetHeaderValues(
headers, test[i].header_name);
DataReductionProxyTamperDetection::GetHeaderValues(headers.get(),
test[i].header_name);
EXPECT_EQ(expected_output_values, output_values) << test[i].label;
}
}
......@@ -747,8 +747,9 @@ TEST_F(DataReductionProxyTamperDetectionTest, DetectAndReport) {
scoped_refptr<net::HttpResponseHeaders> headers(
new net::HttpResponseHeaders(raw_headers));
EXPECT_EQ(test[i].expected_tampered_with,
DataReductionProxyTamperDetection::DetectAndReport(headers, true))
EXPECT_EQ(
test[i].expected_tampered_with,
DataReductionProxyTamperDetection::DetectAndReport(headers.get(), true))
<< test[i].label;
}
}
......
......@@ -112,7 +112,7 @@ TEST_F(DataReductionProxyHeadersTest, GetDataReductionProxyActionValue) {
std::string action_value;
bool has_action_key = GetDataReductionProxyActionValue(
parsed, tests[i].action_key, &action_value);
parsed.get(), tests[i].action_key, &action_value);
EXPECT_EQ(tests[i].expected_result, has_action_key);
if (has_action_key) {
EXPECT_EQ(tests[i].expected_action_value, action_value);
......@@ -361,8 +361,9 @@ TEST_F(DataReductionProxyHeadersTest, GetProxyBypassInfo) {
new net::HttpResponseHeaders(headers));
DataReductionProxyInfo data_reduction_proxy_info;
EXPECT_EQ(tests[i].expected_result,
ParseHeadersAndSetProxyInfo(parsed, &data_reduction_proxy_info));
EXPECT_EQ(
tests[i].expected_result,
ParseHeadersAndSetProxyInfo(parsed.get(), &data_reduction_proxy_info));
EXPECT_EQ(tests[i].expected_retry_delay,
data_reduction_proxy_info.bypass_duration.InSeconds());
EXPECT_EQ(tests[i].expected_bypass_all,
......@@ -383,7 +384,8 @@ TEST_F(DataReductionProxyHeadersTest, ParseHeadersAndSetProxyInfo) {
new net::HttpResponseHeaders(headers));
DataReductionProxyInfo data_reduction_proxy_info;
EXPECT_TRUE(ParseHeadersAndSetProxyInfo(parsed, &data_reduction_proxy_info));
EXPECT_TRUE(
ParseHeadersAndSetProxyInfo(parsed.get(), &data_reduction_proxy_info));
EXPECT_LE(60, data_reduction_proxy_info.bypass_duration.InSeconds());
EXPECT_GE(5 * 60, data_reduction_proxy_info.bypass_duration.InSeconds());
EXPECT_FALSE(data_reduction_proxy_info.bypass_all);
......@@ -513,11 +515,11 @@ TEST_F(DataReductionProxyHeadersTest, HasDataReductionProxyViaHeader) {
bool has_chrome_proxy_via_header, has_intermediary;
if (tests[i].ignore_intermediary) {
has_chrome_proxy_via_header =
HasDataReductionProxyViaHeader(parsed, NULL);
HasDataReductionProxyViaHeader(parsed.get(), NULL);
}
else {
has_chrome_proxy_via_header =
HasDataReductionProxyViaHeader(parsed, &has_intermediary);
HasDataReductionProxyViaHeader(parsed.get(), &has_intermediary);
}
EXPECT_EQ(tests[i].expected_result, has_chrome_proxy_via_header);
if (has_chrome_proxy_via_header && !tests[i].ignore_intermediary) {
......@@ -633,8 +635,9 @@ TEST_F(DataReductionProxyHeadersTest, GetDataReductionProxyBypassEventType) {
scoped_refptr<net::HttpResponseHeaders> parsed(
new net::HttpResponseHeaders(headers));
DataReductionProxyInfo chrome_proxy_info;
EXPECT_EQ(tests[i].expected_result,
GetDataReductionProxyBypassType(parsed, &chrome_proxy_info));
EXPECT_EQ(
tests[i].expected_result,
GetDataReductionProxyBypassType(parsed.get(), &chrome_proxy_info));
}
}
......@@ -673,7 +676,7 @@ TEST_F(DataReductionProxyHeadersTest,
std::string fingerprint;
bool fingerprint_exist = GetDataReductionProxyActionFingerprintChromeProxy(
parsed, &fingerprint);
parsed.get(), &fingerprint);
EXPECT_EQ(tests[i].expected_fingerprint_exist, fingerprint_exist)
<< tests[i].label;
......@@ -717,7 +720,7 @@ TEST_F(DataReductionProxyHeadersTest,
std::string fingerprint;
bool fingerprint_exist =
GetDataReductionProxyActionFingerprintVia(parsed, &fingerprint);
GetDataReductionProxyActionFingerprintVia(parsed.get(), &fingerprint);
EXPECT_EQ(tests[i].expected_fingerprint_exist, fingerprint_exist)
<< tests[i].label;
......@@ -760,9 +763,8 @@ TEST_F(DataReductionProxyHeadersTest,
new net::HttpResponseHeaders(headers));
std::string fingerprint;
bool fingerprint_exist =
GetDataReductionProxyActionFingerprintOtherHeaders(
parsed, &fingerprint);
bool fingerprint_exist = GetDataReductionProxyActionFingerprintOtherHeaders(
parsed.get(), &fingerprint);
EXPECT_EQ(tests[i].expected_fingerprint_exist, fingerprint_exist)
<< tests[i].label;
......@@ -806,8 +808,8 @@ TEST_F(DataReductionProxyHeadersTest,
std::string fingerprint;
bool fingerprint_exist =
GetDataReductionProxyActionFingerprintContentLength(
parsed, &fingerprint);
GetDataReductionProxyActionFingerprintContentLength(parsed.get(),
&fingerprint);
EXPECT_EQ(tests[i].expected_fingerprint_exist, fingerprint_exist)
<< tests[i].label;
......@@ -870,7 +872,8 @@ TEST_F(DataReductionProxyHeadersTest,
new net::HttpResponseHeaders(headers));
std::vector<std::string> output_values;
GetDataReductionProxyHeaderWithFingerprintRemoved(parsed, &output_values);
GetDataReductionProxyHeaderWithFingerprintRemoved(parsed.get(),
&output_values);
std::string output_values_string;
for (size_t j = 0; j < output_values.size(); ++j)
......
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