Changeset 233466 in webkit


Ignore:
Timestamp:
Jul 3, 2018 9:50:57 AM (6 years ago)
Author:
Jonathan Bedard
Message:

Unreviewed, rolling out r233461.

Assertions triggered during iOS 11 debug layout and API tests

Reverted changeset:

"[iOS] Add assert to catch improper use of WebCore::Timer in
UI Process"
https://bugs.webkit.org/show_bug.cgi?id=185330
https://trac.webkit.org/changeset/233461

Location:
trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r233463 r233466  
     12018-07-03  Jonathan Bedard  <jbedard@apple.com>
     2
     3        Unreviewed, rolling out r233461.
     4
     5        Assertions triggered during iOS 11 debug layout and API tests
     6
     7        Reverted changeset:
     8
     9        "[iOS] Add assert to catch improper use of WebCore::Timer in
     10        UI Process"
     11        https://bugs.webkit.org/show_bug.cgi?id=185330
     12        https://trac.webkit.org/changeset/233461
     13
    1142018-07-03  Frederic Wang  <fwang@igalia.com>
    215
  • trunk/Source/WebCore/ChangeLog

    r233464 r233466  
     12018-07-03  Jonathan Bedard  <jbedard@apple.com>
     2
     3        Unreviewed, rolling out r233461.
     4
     5        Assertions triggered during iOS 11 debug layout and API tests
     6
     7        Reverted changeset:
     8
     9        "[iOS] Add assert to catch improper use of WebCore::Timer in
     10        UI Process"
     11        https://bugs.webkit.org/show_bug.cgi?id=185330
     12        https://trac.webkit.org/changeset/233461
     13
    1142018-07-03  Jer Noble  <jer.noble@apple.com>
    215
  • trunk/Source/WebCore/platform/RuntimeApplicationChecks.cpp

    r233461 r233466  
    4747}
    4848
    49 #if !PLATFORM(WIN)
    50 static WebKitProcessType s_webKitProcessType { WebKitProcessType::UIProcess };
    51 
    52 void setWebKitProcessType(WebKitProcessType type)
    53 {
    54     s_webKitProcessType = type;
    55 }
    56 
    57 bool isInNetworkProcess()
    58 {
    59     return s_webKitProcessType == WebKitProcessType::NetworkProcess;
    60 }
    61 
    62 bool isInStorageProcess()
    63 {
    64     return s_webKitProcessType == WebKitProcessType::StorageProcess;
    65 }
    66 
    67 bool isInWebProcess()
    68 {
    69     return s_webKitProcessType == WebKitProcessType::WebProcess;
    70 }
    71 #endif
    72 
    7349int presentingApplicationPID()
    7450{
  • trunk/Source/WebCore/platform/RuntimeApplicationChecks.h

    r233461 r233466  
    3434
    3535#if PLATFORM(WIN)
    36 inline bool isInNetworkProcess() { return false; }
    37 inline bool isInStorageProcess() { return false; }
    3836inline bool isInWebProcess() { return false; }
    39 #else
    40 enum class WebKitProcessType { UIProcess = 0, NetworkProcess, StorageProcess, WebProcess };
    41 WEBCORE_EXPORT void setWebKitProcessType(WebKitProcessType);
    42 bool isInNetworkProcess();
    43 bool isInStorageProcess();
    44 bool isInWebProcess();
     37#elif !PLATFORM(COCOA)
     38inline bool isInWebProcess() { return true; }
    4539#endif
    4640
    4741#if PLATFORM(COCOA)
     42
     43bool isInWebProcess();
    4844
    4945WEBCORE_EXPORT void setApplicationBundleIdentifier(const String&);
  • trunk/Source/WebCore/platform/Timer.cpp

    r233461 r233466  
    2828#include "Timer.h"
    2929
    30 #include "Logging.h"
    31 #include "RuntimeApplicationChecks.h"
    3230#include "SharedTimer.h"
    3331#include "ThreadGlobalData.h"
     
    3634#include <limits>
    3735#include <math.h>
    38 #include <wtf/Compiler.h>
    3936#include <wtf/MainThread.h>
    4037#include <wtf/Vector.h>
    41 
    42 #if USE(WEB_THREAD)
    43 #include "WebCoreThread.h"
    44 #endif
    4538
    4639namespace WebCore {
     
    194187TimerBase::TimerBase()
    195188{
    196 #if PLATFORM(IOS)
    197     if (UNLIKELY(!isAllowed())) {
    198 #define WEBCORE_TIMERBASE_ASSERTION_MESSAGE "WebCore::Timer should not be used in UI Process."
    199         ASSERT_WITH_MESSAGE(false, WEBCORE_TIMERBASE_ASSERTION_MESSAGE);
    200         RELEASE_LOG_FAULT(Threading, WEBCORE_TIMERBASE_ASSERTION_MESSAGE);
    201 #undef WEBCORE_TIMERBASE_ASSERTION_MESSAGE
    202     }
    203 #endif
    204189}
    205190
     
    256241    if (inHeap())
    257242        checkHeapIndex();
    258 }
    259 
    260 bool TimerBase::isAllowed()
    261 {
    262 #if PLATFORM(IOS)
    263     if (isInWebProcess() || isInNetworkProcess() || isInStorageProcess())
    264         return true;
    265 
    266 #if USE(WEB_THREAD)
    267     if (WebThreadIsEnabled() && (WebThreadIsCurrent() || WebThreadIsLocked()))
    268         return true;
    269 #endif
    270 
    271     return false;
    272 #else
    273     return true;
    274 #endif
    275243}
    276244
  • trunk/Source/WebCore/platform/Timer.h

    r233461 r233466  
    7979    void checkHeapIndex() const;
    8080
    81     static bool isAllowed();
    82 
    8381    void setNextFireTime(MonotonicTime);
    8482
  • trunk/Source/WebCore/platform/cocoa/RuntimeApplicationChecksCocoa.mm

    r233461 r233466  
    6666}
    6767
     68bool isInWebProcess()
     69{
     70    static bool mainBundleIsWebProcess = [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"com.apple.WebKit.WebContent.Development"]
     71        || [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"com.apple.WebKit.WebContent"]
     72        || [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"com.apple.WebProcess"];
     73    return mainBundleIsWebProcess;
     74}
     75
    6876static bool applicationBundleIsEqualTo(const String& bundleIdentifierString)
    6977{
  • trunk/Source/WebKit/ChangeLog

    r233465 r233466  
     12018-07-03  Jonathan Bedard  <jbedard@apple.com>
     2
     3        Unreviewed, rolling out r233461.
     4
     5        Assertions triggered during iOS 11 debug layout and API tests
     6
     7        Reverted changeset:
     8
     9        "[iOS] Add assert to catch improper use of WebCore::Timer in
     10        UI Process"
     11        https://bugs.webkit.org/show_bug.cgi?id=185330
     12        https://trac.webkit.org/changeset/233461
     13
    1142018-07-03  Youenn Fablet  <youenn@apple.com>
    215
  • trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp

    r233461 r233466  
    129129            webProcessConnection->setOnLineState(isOnLine);
    130130    });
    131 
    132     WebCore::setWebKitProcessType(WebKitProcessType::NetworkProcess);
    133131}
    134132
  • trunk/Source/WebKit/StorageProcess/StorageProcess.cpp

    r233461 r233466  
    4141#include <WebCore/IDBKeyData.h>
    4242#include <WebCore/NotImplemented.h>
    43 #include <WebCore/RuntimeApplicationChecks.h>
    4443#include <WebCore/SWServerWorker.h>
    4544#include <WebCore/SecurityOrigin.h>
     
    7473    // FIXME: https://bugs.webkit.org/show_bug.cgi?id=135365 - Need a more explicit way of doing this besides accessing the UTF8Encoding.
    7574    UTF8Encoding();
    76 
    77     WebCore::setWebKitProcessType(WebKitProcessType::StorageProcess);
    7875}
    7976
  • trunk/Source/WebKit/WebProcess/WebProcess.cpp

    r233461 r233466  
    210210   
    211211    Gigacage::disableDisablingPrimitiveGigacageIfShouldBeEnabled();
    212 
    213     WebCore::setWebKitProcessType(WebKitProcessType::WebProcess);
    214212}
    215213
Note: See TracChangeset for help on using the changeset viewer.