Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(490)

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLAnchorElement.cpp

Issue 2628613002: Add UseCounters for referrerpolicy attributes (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Simon Hausmann <hausmann@kde.org> 4 * (C) 2000 Simon Hausmann <hausmann@kde.org>
5 * Copyright (C) 2003, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights 5 * Copyright (C) 2003, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
6 * reserved. 6 * reserved.
7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com)
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 request.setUIStartTime( 409 request.setUIStartTime(
410 (event->platformTimeStamp() - TimeTicks()).InSecondsF()); 410 (event->platformTimeStamp() - TimeTicks()).InSecondsF());
411 request.setInputPerfMetricReportPolicy( 411 request.setInputPerfMetricReportPolicy(
412 InputToLoadPerfMetricReportPolicy::ReportLink); 412 InputToLoadPerfMetricReportPolicy::ReportLink);
413 413
414 ReferrerPolicy policy; 414 ReferrerPolicy policy;
415 if (hasAttribute(referrerpolicyAttr) && 415 if (hasAttribute(referrerpolicyAttr) &&
416 SecurityPolicy::referrerPolicyFromStringWithLegacyKeywords( 416 SecurityPolicy::referrerPolicyFromStringWithLegacyKeywords(
417 fastGetAttribute(referrerpolicyAttr), &policy) && 417 fastGetAttribute(referrerpolicyAttr), &policy) &&
418 !hasRel(RelationNoReferrer)) { 418 !hasRel(RelationNoReferrer)) {
419 UseCounter::count(document(),
420 UseCounter::HTMLAnchorElementReferrerPolicyAttribute);
419 request.setHTTPReferrer(SecurityPolicy::generateReferrer( 421 request.setHTTPReferrer(SecurityPolicy::generateReferrer(
420 policy, completedURL, document().outgoingReferrer())); 422 policy, completedURL, document().outgoingReferrer()));
421 } 423 }
422 424
423 if (hasAttribute(downloadAttr)) { 425 if (hasAttribute(downloadAttr)) {
424 request.setRequestContext(WebURLRequest::RequestContextDownload); 426 request.setRequestContext(WebURLRequest::RequestContextDownload);
425 bool isSameOrigin = 427 bool isSameOrigin =
426 completedURL.protocolIsData() || 428 completedURL.protocolIsData() ||
427 document().getSecurityOrigin()->canRequest(completedURL); 429 document().getSecurityOrigin()->canRequest(completedURL);
428 const AtomicString& suggestedName = 430 const AtomicString& suggestedName =
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 } 483 }
482 484
483 HTMLAnchorElement::NavigationHintSender* 485 HTMLAnchorElement::NavigationHintSender*
484 HTMLAnchorElement::ensureNavigationHintSender() { 486 HTMLAnchorElement::ensureNavigationHintSender() {
485 if (!m_navigationHintSender) 487 if (!m_navigationHintSender)
486 m_navigationHintSender = NavigationHintSender::create(this); 488 m_navigationHintSender = NavigationHintSender::create(this);
487 return m_navigationHintSender; 489 return m_navigationHintSender;
488 } 490 }
489 491
490 } // namespace blink 492 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/UseCounter.h ('k') | third_party/WebKit/Source/core/html/HTMLIFrameElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698