Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> | 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> |
| 3 * 1999 Lars Knoll <knoll@kde.org> | 3 * 1999 Lars Knoll <knoll@kde.org> |
| 4 * 1999 Antti Koivisto <koivisto@kde.org> | 4 * 1999 Antti Koivisto <koivisto@kde.org> |
| 5 * 2000 Simon Hausmann <hausmann@kde.org> | 5 * 2000 Simon Hausmann <hausmann@kde.org> |
| 6 * 2000 Stefan Schimanski <1Stein@gmx.de> | 6 * 2000 Stefan Schimanski <1Stein@gmx.de> |
| 7 * 2001 George Staikos <staikos@kde.org> | 7 * 2001 George Staikos <staikos@kde.org> |
| 8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. | 8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. |
| 9 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com> | 9 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com> |
| 10 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 10 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 62 #include "core/page/ChromeClient.h" | 62 #include "core/page/ChromeClient.h" |
| 63 #include "core/page/FocusController.h" | 63 #include "core/page/FocusController.h" |
| 64 #include "core/page/Page.h" | 64 #include "core/page/Page.h" |
| 65 #include "core/page/scrolling/ScrollingCoordinator.h" | 65 #include "core/page/scrolling/ScrollingCoordinator.h" |
| 66 #include "core/paint/ObjectPainter.h" | 66 #include "core/paint/ObjectPainter.h" |
| 67 #include "core/paint/PaintInfo.h" | 67 #include "core/paint/PaintInfo.h" |
| 68 #include "core/paint/PaintLayer.h" | 68 #include "core/paint/PaintLayer.h" |
| 69 #include "core/paint/TransformRecorder.h" | 69 #include "core/paint/TransformRecorder.h" |
| 70 #include "core/svg/SVGDocumentExtensions.h" | 70 #include "core/svg/SVGDocumentExtensions.h" |
| 71 #include "platform/DragImage.h" | 71 #include "platform/DragImage.h" |
| 72 #include "platform/Histogram.h" | |
| 72 #include "platform/JSONValues.h" | 73 #include "platform/JSONValues.h" |
| 73 #include "platform/PluginScriptForbiddenScope.h" | 74 #include "platform/PluginScriptForbiddenScope.h" |
| 74 #include "platform/RuntimeEnabledFeatures.h" | 75 #include "platform/RuntimeEnabledFeatures.h" |
| 75 #include "platform/ScriptForbiddenScope.h" | 76 #include "platform/ScriptForbiddenScope.h" |
| 76 #include "platform/graphics/GraphicsContext.h" | 77 #include "platform/graphics/GraphicsContext.h" |
| 77 #include "platform/graphics/StaticBitmapImage.h" | 78 #include "platform/graphics/StaticBitmapImage.h" |
| 78 #include "platform/graphics/paint/ClipRecorder.h" | 79 #include "platform/graphics/paint/ClipRecorder.h" |
| 79 #include "platform/graphics/paint/PaintController.h" | 80 #include "platform/graphics/paint/PaintController.h" |
| 80 #include "platform/graphics/paint/SkPictureBuilder.h" | 81 #include "platform/graphics/paint/SkPictureBuilder.h" |
| 81 #include "platform/graphics/paint/TransformDisplayItem.h" | 82 #include "platform/graphics/paint/TransformDisplayItem.h" |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 210 } | 211 } |
| 211 | 212 |
| 212 inline float parentTextZoomFactor(LocalFrame* frame) | 213 inline float parentTextZoomFactor(LocalFrame* frame) |
| 213 { | 214 { |
| 214 Frame* parent = frame->tree().parent(); | 215 Frame* parent = frame->tree().parent(); |
| 215 if (!parent || !parent->isLocalFrame()) | 216 if (!parent || !parent->isLocalFrame()) |
| 216 return 1; | 217 return 1; |
| 217 return toLocalFrame(parent)->textZoomFactor(); | 218 return toLocalFrame(parent)->textZoomFactor(); |
| 218 } | 219 } |
| 219 | 220 |
| 221 // These are logged to UMA, so don't re-arrange them without creating a new hist ogram. | |
| 222 enum FrameStateForDeferredLoading { | |
| 223 Created, | |
| 224 WouldLoadBecauseVisible, | |
| 225 // TODO(dgrogan): Add WouldLoadBecauseTopOrLeft, WouldLoadBecauseDisplayNone , etc | |
| 226 | |
| 227 FrameStateForDeferredLoadingEnd | |
| 228 }; | |
| 229 | |
| 230 void RecordStateToHistogram(FrameStateForDeferredLoading state) | |
| 231 { | |
| 232 DEFINE_STATIC_LOCAL(EnumerationHistogram, unseenFrameHistogram, ("FrameLoadi ng.Deferred.StateCountsV1", FrameStateForDeferredLoadingEnd)); | |
| 233 unseenFrameHistogram.count(state); | |
| 234 } | |
| 235 | |
| 220 } // namespace | 236 } // namespace |
| 221 | 237 |
| 222 template class CORE_TEMPLATE_EXPORT Supplement<LocalFrame>; | 238 template class CORE_TEMPLATE_EXPORT Supplement<LocalFrame>; |
| 223 | 239 |
| 224 LocalFrame* LocalFrame::create(FrameLoaderClient* client, FrameHost* host, Frame Owner* owner, InterfaceProvider* interfaceProvider) | 240 LocalFrame* LocalFrame::create(FrameLoaderClient* client, FrameHost* host, Frame Owner* owner, InterfaceProvider* interfaceProvider) |
| 225 { | 241 { |
| 226 LocalFrame* frame = new LocalFrame(client, host, owner, interfaceProvider ? interfaceProvider : InterfaceProvider::getEmptyInterfaceProvider()); | 242 LocalFrame* frame = new LocalFrame(client, host, owner, interfaceProvider ? interfaceProvider : InterfaceProvider::getEmptyInterfaceProvider()); |
| 227 InspectorInstrumentation::frameAttachedToParent(frame); | 243 InspectorInstrumentation::frameAttachedToParent(frame); |
| 228 return frame; | 244 return frame; |
| 229 } | 245 } |
| (...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 799 , m_spellChecker(SpellChecker::create(*this)) | 815 , m_spellChecker(SpellChecker::create(*this)) |
| 800 , m_selection(FrameSelection::create(this)) | 816 , m_selection(FrameSelection::create(this)) |
| 801 , m_eventHandler(new EventHandler(this)) | 817 , m_eventHandler(new EventHandler(this)) |
| 802 , m_console(FrameConsole::create(*this)) | 818 , m_console(FrameConsole::create(*this)) |
| 803 , m_inputMethodController(InputMethodController::create(*this)) | 819 , m_inputMethodController(InputMethodController::create(*this)) |
| 804 , m_navigationDisableCount(0) | 820 , m_navigationDisableCount(0) |
| 805 , m_pageZoomFactor(parentPageZoomFactor(this)) | 821 , m_pageZoomFactor(parentPageZoomFactor(this)) |
| 806 , m_textZoomFactor(parentTextZoomFactor(this)) | 822 , m_textZoomFactor(parentTextZoomFactor(this)) |
| 807 , m_inViewSourceMode(false) | 823 , m_inViewSourceMode(false) |
| 808 , m_interfaceProvider(interfaceProvider) | 824 , m_interfaceProvider(interfaceProvider) |
| 825 , m_visibilityWasLogged(false) | |
| 826 , m_creationWasLogged(false) | |
| 809 { | 827 { |
| 810 if (isLocalRoot()) | 828 if (isLocalRoot()) |
| 811 m_instrumentingAgents = new InstrumentingAgents(); | 829 m_instrumentingAgents = new InstrumentingAgents(); |
| 812 else | 830 else |
| 813 m_instrumentingAgents = localFrameRoot()->m_instrumentingAgents; | 831 m_instrumentingAgents = localFrameRoot()->m_instrumentingAgents; |
| 814 } | 832 } |
| 815 | 833 |
| 816 WebFrameScheduler* LocalFrame::frameScheduler() | 834 WebFrameScheduler* LocalFrame::frameScheduler() |
| 817 { | 835 { |
| 818 return m_frameScheduler.get(); | 836 return m_frameScheduler.get(); |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 830 return static_cast<FrameLoaderClient*>(Frame::client()); | 848 return static_cast<FrameLoaderClient*>(Frame::client()); |
| 831 } | 849 } |
| 832 | 850 |
| 833 PluginData* LocalFrame::pluginData() const | 851 PluginData* LocalFrame::pluginData() const |
| 834 { | 852 { |
| 835 if (!loader().allowPlugins(NotAboutToInstantiatePlugin)) | 853 if (!loader().allowPlugins(NotAboutToInstantiatePlugin)) |
| 836 return nullptr; | 854 return nullptr; |
| 837 return page()->pluginData(); | 855 return page()->pluginData(); |
| 838 } | 856 } |
| 839 | 857 |
| 858 void LocalFrame::didInstallNewDocument() | |
| 859 { | |
| 860 if (!m_creationWasLogged && isCrossOriginSubframe()) { | |
|
dgrogan
2016/08/19 23:56:23
installNewDocument is called twice when an iframe
dcheng
2016/08/22 07:00:29
When a frame is first created, it always starts on
dgrogan
2016/08/22 23:38:09
You're right. This function is now only called whe
| |
| 861 m_creationWasLogged = true; | |
| 862 RecordStateToHistogram(Created); | |
| 863 } | |
| 864 } | |
| 865 | |
| 866 void LocalFrame::onVisibilityMaybeChanged(bool visible) | |
| 867 { | |
| 868 if (visible && !m_visibilityWasLogged && isCrossOriginSubframe()) { | |
| 869 DCHECK(m_creationWasLogged); | |
|
dgrogan
2016/08/22 23:38:09
This was racy.
| |
| 870 m_visibilityWasLogged = true; | |
| 871 RecordStateToHistogram(WouldLoadBecauseVisible); | |
| 872 } | |
| 873 } | |
| 874 | |
| 840 DEFINE_WEAK_IDENTIFIER_MAP(LocalFrame); | 875 DEFINE_WEAK_IDENTIFIER_MAP(LocalFrame); |
| 841 | 876 |
| 842 FrameNavigationDisabler::FrameNavigationDisabler(LocalFrame& frame) | 877 FrameNavigationDisabler::FrameNavigationDisabler(LocalFrame& frame) |
| 843 : m_frame(&frame) | 878 : m_frame(&frame) |
| 844 { | 879 { |
| 845 m_frame->disableNavigation(); | 880 m_frame->disableNavigation(); |
| 846 } | 881 } |
| 847 | 882 |
| 848 FrameNavigationDisabler::~FrameNavigationDisabler() | 883 FrameNavigationDisabler::~FrameNavigationDisabler() |
| 849 { | 884 { |
| 850 m_frame->enableNavigation(); | 885 m_frame->enableNavigation(); |
| 851 } | 886 } |
| 852 | 887 |
| 853 ScopedFrameBlamer::ScopedFrameBlamer(LocalFrame* frame) | 888 ScopedFrameBlamer::ScopedFrameBlamer(LocalFrame* frame) |
| 854 : m_frame(frame) | 889 : m_frame(frame) |
| 855 { | 890 { |
| 856 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) | 891 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) |
| 857 m_frame->client()->frameBlameContext()->Enter(); | 892 m_frame->client()->frameBlameContext()->Enter(); |
| 858 } | 893 } |
| 859 | 894 |
| 860 ScopedFrameBlamer::~ScopedFrameBlamer() | 895 ScopedFrameBlamer::~ScopedFrameBlamer() |
| 861 { | 896 { |
| 862 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) | 897 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) |
| 863 m_frame->client()->frameBlameContext()->Leave(); | 898 m_frame->client()->frameBlameContext()->Leave(); |
| 864 } | 899 } |
| 865 | 900 |
| 866 } // namespace blink | 901 } // namespace blink |
| OLD | NEW |