⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 232158 in webkit


Ignore:
Timestamp:
May 24, 2018, 12:23:00 PM (8 years ago)
Author:
Chris Dumez
Message:

Some of the work in initializeLogChannelsIfNecessary() is unnecessary for release builds
​https://bugs.webkit.org/show_bug.cgi?id=185951

Reviewed by Geoffrey Garen.

Some of the work in initializeLogChannelsIfNecessary() is unnecessary for release builds and slows down
launch time. In particular, it is unnecessary to read NSDefaults to figure out which logging channels
should be enabled.

Source/WebCore:

  • platform/mac/LoggingMac.mm:

(WebCore::logLevelString):

  • platform/unix/LoggingUnix.cpp:

(WebCore::logLevelString):

  • platform/win/LoggingWin.cpp:

(WebCore::logLevelString):

Source/WebCore/PAL:

  • pal/cocoa/LoggingCocoa.mm:

(PAL::logLevelString):

  • pal/unix/LoggingUnix.cpp:

(PAL::logLevelString):

  • pal/win/LoggingWin.cpp:

(PAL::logLevelString):

Source/WebKit:

  • Platform/foundation/LoggingFoundation.mm:

(WebKit::logLevelString):

  • Platform/unix/LoggingUnix.cpp:

(WebKit::logLevelString):

  • Platform/win/LoggingWin.cpp:

(WebKit::logLevelString):

Location:
trunk/Source
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r232156 r232158  
     12018-05-24  Chris Dumez  <cdumez@apple.com>
     2
     3        Some of the work in initializeLogChannelsIfNecessary() is unnecessary for release builds
     4        https://bugs.webkit.org/show_bug.cgi?id=185951
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        Some of the work in initializeLogChannelsIfNecessary() is unnecessary for release builds and slows down
     9        launch time. In particular, it is unnecessary to read NSDefaults to figure out which logging channels
     10        should be enabled.
     11
     12        * platform/mac/LoggingMac.mm:
     13        (WebCore::logLevelString):
     14        * platform/unix/LoggingUnix.cpp:
     15        (WebCore::logLevelString):
     16        * platform/win/LoggingWin.cpp:
     17        (WebCore::logLevelString):
     18
    1192018-05-24  Chris Dumez  <cdumez@apple.com>
    220
  • trunk/Source/WebCore/PAL/ChangeLog

    r232098 r232158  
     12018-05-24  Chris Dumez  <cdumez@apple.com>
     2
     3        Some of the work in initializeLogChannelsIfNecessary() is unnecessary for release builds
     4        https://bugs.webkit.org/show_bug.cgi?id=185951
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        Some of the work in initializeLogChannelsIfNecessary() is unnecessary for release builds and slows down
     9        launch time. In particular, it is unnecessary to read NSDefaults to figure out which logging channels
     10        should be enabled.
     11
     12        * pal/cocoa/LoggingCocoa.mm:
     13        (PAL::logLevelString):
     14        * pal/unix/LoggingUnix.cpp:
     15        (PAL::logLevelString):
     16        * pal/win/LoggingWin.cpp:
     17        (PAL::logLevelString):
     18
    1192018-05-22  Simon Fraser  <simon.fraser@apple.com>
    220
  • trunk/Source/WebCore/PAL/pal/cocoa/LoggingCocoa.mm

    r223206 r232158  
    3333namespace PAL {
    3434
    35 static NSString * const defaultsDomain = @"PALLogging";
    36 
    3735String logLevelString()
    3836{
     37#if !LOG_DISABLED
     38    static NSString * const defaultsDomain = @"PALLogging";
    3939    return [[NSUserDefaults standardUserDefaults] stringForKey:defaultsDomain];
     40#else
     41    return String();
     42#endif
    4043}
    4144
  • trunk/Source/WebCore/PAL/pal/unix/LoggingUnix.cpp

    r223296 r232158  
    3535String logLevelString()
    3636{
     37#if !LOG_DISABLED
    3738    if (char* logEnv = getenv("WEBKIT_DEBUG")) {
    3839
    … …  
    4445        return ASCIILiteral("NotYetImplemented,") + String(logEnv);
    4546    }
    46 
     47#endif
    4748    return String();
    4849}
  • trunk/Source/WebCore/PAL/pal/win/LoggingWin.cpp

    r229309 r232158  
    3535namespace PAL {
    3636
    37 static char * const loggingEnvironmentVariable = "WebCoreLogging";
    38 
    3937String logLevelString()
    4038{
     39#if !LOG_DISABLED
     40    static char* const loggingEnvironmentVariable = "WebCoreLogging";
    4141    DWORD length = GetEnvironmentVariableA(loggingEnvironmentVariable, 0, 0);
    4242    if (!length)
    … …  
    4949
    5050    return String(buffer.data());
     51#else
     52    return String();
     53#endif
    5154}
    5255
  • trunk/Source/WebCore/platform/mac/LoggingMac.mm

    r205275 r232158  
    3333namespace WebCore {
    3434
    35 static NSString * const defaultsDomain = @"WebCoreLogging";
    36 
    3735String logLevelString()
    3836{
     37#if !LOG_DISABLED
     38    static NSString * const defaultsDomain = @"WebCoreLogging";
    3939    return [[NSUserDefaults standardUserDefaults] stringForKey:defaultsDomain];
     40#else
     41    return String();
     42#endif
    4043}
    4144
  • trunk/Source/WebCore/platform/unix/LoggingUnix.cpp

    r205275 r232158  
    3232String logLevelString()
    3333{
     34#if !LOG_DISABLED
    3435    char* logEnv = getenv("WEBKIT_DEBUG");
    3536    if (!logEnv)
    … …  
    4344    // To disable logging notImplemented set the DISABLE_NI_WARNING environment variable to 1.
    4445    return String("NotYetImplemented,") + logEnv;
     46#else
     47    return String();
     48#endif
    4549}
    4650
  • trunk/Source/WebCore/platform/win/LoggingWin.cpp

    r229309 r232158  
    3535namespace WebCore {
    3636
    37 static char * const loggingEnvironmentVariable = "WebCoreLogging";
    38 
    3937String logLevelString()
    4038{
     39#if !LOG_DISABLED
     40    static char* const loggingEnvironmentVariable = "WebCoreLogging";
    4141    DWORD length = GetEnvironmentVariableA(loggingEnvironmentVariable, 0, 0);
    4242    if (!length)
    … …  
    4949
    5050    return String(buffer.data());
     51#else
     52    return String();
     53#endif
    5154}
    5255
  • trunk/Source/WebKit/ChangeLog

    r232157 r232158  
     12018-05-24  Chris Dumez  <cdumez@apple.com>
     2
     3        Some of the work in initializeLogChannelsIfNecessary() is unnecessary for release builds
     4        https://bugs.webkit.org/show_bug.cgi?id=185951
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        Some of the work in initializeLogChannelsIfNecessary() is unnecessary for release builds and slows down
     9        launch time. In particular, it is unnecessary to read NSDefaults to figure out which logging channels
     10        should be enabled.
     11
     12        * Platform/foundation/LoggingFoundation.mm:
     13        (WebKit::logLevelString):
     14        * Platform/unix/LoggingUnix.cpp:
     15        (WebKit::logLevelString):
     16        * Platform/win/LoggingWin.cpp:
     17        (WebKit::logLevelString):
     18
    1192018-05-24  Per Arne Vollan  <pvollan@apple.com>
    220
  • trunk/Source/WebKit/Platform/foundation/LoggingFoundation.mm

    r205275 r232158  
    3232#if !LOG_DISABLED || !RELEASE_LOG_DISABLED
    3333
    34 static NSString * const defaultsDomain = @"WebKit2Logging";
    35 
    3634String logLevelString()
    3735{
     36#if !LOG_DISABLED
     37    static NSString * const defaultsDomain = @"WebKit2Logging";
    3838    return [[NSUserDefaults standardUserDefaults] stringForKey:defaultsDomain];
     39#else
     40    return String();
     41#endif
    3942}
    4043
  • trunk/Source/WebKit/Platform/unix/LoggingUnix.cpp

    r205275 r232158  
    3434String logLevelString()
    3535{
     36#if !LOG_DISABLED
    3637    return getenv("WEBKIT_DEBUG");
     38#else
     39    return String();
     40#endif
    3741}
    3842
  • trunk/Source/WebKit/Platform/win/LoggingWin.cpp

    r231446 r232158  
    3636namespace WebKit {
    3737
    38 static char* const loggingEnvironmentVariable = "WebKitLogging";
    39 
    4038String logLevelString()
    4139{
     40#if !LOG_DISABLED
     41    static char* const loggingEnvironmentVariable = "WebKitLogging";
     42
    4243    DWORD length = GetEnvironmentVariableA(loggingEnvironmentVariable, 0, 0);
    4344    if (!length)
    … …  
    5051
    5152    return String(buffer.data());
     53#else
     54    return String();
     55#endif
    5256}
    5357
Note: See TracChangeset for help on using the changeset viewer.