Chromium Code Reviews| Index: third_party/WebKit/Source/core/dom/Document.cpp |
| diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp |
| index 03495d3e825bdad6fa7fceb5bf60d782d8bc65df..f352fdedf832c1a17be07759e577e211d463c99b 100644 |
| --- a/third_party/WebKit/Source/core/dom/Document.cpp |
| +++ b/third_party/WebKit/Source/core/dom/Document.cpp |
| @@ -4555,6 +4555,21 @@ KURL Document::openSearchDescriptionURL() |
| continue; |
| if (linkElement->href().isEmpty()) |
| continue; |
| + |
| + // Count usage; perhaps we can lock this to secure contexts. |
| + UseCounter::Feature osdDisposition; |
| + RefPtr<SecurityOrigin> target = SecurityOrigin::create(linkElement->href()); |
| + if (isSecureContext()) { |
|
lgarron
2016/06/10 20:00:46
Hmm, so there are 2 URLs and 2 URL patterns in pla
|
| + osdDisposition = target->isPotentiallyTrustworthy() |
| + ? UseCounter::OpenSearchSecureOriginSecureTarget |
| + : UseCounter::OpenSearchSecureOriginInsecureTarget; |
| + } else { |
| + osdDisposition = target->isPotentiallyTrustworthy() |
| + ? UseCounter::OpenSearchInsecureOriginSecureTarget |
| + : UseCounter::OpenSearchInsecureOriginInsecureTarget; |
| + } |
| + UseCounter::count(*this, osdDisposition); |
| + |
| return linkElement->href(); |
| } |