2015-11-03 Geoffrey Garen <ggaren@apple.com>
authorggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 Nov 2015 00:58:56 +0000 (00:58 +0000)
committerggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 Nov 2015 00:58:56 +0000 (00:58 +0000)
    Provide a way to turn off const in WebKit2.

    Reviewed by Sam Weinig.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@191999 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/bindings/js/JSDOMWindowBase.cpp
Source/WebCore/page/Settings.cpp
Source/WebCore/page/Settings.h
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/WebProcessCreationParameters.cpp
Source/WebKit2/Shared/WebProcessCreationParameters.h
Source/WebKit2/UIProcess/Cocoa/WebProcessPoolCocoa.mm
Source/WebKit2/WebProcess/WebProcess.cpp

index dd61009ab5493da1fe1018bc7a3eb89324a5799b..037f4df413943e3e4a9e735ba4ba25d1bb14b3da 100644 (file)
@@ -1,3 +1,17 @@
+2015-11-03  Geoffrey Garen  <ggaren@apple.com>
+
+        Provide a way to turn off const in WebKit2.
+
+        Reviewed by Sam Weinig.
+
+        * bindings/js/JSDOMWindowBase.cpp:
+        (WebCore::JSDOMWindowBase::commonVM):
+        * page/Settings.h:
+        (WebCore::Settings::shouldUseHighResolutionTimers):
+        (WebCore::Settings::shouldRewriteConstAsVar):
+        (WebCore::Settings::setShouldRewriteConstAsVar):
+        (WebCore::Settings::backgroundShouldExtendBeyondPage):
+
 2015-11-03  Joseph Pecoraro  <pecoraro@apple.com>
 
         Web Inspector: Remove duplication among ScriptDebugServer subclasses
index ea1bed574ca0ece0838d65ba2b4deab67e07faba..827ca999449a9dd3cf73d8502b3167c90b9a9190 100644 (file)
@@ -264,7 +264,7 @@ VM& JSDOMWindowBase::commonVM()
 #endif
 
 #if PLATFORM(MAC)
-        if (applicationIsITunes() || applicationIsIBooks())
+        if (applicationIsITunes() || applicationIsIBooks() || Settings::shouldRewriteConstAsVar())
             vm->setShouldRewriteConstAsVar(true);
 #endif
 
index ccb2af57556d02923327863be48dcade24c4511d..132089026268535f03a1f444d7c0bcfba0ef23d2 100644 (file)
@@ -84,6 +84,7 @@ bool Settings::gUsesOverlayScrollbars = false;
 bool Settings::gShouldUseHighResolutionTimers = true;
 #endif
     
+bool Settings::gShouldRewriteConstAsVar = false;
 bool Settings::gShouldRespectPriorityInCSSAttributeSetters = false;
 bool Settings::gLowPowerVideoAudioBufferSizeEnabled = false;
 
index 3749251a0b041edd4f7502b4fdb2d27ee17c5035..3d1097be79e1f6f34db60d3bd11b6e9b6161237f 100644 (file)
@@ -199,6 +199,9 @@ public:
     static bool shouldUseHighResolutionTimers() { return gShouldUseHighResolutionTimers; }
 #endif
 
+    static bool shouldRewriteConstAsVar() { return gShouldRewriteConstAsVar; }
+    static void setShouldRewriteConstAsVar(bool shouldRewriteConstAsVar) { gShouldRewriteConstAsVar = shouldRewriteConstAsVar; }
+
     WEBCORE_EXPORT void setBackgroundShouldExtendBeyondPage(bool);
     bool backgroundShouldExtendBeyondPage() const { return m_backgroundShouldExtendBeyondPage; }
 
@@ -360,6 +363,7 @@ private:
 #if PLATFORM(WIN)
     static bool gShouldUseHighResolutionTimers;
 #endif
+    WEBCORE_EXPORT static bool gShouldRewriteConstAsVar;
     static bool gShouldRespectPriorityInCSSAttributeSetters;
 #if PLATFORM(IOS)
     static bool gNetworkDataUsageTrackingEnabled;
index 49d69e18c2e7118aa1ded4e1fcbbcd5142b96a48..451ca15cfe8a27eabc974354d13d0f0b6ebeb591 100644 (file)
@@ -1,3 +1,18 @@
+2015-11-03  Geoffrey Garen  <ggaren@apple.com>
+
+        Provide a way to turn off const in WebKit2.
+
+        Reviewed by Sam Weinig.
+
+        * Shared/WebProcessCreationParameters.cpp:
+        (WebKit::WebProcessCreationParameters::encode):
+        (WebKit::WebProcessCreationParameters::decode):
+        * Shared/WebProcessCreationParameters.h:
+        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
+        (WebKit::WebProcessPool::platformInitializeWebProcess):
+        * WebProcess/WebProcess.cpp:
+        (WebKit::WebProcess::initializeWebProcess):
+
 2015-11-03  Alex Christensen  <achristensen@webkit.org>
 
         Create a NetworkSession for each SessionID
index 9d0c655a8385736b595eeebb13f5f20dbd41b080..1e631a088aa3576375b59c7246ba5c3d5344c9d7 100644 (file)
@@ -107,6 +107,7 @@ void WebProcessCreationParameters::encode(IPC::ArgumentEncoder& encoder) const
     encoder << shouldUseFontSmoothing;
     encoder << fontWhitelist;
     encoder << iconDatabaseEnabled;
+    encoder << shouldRewriteConstAsVar;
     encoder << terminationTimeout;
     encoder << languages;
     encoder << textCheckerState;
@@ -239,6 +240,8 @@ bool WebProcessCreationParameters::decode(IPC::ArgumentDecoder& decoder, WebProc
         return false;
     if (!decoder.decode(parameters.iconDatabaseEnabled))
         return false;
+    if (!decoder.decode(parameters.shouldRewriteConstAsVar))
+        return false;
     if (!decoder.decode(parameters.terminationTimeout))
         return false;
     if (!decoder.decode(parameters.languages))
index 9167a3fdc821a4f92119d8e8a3b7ae90145f71be..b838a9781bce970944f7464470ae1cc0713a24fc 100644 (file)
@@ -117,6 +117,7 @@ struct WebProcessCreationParameters {
     Vector<String> fontWhitelist;
 
     bool iconDatabaseEnabled;
+    bool shouldRewriteConstAsVar { false };
 
     double terminationTimeout;
 
index e32f3a0c99f2562195b2c95a255ed06daebdccb7..424b99718df40778a4e69e98b8562f95f77b02ac 100644 (file)
@@ -44,6 +44,7 @@
 #import <WebCore/NotImplemented.h>
 #import <WebCore/PlatformPasteboard.h>
 #import <WebCore/SharedBuffer.h>
+#import <WebCore/RuntimeApplicationChecks.h>
 #import <sys/param.h>
 
 #if ENABLE(NETWORK_PROCESS)
@@ -174,6 +175,10 @@ void WebProcessPool::platformInitializeWebProcess(WebProcessCreationParameters&
     parameters.shouldEnableFTLJIT = [[NSUserDefaults standardUserDefaults] boolForKey:WebKitJSCFTLJITEnabledDefaultsKey];
     parameters.shouldEnableMemoryPressureReliefLogging = [[NSUserDefaults standardUserDefaults] boolForKey:@"LogMemoryJetsamDetails"];
 
+#if PLATFORM(MAC)
+    parameters.shouldRewriteConstAsVar = applicationIsIBooks();
+#endif
+
 #if HAVE(HOSTED_CORE_ANIMATION)
 #if !PLATFORM(IOS)
     parameters.acceleratedCompositingPort = MachSendRight::create([CARemoteLayerServer sharedServer].serverPort);
index ede54147c274e9c2c81fd5a785a9c07c2b3d6361..8263b3676aaee76443b6bb7ca65ea2c3cc756c57 100644 (file)
@@ -336,6 +336,8 @@ void WebProcess::initializeWebProcess(WebProcessCreationParameters&& parameters)
     for (auto& scheme : parameters.urlSchemesRegisteredAsCORSEnabled)
         registerURLSchemeAsCORSEnabled(scheme);
 
+    WebCore::Settings::setShouldRewriteConstAsVar(parameters.shouldRewriteConstAsVar);
+
 #if ENABLE(CACHE_PARTITIONING)
     for (auto& scheme : parameters.urlSchemesRegisteredAsCachePartitioned)
         registerURLSchemeAsCachePartitioned(scheme);