Commit 4c8d2945 authored by Daniel Bratell's avatar Daniel Bratell Committed by Commit Bot

Giving some ssl metrics functions unique names

In jumbo builds many cc files compile in the same translation
unit and then they share the same anonymous namespace. Having
two methods with the same name will then result in compilation
failures.

In preparation for jumbo in chrome/browser, this patch renames
some functions and metrics related to ssl interstitial pages.

Bug: 746957
Change-Id: If8218168d38a7ddae9f2fcdb09b2956018aacd8f
Reviewed-on: https://chromium-review.googlesource.com/895370Reviewed-by: default avatarEmily Stark <estark@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#533608}
parent fa293678
...@@ -34,17 +34,17 @@ using content::NavigationEntry; ...@@ -34,17 +34,17 @@ using content::NavigationEntry;
namespace { namespace {
const char kMetricsName[] = "bad_clock"; const char kBadClockMetricsName[] = "bad_clock";
std::unique_ptr<ChromeMetricsHelper> CreateMetricsHelper( std::unique_ptr<ChromeMetricsHelper> CreateBadClockMetricsHelper(
content::WebContents* web_contents, content::WebContents* web_contents,
const GURL& request_url) { const GURL& request_url) {
// Set up the metrics helper for the BadClockUI. // Set up the metrics helper for the BadClockUI.
security_interstitials::MetricsHelper::ReportDetails reporting_info; security_interstitials::MetricsHelper::ReportDetails reporting_info;
reporting_info.metric_prefix = kMetricsName; reporting_info.metric_prefix = kBadClockMetricsName;
std::unique_ptr<ChromeMetricsHelper> metrics_helper = std::unique_ptr<ChromeMetricsHelper> metrics_helper =
std::make_unique<ChromeMetricsHelper>(web_contents, request_url, std::make_unique<ChromeMetricsHelper>(
reporting_info, kMetricsName); web_contents, request_url, reporting_info, kBadClockMetricsName);
metrics_helper.get()->StartRecordingCaptivePortalMetrics(false); metrics_helper.get()->StartRecordingCaptivePortalMetrics(false);
return metrics_helper; return metrics_helper;
} }
...@@ -80,7 +80,7 @@ BadClockBlockingPage::BadClockBlockingPage( ...@@ -80,7 +80,7 @@ BadClockBlockingPage::BadClockBlockingPage(
web_contents, web_contents,
ssl_info, ssl_info,
request_url, request_url,
CreateMetricsHelper(web_contents, request_url))), CreateBadClockMetricsHelper(web_contents, request_url))),
callback_(callback), callback_(callback),
ssl_info_(ssl_info), ssl_info_(ssl_info),
bad_clock_ui_(new security_interstitials::BadClockUI(request_url, bad_clock_ui_(new security_interstitials::BadClockUI(request_url,
......
...@@ -46,16 +46,16 @@ ...@@ -46,16 +46,16 @@
namespace { namespace {
const char kMetricsName[] = "captive_portal"; const char kCaptivePortalMetricsName[] = "captive_portal";
std::unique_ptr<ChromeMetricsHelper> CreateMetricsHelper( std::unique_ptr<ChromeMetricsHelper> CreateCaptivePortalMetricsHelper(
content::WebContents* web_contents, content::WebContents* web_contents,
const GURL& request_url) { const GURL& request_url) {
security_interstitials::MetricsHelper::ReportDetails reporting_info; security_interstitials::MetricsHelper::ReportDetails reporting_info;
reporting_info.metric_prefix = kMetricsName; reporting_info.metric_prefix = kCaptivePortalMetricsName;
std::unique_ptr<ChromeMetricsHelper> metrics_helper = std::unique_ptr<ChromeMetricsHelper> metrics_helper =
std::make_unique<ChromeMetricsHelper>(web_contents, request_url, std::make_unique<ChromeMetricsHelper>(
reporting_info, kMetricsName); web_contents, request_url, reporting_info, kCaptivePortalMetricsName);
metrics_helper.get()->StartRecordingCaptivePortalMetrics(false); metrics_helper.get()->StartRecordingCaptivePortalMetrics(false);
return metrics_helper; return metrics_helper;
} }
...@@ -85,7 +85,7 @@ CaptivePortalBlockingPage::CaptivePortalBlockingPage( ...@@ -85,7 +85,7 @@ CaptivePortalBlockingPage::CaptivePortalBlockingPage(
web_contents, web_contents,
ssl_info, ssl_info,
request_url, request_url,
CreateMetricsHelper(web_contents, request_url))), CreateCaptivePortalMetricsHelper(web_contents, request_url))),
login_url_(login_url), login_url_(login_url),
ssl_info_(ssl_info), ssl_info_(ssl_info),
callback_(callback) { callback_(callback) {
......
...@@ -33,17 +33,17 @@ using content::NavigationEntry; ...@@ -33,17 +33,17 @@ using content::NavigationEntry;
namespace { namespace {
const char kMetricsName[] = "mitm_software"; const char kMitmSoftwareMetricsName[] = "mitm_software";
std::unique_ptr<ChromeMetricsHelper> CreateMetricsHelper( std::unique_ptr<ChromeMetricsHelper> CreateMitmSoftwareMetricsHelper(
content::WebContents* web_contents, content::WebContents* web_contents,
const GURL& request_url) { const GURL& request_url) {
// Set up the metrics helper for the MITMSoftwareUI. // Set up the metrics helper for the MITMSoftwareUI.
security_interstitials::MetricsHelper::ReportDetails reporting_info; security_interstitials::MetricsHelper::ReportDetails reporting_info;
reporting_info.metric_prefix = kMetricsName; reporting_info.metric_prefix = kMitmSoftwareMetricsName;
std::unique_ptr<ChromeMetricsHelper> metrics_helper = std::unique_ptr<ChromeMetricsHelper> metrics_helper =
std::make_unique<ChromeMetricsHelper>(web_contents, request_url, std::make_unique<ChromeMetricsHelper>(
reporting_info, kMetricsName); web_contents, request_url, reporting_info, kMitmSoftwareMetricsName);
metrics_helper.get()->StartRecordingCaptivePortalMetrics(false); metrics_helper.get()->StartRecordingCaptivePortalMetrics(false);
return metrics_helper; return metrics_helper;
} }
...@@ -80,7 +80,7 @@ MITMSoftwareBlockingPage::MITMSoftwareBlockingPage( ...@@ -80,7 +80,7 @@ MITMSoftwareBlockingPage::MITMSoftwareBlockingPage(
web_contents, web_contents,
ssl_info, ssl_info,
request_url, request_url,
CreateMetricsHelper(web_contents, request_url))), CreateMitmSoftwareMetricsHelper(web_contents, request_url))),
callback_(callback), callback_(callback),
ssl_info_(ssl_info), ssl_info_(ssl_info),
mitm_software_ui_( mitm_software_ui_(
......
...@@ -58,7 +58,7 @@ std::string GetSamplingEventName(const bool overridable, const int cert_error) { ...@@ -58,7 +58,7 @@ std::string GetSamplingEventName(const bool overridable, const int cert_error) {
return event_name; return event_name;
} }
std::unique_ptr<ChromeMetricsHelper> CreateMetricsHelper( std::unique_ptr<ChromeMetricsHelper> CreateSslProblemMetricsHelper(
content::WebContents* web_contents, content::WebContents* web_contents,
int cert_error, int cert_error,
const GURL& request_url, const GURL& request_url,
...@@ -96,8 +96,9 @@ SSLBlockingPage* SSLBlockingPage::Create( ...@@ -96,8 +96,9 @@ SSLBlockingPage* SSLBlockingPage::Create(
const base::Callback<void(content::CertificateRequestResultType)>& const base::Callback<void(content::CertificateRequestResultType)>&
callback) { callback) {
bool overridable = IsOverridable(options_mask); bool overridable = IsOverridable(options_mask);
std::unique_ptr<ChromeMetricsHelper> metrics_helper(CreateMetricsHelper( std::unique_ptr<ChromeMetricsHelper> metrics_helper(
web_contents, cert_error, request_url, overridable, is_superfish)); CreateSslProblemMetricsHelper(web_contents, cert_error, request_url,
overridable, is_superfish));
metrics_helper.get()->StartRecordingCaptivePortalMetrics(overridable); metrics_helper.get()->StartRecordingCaptivePortalMetrics(overridable);
return new SSLBlockingPage(web_contents, cert_error, ssl_info, request_url, return new SSLBlockingPage(web_contents, cert_error, ssl_info, request_url,
......
...@@ -21,14 +21,14 @@ ...@@ -21,14 +21,14 @@
namespace { namespace {
const char kMetricsName[] = "test_ssl_blocking_page"; const char kTestSslMetricsName[] = "test_ssl_blocking_page";
std::unique_ptr<ChromeMetricsHelper> CreateMetricsHelper( std::unique_ptr<ChromeMetricsHelper> CreateTestSslMetricsHelper(
content::WebContents* web_contents) { content::WebContents* web_contents) {
security_interstitials::MetricsHelper::ReportDetails report_details; security_interstitials::MetricsHelper::ReportDetails report_details;
report_details.metric_prefix = kMetricsName; report_details.metric_prefix = kTestSslMetricsName;
return std::make_unique<ChromeMetricsHelper>(web_contents, GURL(), return std::make_unique<ChromeMetricsHelper>(
report_details, kMetricsName); web_contents, GURL(), report_details, kTestSslMetricsName);
} }
class TestSSLBlockingPage : public SSLBlockingPage { class TestSSLBlockingPage : public SSLBlockingPage {
...@@ -47,7 +47,7 @@ class TestSSLBlockingPage : public SSLBlockingPage { ...@@ -47,7 +47,7 @@ class TestSSLBlockingPage : public SSLBlockingPage {
GURL(), GURL(),
nullptr /* ssl_cert_reporter */, nullptr /* ssl_cert_reporter */,
true /* overridable */, true /* overridable */,
CreateMetricsHelper(web_contents), CreateTestSslMetricsHelper(web_contents),
false /* is_superfish */, false /* is_superfish */,
base::Callback<void(content::CertificateRequestResultType)>()), base::Callback<void(content::CertificateRequestResultType)>()),
destroyed_tracker_(destroyed_tracker) {} destroyed_tracker_(destroyed_tracker) {}
......
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