Changeset 155217 in webkit


Ignore:
Timestamp:
Sep 6, 2013 3:08:14 PM (11 years ago)
Author:
akling@apple.com
Message:

Include Frame.h in fewer places.
<https://webkit.org/b/120868>

Reviewed by Anders Carlsson.

  • Move JSMainThreadExecState::instrumentFunctionCall() to a separate header. This avoids including InspectorInstrumentation.h from JSMainThreadExecState.h which caused all JS and Objective-C bindings to depend on Frame.h
  • Out-of-line the three methods on FrameView that were operating on Frames. Most of the call sites were in FrameView.cpp so they will still get inlined.
  • Removed GenericBinding.h, nothing was using it anyway.

After this, touching Frame.h and doing a (debug) rebuild goes from 9m30 to 3m30
on my laptop.

  • GNUmakefile.list.am:
  • WebCore.exp.in:
  • WebCore.vcxproj/WebCore.vcxproj:
  • WebCore.vcxproj/WebCore.vcxproj.filters:
  • WebCore.xcodeproj/project.pbxproj:
  • bindings/generic/GenericBinding.h: Removed.
  • bindings/js/JSCallbackData.cpp:
  • bindings/js/JSEventListener.cpp:
  • bindings/js/JSMainThreadExecState.h:
  • bindings/js/JSMainThreadExecStateInstrumentation.h: Added.

(WebCore::JSMainThreadExecState::instrumentFunctionCall):

  • bindings/js/JSMutationCallback.cpp:
  • bindings/js/ScheduledAction.cpp:
  • css/DeprecatedStyleBuilder.cpp:
  • css/ElementRuleCollector.cpp:
  • css/MediaQueryEvaluator.cpp:
  • css/SelectorChecker.h:
  • dom/StyledElement.cpp:
  • html/HTMLPlugInImageElement.cpp:
  • inspector/InspectorPageAgent.h:
  • inspector/NetworkResourcesData.h:
  • inspector/PageRuntimeAgent.cpp:
  • loader/cache/CachedImage.cpp:
  • page/FrameView.cpp:

(WebCore::FrameView::renderView):
(WebCore::FrameView::mapFromLayoutToCSSUnits):
(WebCore::FrameView::mapFromCSSToLayoutUnits):

  • page/FrameView.h:
  • page/TouchAdjustment.cpp:
  • rendering/RenderBoxModelObject.cpp:
  • rendering/RenderLayer.cpp:
  • rendering/RenderLayerCompositor.h:
  • rendering/RenderText.cpp:
  • svg/graphics/SVGImage.cpp:
Location:
trunk/Source
Files:
1 added
1 deleted
31 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r155215 r155217  
     12013-09-06  Andreas Kling  <akling@apple.com>
     2
     3        Include Frame.h in fewer places.
     4        <https://webkit.org/b/120868>
     5
     6        Reviewed by Anders Carlsson.
     7
     8        - Move JSMainThreadExecState::instrumentFunctionCall() to a separate header.
     9          This avoids including InspectorInstrumentation.h from JSMainThreadExecState.h
     10          which caused all JS and Objective-C bindings to depend on Frame.h
     11
     12        - Out-of-line the three methods on FrameView that were operating on Frames.
     13          Most of the call sites were in FrameView.cpp so they will still get inlined.
     14
     15        - Removed GenericBinding.h, nothing was using it anyway.
     16
     17        After this, touching Frame.h and doing a (debug) rebuild goes from 9m30 to 3m30
     18        on my laptop.
     19
     20        * GNUmakefile.list.am:
     21        * WebCore.exp.in:
     22        * WebCore.vcxproj/WebCore.vcxproj:
     23        * WebCore.vcxproj/WebCore.vcxproj.filters:
     24        * WebCore.xcodeproj/project.pbxproj:
     25        * bindings/generic/GenericBinding.h: Removed.
     26        * bindings/js/JSCallbackData.cpp:
     27        * bindings/js/JSEventListener.cpp:
     28        * bindings/js/JSMainThreadExecState.h:
     29        * bindings/js/JSMainThreadExecStateInstrumentation.h: Added.
     30        (WebCore::JSMainThreadExecState::instrumentFunctionCall):
     31        * bindings/js/JSMutationCallback.cpp:
     32        * bindings/js/ScheduledAction.cpp:
     33        * css/DeprecatedStyleBuilder.cpp:
     34        * css/ElementRuleCollector.cpp:
     35        * css/MediaQueryEvaluator.cpp:
     36        * css/SelectorChecker.h:
     37        * dom/StyledElement.cpp:
     38        * html/HTMLPlugInImageElement.cpp:
     39        * inspector/InspectorPageAgent.h:
     40        * inspector/NetworkResourcesData.h:
     41        * inspector/PageRuntimeAgent.cpp:
     42        * loader/cache/CachedImage.cpp:
     43        * page/FrameView.cpp:
     44        (WebCore::FrameView::renderView):
     45        (WebCore::FrameView::mapFromLayoutToCSSUnits):
     46        (WebCore::FrameView::mapFromCSSToLayoutUnits):
     47        * page/FrameView.h:
     48        * page/TouchAdjustment.cpp:
     49        * rendering/RenderBoxModelObject.cpp:
     50        * rendering/RenderLayer.cpp:
     51        * rendering/RenderLayerCompositor.h:
     52        * rendering/RenderText.cpp:
     53        * svg/graphics/SVGImage.cpp:
     54
    1552013-09-06  Brent Fulgham  <bfulgham@apple.com>
    256
  • trunk/Source/WebCore/GNUmakefile.list.am

    r155211 r155217  
    22802280        Source/WebCore/bindings/generic/BindingSecurity.cpp \
    22812281        Source/WebCore/bindings/generic/BindingSecurity.h \
    2282         Source/WebCore/bindings/generic/GenericBinding.h \
    22832282        Source/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp \
    22842283        Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h \
  • trunk/Source/WebCore/WebCore.exp.in

    r155174 r155217  
    16721672__ZNK7WebCore9FrameTree4findERKN3WTF12AtomicStringE
    16731673__ZNK7WebCore9FrameTree6parentEv
     1674__ZNK7WebCore9FrameView10renderViewEv
    16741675__ZNK7WebCore9FrameView11needsLayoutEv
    16751676__ZNK7WebCore9FrameView13isTransparentEv
  • trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj

    r155215 r155217  
    2071820718    <ClInclude Include="..\bindings\generic\ActiveDOMCallback.h" />
    2071920719    <ClInclude Include="..\bindings\generic\BindingSecurity.h" />
    20720     <ClInclude Include="..\bindings\generic\GenericBinding.h" />
    2072120720    <ClInclude Include="..\bindings\generic\RuntimeEnabledFeatures.h" />
    2072220721    <ClInclude Include="..\bindings\js\ArrayValue.h" />
  • trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters

    r155215 r155217  
    1156311563      <Filter>bindings\generic</Filter>
    1156411564    </ClInclude>
    11565     <ClInclude Include="..\bindings\generic\GenericBinding.h">
    11566       <Filter>bindings\generic</Filter>
    11567     </ClInclude>
    1156811565    <ClInclude Include="..\bindings\generic\RuntimeEnabledFeatures.h">
    1156911566      <Filter>bindings\generic</Filter>
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r155211 r155217  
    34953495                A6148A7812E41E3B0044A784 /* JSHTMLKeygenElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A6148A7612E41E3B0044A784 /* JSHTMLKeygenElement.cpp */; };
    34963496                A6148A7912E41E3B0044A784 /* JSHTMLKeygenElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A6148A7712E41E3B0044A784 /* JSHTMLKeygenElement.h */; };
    3497                 A622A8FF122C44A600A785B3 /* GenericBinding.h in Headers */ = {isa = PBXBuildFile; fileRef = A622A8F9122C44A600A785B3 /* GenericBinding.h */; };
    34983497                A6D169621346B49B000EB770 /* ShadowRoot.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A6D169611346B49B000EB770 /* ShadowRoot.cpp */; };
    34993498                A6D169641346B4C1000EB770 /* ShadowRoot.h in Headers */ = {isa = PBXBuildFile; fileRef = A6D169631346B4C1000EB770 /* ShadowRoot.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    1009610095                A6148A7712E41E3B0044A784 /* JSHTMLKeygenElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSHTMLKeygenElement.h; sourceTree = "<group>"; };
    1009710096                A6148A7F12E41ED10044A784 /* HTMLKeygenElement.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = HTMLKeygenElement.idl; sourceTree = "<group>"; };
    10098                 A622A8F9122C44A600A785B3 /* GenericBinding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GenericBinding.h; path = generic/GenericBinding.h; sourceTree = "<group>"; };
    1009910097                A6D169611346B49B000EB770 /* ShadowRoot.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ShadowRoot.cpp; sourceTree = "<group>"; };
    1010010098                A6D169631346B4C1000EB770 /* ShadowRoot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShadowRoot.h; sourceTree = "<group>"; };
     
    1144911447                B562DB5E17D3CD560010AF96 /* HTMLElementTypeHelpers.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HTMLElementTypeHelpers.h; sourceTree = "<group>"; };
    1145011448                B562DB5F17D3CD560010AF96 /* SVGElementTypeHelpers.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGElementTypeHelpers.h; sourceTree = "<group>"; };
     11449                B56576E417DA599F00A56BDC /* JSMainThreadExecStateInstrumentation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMainThreadExecStateInstrumentation.h; sourceTree = "<group>"; };
    1145111450                B58CEB6711913607002A6790 /* JSDatabaseSync.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDatabaseSync.h; sourceTree = "<group>"; };
    1145211451                B58CEB6811913607002A6790 /* JSDatabaseSync.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDatabaseSync.cpp; sourceTree = "<group>"; };
     
    1905419053                                973AA3F715D0891B00E38A85 /* BindingSecurity.cpp */,
    1905519054                                973AA3F815D0891B00E38A85 /* BindingSecurity.h */,
    19056                                 A622A8F9122C44A600A785B3 /* GenericBinding.h */,
    1905719055                        );
    1905819056                        name = generic;
     
    1913919137                                8F934D841189F1EE00508D5D /* JSMainThreadExecState.cpp */,
    1914019138                                8F934D831189F1EE00508D5D /* JSMainThreadExecState.h */,
     19139                                B56576E417DA599F00A56BDC /* JSMainThreadExecStateInstrumentation.h */,
    1914119140                                C6F420A016B7164E0052A9F2 /* JSMutationCallback.cpp */,
    1914219141                                C6F420A116B7164E0052A9F2 /* JSMutationCallback.h */,
     
    2236922368                                BC23F0DB0DAFF4A4009FDC91 /* GeneratedImage.h in Headers */,
    2237022369                                2D481F04146B5C6B00AA7834 /* GeneratorGeneratedImage.h in Headers */,
    22371                                 A622A8FF122C44A600A785B3 /* GenericBinding.h in Headers */,
    2237222370                                0720B0A114D3323500642955 /* GenericEventQueue.h in Headers */,
    2237322371                                9746AF2414F4DDE6003E7A70 /* Geolocation.h in Headers */,
  • trunk/Source/WebCore/bindings/js/JSCallbackData.cpp

    r153872 r155217  
    3333#include "JSDOMBinding.h"
    3434#include "JSMainThreadExecState.h"
     35#include "JSMainThreadExecStateInstrumentation.h"
    3536
    3637using namespace JSC;
  • trunk/Source/WebCore/bindings/js/JSEventListener.cpp

    r154962 r155217  
    2727#include "JSEventTarget.h"
    2828#include "JSMainThreadExecState.h"
     29#include "JSMainThreadExecStateInstrumentation.h"
    2930#include "ScriptController.h"
    3031#include "WorkerGlobalScope.h"
  • trunk/Source/WebCore/bindings/js/JSMainThreadExecState.h

    r154629 r155217  
    2727#define JSMainThreadExecState_h
    2828
    29 #include "InspectorInstrumentation.h"
    3029#include "JSDOMBinding.h"
    3130#include <runtime/Completion.h>
     
    3736namespace WebCore {
    3837
     38class InspectorInstrumentationCookie;
    3939class ScriptExecutionContext;
    4040
     
    5454    };
    5555
    56     static inline InspectorInstrumentationCookie instrumentFunctionCall(ScriptExecutionContext* context, JSC::CallType callType, const JSC::CallData& callData)
    57     {
    58         if (!InspectorInstrumentation::timelineAgentEnabled(context))
    59             return InspectorInstrumentationCookie();
    60         String resourceName;
    61         int lineNumber = 1;
    62         if (callType == JSC::CallTypeJS) {
    63             resourceName = callData.js.functionExecutable->sourceURL();
    64             lineNumber = callData.js.functionExecutable->lineNo();
    65         } else
    66             resourceName = "undefined";
    67         return InspectorInstrumentation::willCallFunction(context, resourceName, lineNumber);
    68     }
     56    static InspectorInstrumentationCookie instrumentFunctionCall(ScriptExecutionContext*, JSC::CallType, const JSC::CallData&);
    6957
    7058    static JSC::JSValue evaluate(JSC::ExecState* exec, const JSC::SourceCode& source, JSC::JSValue thisValue, JSC::JSValue* exception)
  • trunk/Source/WebCore/bindings/js/JSMutationCallback.cpp

    r148696 r155217  
    3030#include "JSDOMGlobalObject.h"
    3131#include "JSMainThreadExecState.h"
     32#include "JSMainThreadExecStateInstrumentation.h"
    3233#include "JSMutationObserver.h"
    3334#include "JSMutationRecord.h"
  • trunk/Source/WebCore/bindings/js/ScheduledAction.cpp

    r154192 r155217  
    3333#include "JSDOMWindow.h"
    3434#include "JSMainThreadExecState.h"
     35#include "JSMainThreadExecStateInstrumentation.h"
    3536#include "ScriptController.h"
    3637#include "ScriptExecutionContext.h"
  • trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp

    r155119 r155217  
    3939#include "Document.h"
    4040#include "Element.h"
     41#include "Frame.h"
    4142#include "Pair.h"
    4243#include "Rect.h"
  • trunk/Source/WebCore/css/ElementRuleCollector.cpp

    r155109 r155217  
    3737#include "CSSValueKeywords.h"
    3838#include "HTMLElement.h"
     39#include "InspectorInstrumentation.h"
    3940#include "RenderRegion.h"
    4041#include "SVGElement.h"
  • trunk/Source/WebCore/css/MediaQueryEvaluator.cpp

    r154658 r155217  
    4040#include "Frame.h"
    4141#include "FrameView.h"
     42#include "InspectorInstrumentation.h"
    4243#include "IntRect.h"
    4344#include "MediaFeatureNames.h"
  • trunk/Source/WebCore/css/SelectorChecker.h

    r154887 r155217  
    3030
    3131#include "CSSSelector.h"
    32 #include "InspectorInstrumentation.h"
     32#include "Element.h"
    3333#include "SpaceSplitString.h"
    3434#include <wtf/HashSet.h>
  • trunk/Source/WebCore/dom/StyledElement.cpp

    r154877 r155217  
    3838#include "HTMLNames.h"
    3939#include "HTMLParserIdioms.h"
     40#include "InspectorInstrumentation.h"
    4041#include "PropertySetCSSStyleDeclaration.h"
    4142#include "ScriptableDocumentParser.h"
  • trunk/Source/WebCore/html/HTMLPlugInImageElement.cpp

    r155194 r155217  
    3838#include "NodeList.h"
    3939#include "NodeRenderStyle.h"
     40#include "Page.h"
    4041#include "PlugInClient.h"
    4142#include "PluginViewBase.h"
  • trunk/Source/WebCore/inspector/InspectorPageAgent.h

    r154828 r155217  
    3535
    3636#include "DeviceOrientationData.h"
    37 #include "Frame.h"
    3837#include "GeolocationPosition.h"
    3938#include "InspectorBaseAgent.h"
    4039#include "InspectorFrontend.h"
     40#include "IntSize.h"
     41#include "LayoutRect.h"
    4142#include <wtf/HashMap.h>
    4243#include <wtf/RefCounted.h>
  • trunk/Source/WebCore/inspector/NetworkResourcesData.h

    r148921 r155217  
    3232#include "HTTPHeaderMap.h"
    3333#include "InspectorPageAgent.h"
     34#include "KURL.h"
    3435#include "TextResourceDecoder.h"
    3536#include <wtf/Deque.h>
     
    4546class CachedResource;
    4647class FormData;
     48class ResourceResponse;
    4749class SharedBuffer;
    4850class TextResourceDecoder;
  • trunk/Source/WebCore/inspector/PageRuntimeAgent.cpp

    r154658 r155217  
    3636
    3737#include "Document.h"
     38#include "Frame.h"
    3839#include "InjectedScript.h"
    3940#include "InjectedScriptManager.h"
  • trunk/Source/WebCore/loader/cache/CachedImage.cpp

    r154858 r155217  
    3030#include "CachedResourceClientWalker.h"
    3131#include "CachedResourceLoader.h"
     32#include "Frame.h"
     33#include "FrameLoader.h"
    3234#include "FrameLoaderClient.h"
    3335#include "FrameLoaderTypes.h"
  • trunk/Source/WebCore/page/FrameView.cpp

    r155174 r155217  
    42284228}
    42294229
     4230RenderView* FrameView::renderView() const
     4231{
     4232    return frame().contentRenderer();
     4233}
     4234
     4235int FrameView::mapFromLayoutToCSSUnits(LayoutUnit value) const
     4236{
     4237    return value / (frame().pageZoomFactor() * frame().frameScaleFactor());
     4238}
     4239
     4240LayoutUnit FrameView::mapFromCSSToLayoutUnits(int value) const
     4241{
     4242    return value * frame().pageZoomFactor() * frame().frameScaleFactor();
     4243}
     4244
    42304245} // namespace WebCore
  • trunk/Source/WebCore/page/FrameView.h

    r155174 r155217  
    2828#include "AdjustViewSizeOrNot.h"
    2929#include "Color.h"
    30 #include "Frame.h"
     30#include "LayoutMilestones.h"
    3131#include "LayoutRect.h"
    3232#include "Pagination.h"
     
    4343class Event;
    4444class FloatSize;
     45class Frame;
    4546class FrameActionScheduler;
     47class HTMLFrameOwnerElement;
    4648class KURL;
    4749class Node;
     
    5355class RenderScrollbarPart;
    5456class RenderStyle;
     57class RenderView;
    5558
    5659Pagination::Mode paginationModeForRenderStyle(RenderStyle*);
     
    7982    Frame& frame() const { return *m_frame; }
    8083
    81     RenderView* renderView() const { return frame().contentRenderer(); }
    82 
    83     int mapFromLayoutToCSSUnits(LayoutUnit);
    84     LayoutUnit mapFromCSSToLayoutUnits(int);
     84    RenderView* renderView() const;
     85
     86    int mapFromLayoutToCSSUnits(LayoutUnit) const;
     87    LayoutUnit mapFromCSSToLayoutUnits(int) const;
    8588
    8689    LayoutUnit marginWidth() const { return m_margins.width(); } // -1 means default
     
    698701}
    699702
    700 inline int FrameView::mapFromLayoutToCSSUnits(LayoutUnit value)
    701 {
    702     return value / (frame().pageZoomFactor() * frame().frameScaleFactor());
    703 }
    704 
    705 inline LayoutUnit FrameView::mapFromCSSToLayoutUnits(int value)
    706 {
    707     return value * frame().pageZoomFactor() * frame().frameScaleFactor();
    708 }
    709 
    710703inline FrameView* toFrameView(Widget* widget)
    711704{
  • trunk/Source/WebCore/page/TouchAdjustment.cpp

    r155074 r155217  
    2626#include "FloatPoint.h"
    2727#include "FloatQuad.h"
     28#include "Frame.h"
    2829#include "FrameView.h"
    2930#include "HTMLFrameOwnerElement.h"
  • trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp

    r155077 r155217  
    2727#include "RenderBoxModelObject.h"
    2828
     29#include "Frame.h"
    2930#include "GraphicsContext.h"
    3031#include "HTMLFrameOwnerElement.h"
  • trunk/Source/WebCore/rendering/RenderLayer.cpp

    r155131 r155217  
    7373#include "HitTestRequest.h"
    7474#include "HitTestResult.h"
     75#include "InspectorInstrumentation.h"
    7576#include "OverflowEvent.h"
    7677#include "OverlapTestRequestClient.h"
  • trunk/Source/WebCore/rendering/RenderLayerCompositor.h

    r154937 r155217  
    3030
    3131#include "ChromeClient.h"
    32 #include "Frame.h"
    3332#include "GraphicsLayerClient.h"
    3433#include "GraphicsLayerUpdater.h"
     
    4948#endif
    5049class TiledBacking;
     50
     51typedef unsigned LayerTreeFlags;
    5152
    5253enum CompositingUpdateType {
  • trunk/Source/WebCore/rendering/RenderText.cpp

    r154937 r155217  
    3030#include "FloatQuad.h"
    3131#include "FontTranscoder.h"
     32#include "Frame.h"
    3233#include "FrameView.h"
    3334#include "Hyphenation.h"
  • trunk/Source/WebCore/svg/graphics/SVGImage.cpp

    r155174 r155217  
    3434#include "DocumentLoader.h"
    3535#include "ElementIterator.h"
     36#include "Frame.h"
    3637#include "FrameView.h"
    3738#include "ImageBuffer.h"
  • trunk/Source/WebKit/efl/ewk/ewk_paint_context.cpp

    r154184 r155217  
    2121#include "config.h"
    2222
     23#include "Frame.h"
    2324#include "TiledBackingStore.h"
    2425#include "ewk_paint_context_private.h"
  • trunk/Source/WebKit/mac/WebView/WebDynamicScrollBarsView.mm

    r154314 r155217  
    3030#import "WebFrameView.h"
    3131#import "WebHTMLViewInternal.h"
     32#import <WebCore/Frame.h>
    3233#import <WebCore/FrameView.h>
    3334#import <WebKitSystemInterface.h>
Note: See TracChangeset for help on using the changeset viewer.