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

Side by Side Diff: third_party/WebKit/Source/core/loader/FrameLoader.cpp

Issue 2739203002: Initial Implementation of Iframe Attribute for Feature Policy (Part 3) (Closed)
Patch Set: Bug fix: frame owner does not always exist. Created 3 years, 9 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) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights
3 * reserved. 3 * reserved.
4 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 4 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
5 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 5 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
6 * (http://www.torchmobile.com/) 6 * (http://www.torchmobile.com/)
7 * Copyright (C) 2008 Alp Toker <alp@atoker.com> 7 * Copyright (C) 2008 Alp Toker <alp@atoker.com>
8 * Copyright (C) Research In Motion Limited 2009. All rights reserved. 8 * Copyright (C) Research In Motion Limited 2009. All rights reserved.
9 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com> 9 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com>
10 * Copyright (C) 2011 Google Inc. All rights reserved. 10 * Copyright (C) 2011 Google Inc. All rights reserved.
(...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after
610 ->parent() 610 ->parent()
611 ->securityContext() 611 ->securityContext()
612 ->getFeaturePolicy()); 612 ->getFeaturePolicy());
613 const String& featurePolicyHeader = 613 const String& featurePolicyHeader =
614 m_documentLoader->response().httpHeaderField( 614 m_documentLoader->response().httpHeaderField(
615 HTTPNames::Feature_Policy); 615 HTTPNames::Feature_Policy);
616 Vector<String> messages; 616 Vector<String> messages;
617 const WebParsedFeaturePolicy& parsedHeader = parseFeaturePolicy( 617 const WebParsedFeaturePolicy& parsedHeader = parseFeaturePolicy(
618 featurePolicyHeader, m_frame->securityContext()->getSecurityOrigin(), 618 featurePolicyHeader, m_frame->securityContext()->getSecurityOrigin(),
619 &messages); 619 &messages);
620 m_frame->securityContext()->initializeFeaturePolicy(parsedHeader, 620 WebParsedFeaturePolicy containerPolicy;
621 parentFeaturePolicy); 621 if (m_frame->owner()) {
dglazkov 2017/03/20 20:57:12 I wonder if even need to do anything with feature
lunalu1 2017/03/20 21:07:01 There are two ways to define feature policy. One i
dglazkov 2017/03/20 22:18:26 I could be wrong, but if I remember correctly, the
622 containerPolicy = getContainerPolicyFromAllowedFeatures(
623 m_frame->owner()->allowedFeatures(),
624 m_frame->securityContext()->getSecurityOrigin());
625 }
626 m_frame->securityContext()->initializeFeaturePolicy(
627 parsedHeader, containerPolicy, parentFeaturePolicy);
622 for (auto& message : messages) { 628 for (auto& message : messages) {
623 m_frame->document()->addConsoleMessage(ConsoleMessage::create( 629 m_frame->document()->addConsoleMessage(ConsoleMessage::create(
624 OtherMessageSource, ErrorMessageLevel, 630 OtherMessageSource, ErrorMessageLevel,
625 "Error with Feature-Policy header: " + message)); 631 "Error with Feature-Policy header: " + message));
626 } 632 }
627 if (!parsedHeader.isEmpty()) 633 if (!parsedHeader.isEmpty())
628 client()->didSetFeaturePolicyHeader(parsedHeader); 634 client()->didSetFeaturePolicyHeader(parsedHeader);
629 } 635 }
630 } 636 }
631 637
(...skipping 1406 matching lines...) Expand 10 before | Expand all | Expand 10 after
2038 frameLoadRequest.clientRedirect()); 2044 frameLoadRequest.clientRedirect());
2039 2045
2040 loader->setLoadType(loadType); 2046 loader->setLoadType(loadType);
2041 loader->setNavigationType(navigationType); 2047 loader->setNavigationType(navigationType);
2042 loader->setReplacesCurrentHistoryItem(loadType == 2048 loader->setReplacesCurrentHistoryItem(loadType ==
2043 FrameLoadTypeReplaceCurrentItem); 2049 FrameLoadTypeReplaceCurrentItem);
2044 return loader; 2050 return loader;
2045 } 2051 }
2046 2052
2047 } // namespace blink 2053 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698