OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv
ed. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv
ed. |
3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
4 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 4 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
5 * Copyright (C) 2008 Alp Toker <alp@atoker.com> | 5 * Copyright (C) 2008 Alp Toker <alp@atoker.com> |
6 * Copyright (C) Research In Motion Limited 2009. All rights reserved. | 6 * Copyright (C) Research In Motion Limited 2009. All rights reserved. |
7 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com> | 7 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com> |
8 * Copyright (C) 2011 Google Inc. All rights reserved. | 8 * Copyright (C) 2011 Google Inc. All rights reserved. |
9 * | 9 * |
10 * Redistribution and use in source and binary forms, with or without | 10 * Redistribution and use in source and binary forms, with or without |
(...skipping 2625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2636 | 2636 |
2637 void FrameLoader::applyUserAgent(ResourceRequest& request) | 2637 void FrameLoader::applyUserAgent(ResourceRequest& request) |
2638 { | 2638 { |
2639 String userAgent = this->userAgent(request.url()); | 2639 String userAgent = this->userAgent(request.url()); |
2640 ASSERT(!userAgent.isNull()); | 2640 ASSERT(!userAgent.isNull()); |
2641 request.setHTTPUserAgent(userAgent); | 2641 request.setHTTPUserAgent(userAgent); |
2642 } | 2642 } |
2643 | 2643 |
2644 bool FrameLoader::shouldInterruptLoadForXFrameOptions(const String& content, con
st KURL& url, unsigned long requestIdentifier) | 2644 bool FrameLoader::shouldInterruptLoadForXFrameOptions(const String& content, con
st KURL& url, unsigned long requestIdentifier) |
2645 { | 2645 { |
2646 UseCounter::observe(m_frame->document(), UseCounter::XFrameOptions); | 2646 UseCounter::count(m_frame->document(), UseCounter::XFrameOptions); |
2647 | 2647 |
2648 Frame* topFrame = m_frame->tree()->top(); | 2648 Frame* topFrame = m_frame->tree()->top(); |
2649 if (m_frame == topFrame) | 2649 if (m_frame == topFrame) |
2650 return false; | 2650 return false; |
2651 | 2651 |
2652 XFrameOptionsDisposition disposition = parseXFrameOptionsHeader(content); | 2652 XFrameOptionsDisposition disposition = parseXFrameOptionsHeader(content); |
2653 | 2653 |
2654 switch (disposition) { | 2654 switch (disposition) { |
2655 case XFrameOptionsSameOrigin: { | 2655 case XFrameOptionsSameOrigin: { |
2656 UseCounter::observe(m_frame->document(), UseCounter::XFrameOptionsSameOr
igin); | 2656 UseCounter::count(m_frame->document(), UseCounter::XFrameOptionsSameOrig
in); |
2657 RefPtr<SecurityOrigin> origin = SecurityOrigin::create(url); | 2657 RefPtr<SecurityOrigin> origin = SecurityOrigin::create(url); |
2658 if (!origin->isSameSchemeHostPort(topFrame->document()->securityOrigin()
)) | 2658 if (!origin->isSameSchemeHostPort(topFrame->document()->securityOrigin()
)) |
2659 return true; | 2659 return true; |
2660 for (Frame* frame = m_frame->tree()->parent(); frame; frame = frame->tre
e()->parent()) { | 2660 for (Frame* frame = m_frame->tree()->parent(); frame; frame = frame->tre
e()->parent()) { |
2661 if (!origin->isSameSchemeHostPort(frame->document()->securityOrigin(
))) { | 2661 if (!origin->isSameSchemeHostPort(frame->document()->securityOrigin(
))) { |
2662 UseCounter::observe(m_frame->document(), UseCounter::XFrameOptio
nsSameOriginWithBadAncestorChain); | 2662 UseCounter::count(m_frame->document(), UseCounter::XFrameOptions
SameOriginWithBadAncestorChain); |
2663 break; | 2663 break; |
2664 } | 2664 } |
2665 } | 2665 } |
2666 return false; | 2666 return false; |
2667 } | 2667 } |
2668 case XFrameOptionsDeny: | 2668 case XFrameOptionsDeny: |
2669 return true; | 2669 return true; |
2670 case XFrameOptionsAllowAll: | 2670 case XFrameOptionsAllowAll: |
2671 return false; | 2671 return false; |
2672 case XFrameOptionsConflict: | 2672 case XFrameOptionsConflict: |
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3065 FloatRect newWindowRect = DOMWindow::adjustWindowRect(page, windowRect); | 3065 FloatRect newWindowRect = DOMWindow::adjustWindowRect(page, windowRect); |
3066 | 3066 |
3067 page->chrome()->setWindowRect(newWindowRect); | 3067 page->chrome()->setWindowRect(newWindowRect); |
3068 page->chrome()->show(); | 3068 page->chrome()->show(); |
3069 | 3069 |
3070 created = true; | 3070 created = true; |
3071 return frame; | 3071 return frame; |
3072 } | 3072 } |
3073 | 3073 |
3074 } // namespace WebCore | 3074 } // namespace WebCore |
OLD | NEW |