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

Side by Side Diff: Source/WebCore/loader/FrameLoader.cpp

Issue 14301003: Rename FeatureObserver to UseCounter to make clear that all it stores are usage counts. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Now with 20% more awesome Created 7 years, 8 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 | Annotate | Revision Log
OLDNEW
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
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698