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

Side by Side Diff: Source/core/html/parser/HTMLPreloadScanner.cpp

Issue 1291613010: Implement referrerpolicy attribute for img elements (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix up no-referrer test Created 5 years, 4 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) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3 * Copyright (C) 2009 Torch Mobile, Inc. http://www.torchmobile.com/ 3 * Copyright (C) 2009 Torch Mobile, Inc. http://www.torchmobile.com/
4 * Copyright (C) 2010 Google Inc. All Rights Reserved. 4 * Copyright (C) 2010 Google Inc. All Rights Reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after
586 if (match(tagImpl, pictureTag)) { 586 if (match(tagImpl, pictureTag)) {
587 m_inPicture = true; 587 m_inPicture = true;
588 m_pictureData = PictureData(); 588 m_pictureData = PictureData();
589 return; 589 return;
590 } 590 }
591 591
592 StartTagScanner scanner(tagImpl, m_documentParameters->mediaValues); 592 StartTagScanner scanner(tagImpl, m_documentParameters->mediaValues);
593 scanner.processAttributes(token.attributes()); 593 scanner.processAttributes(token.attributes());
594 if (m_inPicture) 594 if (m_inPicture)
595 scanner.handlePictureSourceURL(m_pictureData); 595 scanner.handlePictureSourceURL(m_pictureData);
596 OwnPtr<PreloadRequest> request = scanner.createPreloadRequest(m_predicte dBaseElementURL, source, m_clientHintsPreferences, m_pictureData, m_documentPara meters->referrerPolicy); 596
597 ReferrerPolicy referrerPolicy = m_documentParameters->referrerPolicy;
598 const typename Token::Attribute* referrerPolicyAttribute = token.getAttr ibuteItem(referrerpolicyAttr);
599 if (referrerPolicyAttribute) {
600 String referrerPolicyValue(referrerPolicyAttribute->value);
601 ReferrerPolicy parsedReferrerPolicy;
602 if (SecurityPolicy::referrerPolicyFromString(referrerPolicyValue, &p arsedReferrerPolicy)) {
603 referrerPolicy = parsedReferrerPolicy;
604 }
605 }
Yoav Weiss 2015/08/18 07:22:17 I don't think we should handle the referrer attrib
estark 2015/08/18 17:34:26 Hmm, I originally put it here because the spec def
606
607 OwnPtr<PreloadRequest> request = scanner.createPreloadRequest(m_predicte dBaseElementURL, source, m_clientHintsPreferences, m_pictureData, referrerPolicy );
597 if (request) 608 if (request)
598 requests.append(request.release()); 609 requests.append(request.release());
599 return; 610 return;
600 } 611 }
601 default: { 612 default: {
602 return; 613 return;
603 } 614 }
604 } 615 }
605 } 616 }
606 617
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
661 else 672 else
662 mediaValues = MediaValuesCached::create(*document); 673 mediaValues = MediaValuesCached::create(*document);
663 ASSERT(mediaValues->isSafeToSendToAnotherThread()); 674 ASSERT(mediaValues->isSafeToSendToAnotherThread());
664 defaultViewportMinWidth = document->viewportDefaultMinWidth(); 675 defaultViewportMinWidth = document->viewportDefaultMinWidth();
665 viewportMetaZeroValuesQuirk = document->settings() && document->settings()-> viewportMetaZeroValuesQuirk(); 676 viewportMetaZeroValuesQuirk = document->settings() && document->settings()-> viewportMetaZeroValuesQuirk();
666 viewportMetaEnabled = document->settings() && document->settings()->viewport MetaEnabled(); 677 viewportMetaEnabled = document->settings() && document->settings()->viewport MetaEnabled();
667 referrerPolicy = ReferrerPolicyDefault; 678 referrerPolicy = ReferrerPolicyDefault;
668 } 679 }
669 680
670 } 681 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698