Changeset 121707 in webkit


Ignore:
Timestamp:
Jul 2, 2012 2:47:42 PM (12 years ago)
Author:
benjamin@webkit.org
Message:

Do not do any logging initialization when logging is disabled
https://bugs.webkit.org/show_bug.cgi?id=90228

Patch by Benjamin Poulain <bpoulain@apple.com> on 2012-07-02
Reviewed by Simon Fraser.

Source/WebCore:

Initializating of the logging channels was taking time on startup. When logging is disabled
(and the LOG macro does nothing), we should aslo disable logging channels and initialization.

This patch #ifdef the Logging initialization with the macro LOG_DISABLED.

  • WebCore.exp.in:
  • make-export-file-generator: Explicitely adds Assertions.h so that LOG_DISABLED is defined.
  • platform/Logging.cpp:
  • platform/Logging.h:
  • platform/blackberry/LoggingBlackBerry.cpp:
  • platform/efl/LoggingEfl.cpp:
  • platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
  • platform/gtk/LoggingGtk.cpp:
  • platform/mac/LoggingMac.mm:
  • platform/network/soup/ResourceHandleSoup.cpp:

(WebCore::ensureSessionIsInitialized):

  • platform/qt/LoggingQt.cpp:
  • platform/win/LoggingWin.cpp:
  • platform/wx/LoggingWx.cpp:

Source/WebKit/blackberry:

  • Api/BlackBerryGlobal.cpp:

(BlackBerry::WebKit::globalInitialize):

Source/WebKit/chromium:

  • src/WebKit.cpp:

(WebKit::enableLogChannel):

Source/WebKit/efl:

  • ewk/ewk_main.cpp:

(_ewk_init_body):

Source/WebKit/gtk:

  • webkit/webkitglobals.cpp:

(webkitInit):

Source/WebKit/mac:

  • Misc/WebIconDatabase.mm:

(-[WebIconDatabase _scaleIcon:toSize:]):

  • Misc/WebKitLogging.h:
  • Misc/WebKitLogging.m:
  • WebView/WebHTMLView.mm:

(-[WebHTMLView _attributeStringFromDOMRange:]):

  • WebView/WebView.mm:

(-[WebView _commonInitializationWithFrameName:groupName:]):

Source/WebKit/qt:

  • WebCoreSupport/InitWebCoreQt.cpp:

(WebCore::initializeWebCoreQt):

Source/WebKit/win:

  • WebView.cpp:

(WebView::initWithFrame):

Source/WebKit/wx:

  • WebView.cpp:

(WebKit::WebView::Create):

Source/WebKit2:

  • Platform/Logging.cpp:
  • Platform/Logging.h:
  • UIProcess/WebContext.cpp:

(WebKit::WebContext::WebContext):

  • WebProcess/WebProcess.cpp:

(WebKit::WebProcess::WebProcess):

Location:
trunk/Source
Files:
39 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r121697 r121707  
     12012-07-02  Benjamin Poulain  <bpoulain@apple.com>
     2
     3        Do not do any logging initialization when logging is disabled
     4        https://bugs.webkit.org/show_bug.cgi?id=90228
     5
     6        Reviewed by Simon Fraser.
     7
     8        Initializating of the logging channels was taking time on startup. When logging is disabled
     9        (and the LOG macro does nothing), we should aslo disable logging channels and initialization.
     10
     11        This patch #ifdef the Logging initialization with the macro LOG_DISABLED.
     12
     13        * WebCore.exp.in:
     14        * make-export-file-generator: Explicitely adds Assertions.h so that LOG_DISABLED is defined.
     15        * platform/Logging.cpp:
     16        * platform/Logging.h:
     17        * platform/blackberry/LoggingBlackBerry.cpp:
     18        * platform/efl/LoggingEfl.cpp:
     19        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
     20        * platform/gtk/LoggingGtk.cpp:
     21        * platform/mac/LoggingMac.mm:
     22        * platform/network/soup/ResourceHandleSoup.cpp:
     23        (WebCore::ensureSessionIsInitialized):
     24        * platform/qt/LoggingQt.cpp:
     25        * platform/win/LoggingWin.cpp:
     26        * platform/wx/LoggingWx.cpp:
     27
    1282012-07-02  Dan Bernstein  <mitz@apple.com>
    229
  • trunk/Source/WebCore/WebCore.exp.in

    r121578 r121707  
    626626__ZN7WebCore32plainTextToMallocAllocatedBufferEPKNS_5RangeERjbNS_20TextIteratorBehaviorE
    627627__ZN7WebCore33stripLeadingAndTrailingHTMLSpacesERKN3WTF6StringE
    628 __ZN7WebCore36initializeLoggingChannelsIfNecessaryEv
    629628__ZN7WebCore3macERKNS_10CredentialE
    630629__ZN7WebCore3macERKNS_23AuthenticationChallengeE
     
    19771976#endif
    19781977
     1978#if !LOG_DISABLED
     1979__ZN7WebCore36initializeLoggingChannelsIfNecessaryEv
     1980#endif // !LOG_DISABLED
     1981
    19791982#if !defined(NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES) && !PLATFORM(IOS)
    19801983__ZN7WebCore7IntSizeC1ERK7_NSSize
  • trunk/Source/WebCore/make-export-file-generator

    r62608 r121707  
    3737#include "config.h"
    3838#include <stdio.h>
     39#include <wtf/Assertions.h>
    3940
    4041int main(int, char**)
  • trunk/Source/WebCore/platform/Logging.cpp

    r115165 r121707  
    2727#include "Logging.h"
    2828#include "PlatformString.h"
     29
     30#if !LOG_DISABLED
    2931
    3032namespace WebCore {
     
    150152
    151153}
     154
     155#endif // !LOG_DISABLED
  • trunk/Source/WebCore/platform/Logging.h

    r115165 r121707  
    2929#include <wtf/Assertions.h>
    3030#include <wtf/Forward.h>
     31
     32#if !LOG_DISABLED
    3133
    3234#ifndef LOG_CHANNEL_PREFIX
     
    6769}
    6870
     71#endif // !LOG_DISABLED
     72
    6973#endif // Logging_h
  • trunk/Source/WebCore/platform/blackberry/LoggingBlackBerry.cpp

    r105027 r121707  
    1919#include "config.h"
    2020#include "Logging.h"
     21
     22#if !LOG_DISABLED
    2123
    2224#include <wtf/text/WTFString.h>
     
    5456
    5557} // namespace WebCore
     58
     59#endif // !LOG_DISABLED
  • trunk/Source/WebCore/platform/efl/LoggingEfl.cpp

    r102235 r121707  
    2323#include "config.h"
    2424#include "Logging.h"
     25
     26#if !LOG_DISABLED
    2527
    2628#include "PlatformString.h"
     
    6365
    6466}
     67
     68#endif // !LOG_DISABLED
  • trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp

    r121575 r121707  
    17201720
    17211721            // Turn off text overlay unless logging is enabled.
     1722#if LOG_DISABLED
     1723            g_object_set(m_fpsSink, "text-overlay", FALSE , NULL);
     1724#else
    17221725            WTFLogChannel* channel = getChannelFromName("Media");
    17231726            if (channel->state != WTFLogChannelOn)
    17241727                g_object_set(m_fpsSink, "text-overlay", FALSE , NULL);
     1728#endif // LOG_DISABLED
    17251729
    17261730            if (g_object_class_find_property(G_OBJECT_GET_CLASS(m_fpsSink), "video-sink")) {
  • trunk/Source/WebCore/platform/gtk/LoggingGtk.cpp

    r102235 r121707  
    2121#include "config.h"
    2222#include "Logging.h"
     23
     24#if !LOG_DISABLED
     25
    2326#include "PlatformString.h"
    24 
    2527#include <glib.h>
    2628#include <string.h>
     
    6365
    6466} // namespace WebCore
     67
     68#endif // !LOG_DISABLED
  • trunk/Source/WebCore/platform/mac/LoggingMac.mm

    r115165 r121707  
    2727
    2828#include "Logging.h"
     29
     30#if !LOG_DISABLED
    2931
    3032namespace WebCore {
     
    7880
    7981}
     82
     83#endif // !LOG_DISABLED
  • trunk/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp

    r121437 r121707  
    201201    }
    202202
     203#if !LOG_DISABLED
    203204    if (!soup_session_get_feature(session, SOUP_TYPE_LOGGER) && LogNetwork.state == WTFLogChannelOn) {
    204205        SoupLogger* logger = soup_logger_new(static_cast<SoupLoggerLogLevel>(SOUP_LOGGER_LOG_BODY), -1);
     
    206207        g_object_unref(logger);
    207208    }
     209#endif // !LOG_DISABLED
    208210
    209211    if (!soup_session_get_feature(session, SOUP_TYPE_REQUESTER)) {
  • trunk/Source/WebCore/platform/qt/LoggingQt.cpp

    r102235 r121707  
    2020#include "config.h"
    2121#include "Logging.h"
     22
     23#if !LOG_DISABLED
    2224
    2325#include "PlatformString.h"
     
    5557
    5658} // namespace WebCore
     59
     60#endif // !LOG_DISABLED
  • trunk/Source/WebCore/platform/win/LoggingWin.cpp

    r102235 r121707  
    2626#include "config.h"
    2727#include "Logging.h"
     28
     29#if !LOG_DISABLED
    2830
    2931#include "PlatformString.h"
     
    103105
    104106} // namespace WebCore
     107
     108#endif // !LOG_DISABLED
  • trunk/Source/WebCore/platform/wx/LoggingWx.cpp

    r102235 r121707  
    2626#include "config.h"
    2727#include "Logging.h"
     28
     29#if !LOG_DISABLED
    2830
    2931#include "PlatformString.h"
     
    6365
    6466}
     67
     68#endif // !LOG_DISABLED
  • trunk/Source/WebKit/blackberry/Api/BlackBerryGlobal.cpp

    r121381 r121707  
    6161#endif
    6262
     63#if !LOG_DISABLED
    6364    // Turn on logging.
    6465    initializeLoggingChannelsIfNecessary();
     66#endif // !LOG_DISABLED
    6567
    6668    // Initialize threading/
  • trunk/Source/WebKit/blackberry/ChangeLog

    r121634 r121707  
     12012-07-02  Benjamin Poulain  <bpoulain@apple.com>
     2
     3        Do not do any logging initialization when logging is disabled
     4        https://bugs.webkit.org/show_bug.cgi?id=90228
     5
     6        Reviewed by Simon Fraser.
     7
     8        * Api/BlackBerryGlobal.cpp:
     9        (BlackBerry::WebKit::globalInitialize):
     10
    1112012-07-01  George Staikos  <staikos@webkit.org>
    212
  • trunk/Source/WebKit/chromium/ChangeLog

    r121655 r121707  
     12012-07-02  Benjamin Poulain  <bpoulain@apple.com>
     2
     3        Do not do any logging initialization when logging is disabled
     4        https://bugs.webkit.org/show_bug.cgi?id=90228
     5
     6        Reviewed by Simon Fraser.
     7
     8        * src/WebKit.cpp:
     9        (WebKit::enableLogChannel):
     10
    1112012-07-01  Keishi Hattori  <keishi@webkit.org>
    212
  • trunk/Source/WebKit/chromium/src/WebKit.cpp

    r120318 r121707  
    5151#include <wtf/MainThread.h>
    5252#include <wtf/Threading.h>
     53#include <wtf/UnusedParam.h>
    5354#include <wtf/text/AtomicString.h>
    5455
     
    186187void enableLogChannel(const char* name)
    187188{
     189#if !LOG_DISABLED
    188190    WTFLogChannel* channel = WebCore::getChannelFromName(name);
    189191    if (channel)
    190192        channel->state = WTFLogChannelOn;
     193#else
     194    UNUSED_PARAM(name);
     195#endif // !LOG_DISABLED
    191196}
    192197
  • trunk/Source/WebKit/efl/ChangeLog

    r121679 r121707  
     12012-07-02  Benjamin Poulain  <bpoulain@apple.com>
     2
     3        Do not do any logging initialization when logging is disabled
     4        https://bugs.webkit.org/show_bug.cgi?id=90228
     5
     6        Reviewed by Simon Fraser.
     7
     8        * ewk/ewk_main.cpp:
     9        (_ewk_init_body):
     10
    1112012-07-02  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
    212
  • trunk/Source/WebKit/efl/ewk/ewk_main.cpp

    r119233 r121707  
    147147
    148148    WebCore::ScriptController::initializeThreading();
     149#if !LOG_DISABLED
    149150    WebCore::initializeLoggingChannelsIfNecessary();
     151#endif // !LOG_DISABLED
    150152    WebCore::Settings::setDefaultMinDOMTimerInterval(0.004);
    151153
  • trunk/Source/WebKit/gtk/ChangeLog

    r121568 r121707  
     12012-07-02  Benjamin Poulain  <bpoulain@apple.com>
     2
     3        Do not do any logging initialization when logging is disabled
     4        https://bugs.webkit.org/show_bug.cgi?id=90228
     5
     6        Reviewed by Simon Fraser.
     7
     8        * webkit/webkitglobals.cpp:
     9        (webkitInit):
     10
    1112012-06-29  Tony Chang  <tony@chromium.org>
    212
  • trunk/Source/WebKit/gtk/webkit/webkitglobals.cpp

    r113147 r121707  
    505505    WTF::initializeMainThread();
    506506
     507#if !LOG_DISABLED
    507508    WebCore::initializeLoggingChannelsIfNecessary();
     509#endif // !LOG_DISABLED
    508510    PlatformStrategiesGtk::initialize();
    509511
  • trunk/Source/WebKit/mac/ChangeLog

    r121646 r121707  
     12012-07-02  Benjamin Poulain  <bpoulain@apple.com>
     2
     3        Do not do any logging initialization when logging is disabled
     4        https://bugs.webkit.org/show_bug.cgi?id=90228
     5
     6        Reviewed by Simon Fraser.
     7
     8        * Misc/WebIconDatabase.mm:
     9        (-[WebIconDatabase _scaleIcon:toSize:]):
     10        * Misc/WebKitLogging.h:
     11        * Misc/WebKitLogging.m:
     12        * WebView/WebHTMLView.mm:
     13        (-[WebHTMLView _attributeStringFromDOMRange:]):
     14        * WebView/WebView.mm:
     15        (-[WebView _commonInitializationWithFrameName:groupName:]):
     16
    1172012-07-01  Timothy Hatcher  <timothy@apple.com>
    218
  • trunk/Source/WebKit/mac/Misc/WebIconDatabase.mm

    r105552 r121707  
    442442    ASSERT(size.height);
    443443   
    444 #if !LOG_DISABLED       
     444#if !LOG_DISABLED
    445445    double start = CFAbsoluteTimeGetCurrent();
    446446#endif
  • trunk/Source/WebKit/mac/Misc/WebKitLogging.h

    r39455 r121707  
    3737#endif
    3838
     39#if !LOG_DISABLED
    3940extern WTFLogChannel WebKitLogTiming;
    4041extern WTFLogChannel WebKitLogLoading;
     
    6364
    6465void WebKitInitializeLoggingChannelsIfNecessary(void);
     66#endif // !LOG_DISABLED
    6567
    6668// FIXME: Why is this in the "logging" header file?
  • trunk/Source/WebKit/mac/Misc/WebKitLogging.m

    r39455 r121707  
    2828
    2929#import "WebKitLogging.h"
     30
     31#if !LOG_DISABLED
    3032
    3133WTFLogChannel WebKitLogTextInput =              { 0x00000010, "WebKitLogLevel", WTFLogChannelOff };
     
    99101    initializeLogChannel(&WebKitLogTextInput);
    100102}
     103#endif // !LOG_DISABLED
    101104
    102105void ReportDiscardedDelegateException(SEL delegateSelector, id exception)
  • trunk/Source/WebKit/mac/WebView/WebHTMLView.mm

    r121536 r121707  
    61416141{
    61426142    NSAttributedString *attributedString;
    6143 #if !LOG_DISABLED       
     6143#if !LOG_DISABLED
    61446144    double start = CFAbsoluteTimeGetCurrent();
    61456145#endif   
  • trunk/Source/WebKit/mac/WebView/WebView.mm

    r121536 r121707  
    724724    static bool didOneTimeInitialization = false;
    725725    if (!didOneTimeInitialization) {
     726#if !LOG_DISABLED
    726727        WebKitInitializeLoggingChannelsIfNecessary();
    727728        WebCore::initializeLoggingChannelsIfNecessary();
     729#endif // !LOG_DISABLED
    728730        [WebHistoryItem initWindowWatcherIfNecessary];
    729731#if ENABLE(SQL_DATABASE)
  • trunk/Source/WebKit/qt/ChangeLog

    r121555 r121707  
     12012-07-02  Benjamin Poulain  <bpoulain@apple.com>
     2
     3        Do not do any logging initialization when logging is disabled
     4        https://bugs.webkit.org/show_bug.cgi?id=90228
     5
     6        Reviewed by Simon Fraser.
     7
     8        * WebCoreSupport/InitWebCoreQt.cpp:
     9        (WebCore::initializeWebCoreQt):
     10
    1112012-06-29  Konrad Piascik  <kpiascik@rim.com>
    212
  • trunk/Source/WebKit/qt/WebCoreSupport/InitWebCoreQt.cpp

    r114042 r121707  
    6767        return;
    6868
     69#if !LOG_DISABLED
    6970    WebCore::initializeLoggingChannelsIfNecessary();
     71#endif // !LOG_DISABLED
    7072    ScriptController::initializeThreading();
    7173    WTF::initializeMainThread();
  • trunk/Source/WebKit/win/ChangeLog

    r121597 r121707  
     12012-07-02  Benjamin Poulain  <bpoulain@apple.com>
     2
     3        Do not do any logging initialization when logging is disabled
     4        https://bugs.webkit.org/show_bug.cgi?id=90228
     5
     6        Reviewed by Simon Fraser.
     7
     8        * WebView.cpp:
     9        (WebView::initWithFrame):
     10
    1112012-06-29  Mihai Balan  <mibalan@adobe.com>
    212
  • trunk/Source/WebKit/win/WebView.cpp

    r121597 r121707  
    26422642    static bool didOneTimeInitialization;
    26432643    if (!didOneTimeInitialization) {
     2644#if !LOG_DISABLED
    26442645        initializeLoggingChannelsIfNecessary();
     2646#endif // !LOG_DISABLED
    26452647#if ENABLE(SQL_DATABASE)
    26462648        WebKitInitializeWebDatabasesIfNecessary();
  • trunk/Source/WebKit/wx/ChangeLog

    r119192 r121707  
     12012-07-02  Benjamin Poulain  <bpoulain@apple.com>
     2
     3        Do not do any logging initialization when logging is disabled
     4        https://bugs.webkit.org/show_bug.cgi?id=90228
     5
     6        Reviewed by Simon Fraser.
     7
     8        * WebView.cpp:
     9        (WebKit::WebView::Create):
     10
    1112012-05-31  Hajime Morrita  <morrita@chromium.org>
    212
  • trunk/Source/WebKit/wx/WebView.cpp

    r116863 r121707  
    390390    m_impl = new WebViewPrivate();
    391391
    392     WebCore::initializeLoggingChannelsIfNecessary();   
     392#if !LOG_DISABLED
     393    WebCore::initializeLoggingChannelsIfNecessary();
     394#endif // !LOG_DISABLED
    393395    WebCore::HTMLFrameOwnerElement* parentFrame = 0;
    394396
  • trunk/Source/WebKit2/ChangeLog

    r121698 r121707  
     12012-07-02  Benjamin Poulain  <bpoulain@apple.com>
     2
     3        Do not do any logging initialization when logging is disabled
     4        https://bugs.webkit.org/show_bug.cgi?id=90228
     5
     6        Reviewed by Simon Fraser.
     7
     8        * Platform/Logging.cpp:
     9        * Platform/Logging.h:
     10        * UIProcess/WebContext.cpp:
     11        (WebKit::WebContext::WebContext):
     12        * WebProcess/WebProcess.cpp:
     13        (WebKit::WebProcess::WebProcess):
     14
    1152012-07-02  No'am Rosenthal  <noam.rosenthal@nokia.com>
    216
  • trunk/Source/WebKit2/Platform/Logging.cpp

    r119517 r121707  
    9191} // namespace WebKit
    9292
    93 #endif // LOG_DISABLED
     93#endif // !LOG_DISABLED
  • trunk/Source/WebKit2/Platform/Logging.h

    r119517 r121707  
    5353} // namespace WebKit
    5454
    55 #endif // LOG_DISABLED
     55#endif // !LOG_DISABLED
    5656
    5757#endif // Logging_h
  • trunk/Source/WebKit2/UIProcess/WebContext.cpp

    r118934 r121707  
    158158    addLanguageChangeObserver(this, languageChanged);
    159159
     160#if !LOG_DISABLED
    160161    WebCore::initializeLoggingChannelsIfNecessary();
     162#endif // !LOG_DISABLED
    161163
    162164#ifndef NDEBUG
  • trunk/Source/WebKit2/WebProcess/WebProcess.cpp

    r121381 r121707  
    162162#endif // USE(PLATFORM_STRATEGIES)
    163163
     164#if !LOG_DISABLED
    164165    WebCore::initializeLoggingChannelsIfNecessary();
     166#endif // !LOG_DISABLED
    165167}
    166168
Note: See TracChangeset for help on using the changeset viewer.