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 2798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2809 | 2809 |
2810 void FrameLoader::applyUserAgent(ResourceRequest& request) | 2810 void FrameLoader::applyUserAgent(ResourceRequest& request) |
2811 { | 2811 { |
2812 String userAgent = this->userAgent(request.url()); | 2812 String userAgent = this->userAgent(request.url()); |
2813 ASSERT(!userAgent.isNull()); | 2813 ASSERT(!userAgent.isNull()); |
2814 request.setHTTPUserAgent(userAgent); | 2814 request.setHTTPUserAgent(userAgent); |
2815 } | 2815 } |
2816 | 2816 |
2817 bool FrameLoader::shouldInterruptLoadForXFrameOptions(const String& content, con
st KURL& url, unsigned long requestIdentifier) | 2817 bool FrameLoader::shouldInterruptLoadForXFrameOptions(const String& content, con
st KURL& url, unsigned long requestIdentifier) |
2818 { | 2818 { |
2819 FeatureObserver::observe(m_frame->document(), FeatureObserver::XFrameOptions
); | 2819 UseCounter::observe(m_frame->document(), UseCounter::XFrameOptions); |
2820 | 2820 |
2821 Frame* topFrame = m_frame->tree()->top(); | 2821 Frame* topFrame = m_frame->tree()->top(); |
2822 if (m_frame == topFrame) | 2822 if (m_frame == topFrame) |
2823 return false; | 2823 return false; |
2824 | 2824 |
2825 XFrameOptionsDisposition disposition = parseXFrameOptionsHeader(content); | 2825 XFrameOptionsDisposition disposition = parseXFrameOptionsHeader(content); |
2826 | 2826 |
2827 switch (disposition) { | 2827 switch (disposition) { |
2828 case XFrameOptionsSameOrigin: { | 2828 case XFrameOptionsSameOrigin: { |
2829 FeatureObserver::observe(m_frame->document(), FeatureObserver::XFrameOpt
ionsSameOrigin); | 2829 UseCounter::observe(m_frame->document(), UseCounter::XFrameOptionsSameOr
igin); |
2830 RefPtr<SecurityOrigin> origin = SecurityOrigin::create(url); | 2830 RefPtr<SecurityOrigin> origin = SecurityOrigin::create(url); |
2831 if (!origin->isSameSchemeHostPort(topFrame->document()->securityOrigin()
)) | 2831 if (!origin->isSameSchemeHostPort(topFrame->document()->securityOrigin()
)) |
2832 return true; | 2832 return true; |
2833 for (Frame* frame = m_frame->tree()->parent(); frame; frame = frame->tre
e()->parent()) { | 2833 for (Frame* frame = m_frame->tree()->parent(); frame; frame = frame->tre
e()->parent()) { |
2834 if (!origin->isSameSchemeHostPort(frame->document()->securityOrigin(
))) { | 2834 if (!origin->isSameSchemeHostPort(frame->document()->securityOrigin(
))) { |
2835 FeatureObserver::observe(m_frame->document(), FeatureObserver::X
FrameOptionsSameOriginWithBadAncestorChain); | 2835 UseCounter::observe(m_frame->document(), UseCounter::XFrameOptio
nsSameOriginWithBadAncestorChain); |
2836 break; | 2836 break; |
2837 } | 2837 } |
2838 } | 2838 } |
2839 return false; | 2839 return false; |
2840 } | 2840 } |
2841 case XFrameOptionsDeny: | 2841 case XFrameOptionsDeny: |
2842 return true; | 2842 return true; |
2843 case XFrameOptionsAllowAll: | 2843 case XFrameOptionsAllowAll: |
2844 return false; | 2844 return false; |
2845 case XFrameOptionsConflict: | 2845 case XFrameOptionsConflict: |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3124 m_client->dispatchDidCommitLoad(); | 3124 m_client->dispatchDidCommitLoad(); |
3125 | 3125 |
3126 if (isLoadingMainFrame()) { | 3126 if (isLoadingMainFrame()) { |
3127 m_frame->page()->resetSeenPlugins(); | 3127 m_frame->page()->resetSeenPlugins(); |
3128 m_frame->page()->resetSeenMediaEngines(); | 3128 m_frame->page()->resetSeenMediaEngines(); |
3129 } | 3129 } |
3130 | 3130 |
3131 InspectorInstrumentation::didCommitLoad(m_frame, m_documentLoader.get()); | 3131 InspectorInstrumentation::didCommitLoad(m_frame, m_documentLoader.get()); |
3132 | 3132 |
3133 if (m_frame->page()->mainFrame() == m_frame) | 3133 if (m_frame->page()->mainFrame() == m_frame) |
3134 m_frame->page()->featureObserver()->didCommitLoad(); | 3134 m_frame->page()->useCounter()->didCommitLoad(); |
3135 | 3135 |
3136 } | 3136 } |
3137 | 3137 |
3138 void FrameLoader::tellClientAboutPastMemoryCacheLoads() | 3138 void FrameLoader::tellClientAboutPastMemoryCacheLoads() |
3139 { | 3139 { |
3140 ASSERT(m_frame->page()); | 3140 ASSERT(m_frame->page()); |
3141 ASSERT(m_frame->page()->areMemoryCacheClientCallsEnabled()); | 3141 ASSERT(m_frame->page()->areMemoryCacheClientCallsEnabled()); |
3142 | 3142 |
3143 if (!m_documentLoader) | 3143 if (!m_documentLoader) |
3144 return; | 3144 return; |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3266 FloatRect newWindowRect = DOMWindow::adjustWindowRect(page, windowRect); | 3266 FloatRect newWindowRect = DOMWindow::adjustWindowRect(page, windowRect); |
3267 | 3267 |
3268 page->chrome()->setWindowRect(newWindowRect); | 3268 page->chrome()->setWindowRect(newWindowRect); |
3269 page->chrome()->show(); | 3269 page->chrome()->show(); |
3270 | 3270 |
3271 created = true; | 3271 created = true; |
3272 return frame; | 3272 return frame; |
3273 } | 3273 } |
3274 | 3274 |
3275 } // namespace WebCore | 3275 } // namespace WebCore |
OLD | NEW |