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

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: Clean up after rebase 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 const WebParsedFeaturePolicy& containerPolicy =
621 parentFeaturePolicy); 621 getContainerPolicyFromAllowedFeatures(
622 m_frame->owner()->allowedFeatures(),
dglazkov 2017/03/20 16:49:50 It crashes here.
lunalu1 2017/03/20 20:50:09 Thanks! My bad, frame owner doesn't always exit.
623 m_frame->securityContext()->getSecurityOrigin());
624
625 m_frame->securityContext()->initializeFeaturePolicy(
626 parsedHeader, containerPolicy, parentFeaturePolicy);
622 for (auto& message : messages) { 627 for (auto& message : messages) {
623 m_frame->document()->addConsoleMessage(ConsoleMessage::create( 628 m_frame->document()->addConsoleMessage(ConsoleMessage::create(
624 OtherMessageSource, ErrorMessageLevel, 629 OtherMessageSource, ErrorMessageLevel,
625 "Error with Feature-Policy header: " + message)); 630 "Error with Feature-Policy header: " + message));
626 } 631 }
627 if (!parsedHeader.isEmpty()) 632 if (!parsedHeader.isEmpty())
628 client()->didSetFeaturePolicyHeader(parsedHeader); 633 client()->didSetFeaturePolicyHeader(parsedHeader);
629 } 634 }
630 } 635 }
631 636
(...skipping 1406 matching lines...) Expand 10 before | Expand all | Expand 10 after
2038 frameLoadRequest.clientRedirect()); 2043 frameLoadRequest.clientRedirect());
2039 2044
2040 loader->setLoadType(loadType); 2045 loader->setLoadType(loadType);
2041 loader->setNavigationType(navigationType); 2046 loader->setNavigationType(navigationType);
2042 loader->setReplacesCurrentHistoryItem(loadType == 2047 loader->setReplacesCurrentHistoryItem(loadType ==
2043 FrameLoadTypeReplaceCurrentItem); 2048 FrameLoadTypeReplaceCurrentItem);
2044 return loader; 2049 return loader;
2045 } 2050 }
2046 2051
2047 } // namespace blink 2052 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698