Turning off custom pasteboard data doesn't actually turn it off in WK2
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 22 Jan 2018 06:41:05 +0000 (06:41 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 22 Jan 2018 06:41:05 +0000 (06:41 +0000)
https://bugs.webkit.org/show_bug.cgi?id=181920
<rdar://problem/36686429>

Reviewed by Wenson Hsieh.

Source/WebCore:

Replaced the global settings for custom pasteboard data by regular runtime enabled flags.

* dom/DataTransfer.cpp:
(WebCore::DataTransfer::getDataForItem const):
(WebCore::DataTransfer::shouldSuppressGetAndSetDataToAvoidExposingFilePaths const):
(WebCore::DataTransfer::setDataFromItemList):
(WebCore::DataTransfer::types const):
(WebCore::DataTransfer::commitToPasteboard):
* dom/DataTransferItemList.cpp:
(WebCore::shouldExposeTypeInItemList):
* editing/Editor.cpp:
(WebCore::createDataTransferForClipboardEvent):
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::createFragmentAndAddResources):
(WebCore::WebContentReader::readWebArchive):
* page/DeprecatedGlobalSettings.cpp:
(WebCore::DeprecatedGlobalSettings::defaultCustomPasteboardDataEnabled): Deleted.
* page/DeprecatedGlobalSettings.h:
(WebCore::DeprecatedGlobalSettings::setCustomPasteboardDataEnabled): Deleted.
(WebCore::DeprecatedGlobalSettings::customPasteboardDataEnabled): Deleted.
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setCustomPasteboardDataEnabled):
(WebCore::RuntimeEnabledFeatures::customPasteboardDataEnabled const):
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
(WebCore::InternalSettings::setCustomPasteboardDataEnabled):

Source/WebKit:

Moved the code to decide when to enable custom pasteboard data from WebCore
since we never enable this feature in WebKit1.

* Shared/WebPreferences.yaml:
* Shared/WebPreferencesDefaultValues.cpp:
(defaultCustomPasteboardDataEnabled): Added.
* Shared/WebPreferencesDefaultValues.h:

Source/WebKitLegacy/mac:

Always disable custom pasteboard data in WebKit1. See r226156 for details.

* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

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

16 files changed:
Source/WebCore/ChangeLog
Source/WebCore/dom/DataTransfer.cpp
Source/WebCore/dom/DataTransferItemList.cpp
Source/WebCore/editing/Editor.cpp
Source/WebCore/editing/cocoa/WebContentReaderCocoa.mm
Source/WebCore/page/DeprecatedGlobalSettings.cpp
Source/WebCore/page/DeprecatedGlobalSettings.h
Source/WebCore/page/RuntimeEnabledFeatures.h
Source/WebCore/testing/InternalSettings.cpp
Source/WebKit/ChangeLog
Source/WebKit/Shared/WebPreferences.yaml
Source/WebKit/Shared/WebPreferencesDefaultValues.cpp
Source/WebKit/Shared/WebPreferencesDefaultValues.h
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/WebView/WebPreferences.mm
Source/WebKitLegacy/mac/WebView/WebView.mm

index c8afa3e..6b57da3 100644 (file)
@@ -1,3 +1,39 @@
+2018-01-21  Ryosuke Niwa  <rniwa@webkit.org>
+
+        Turning off custom pasteboard data doesn't actually turn it off in WK2
+        https://bugs.webkit.org/show_bug.cgi?id=181920
+        <rdar://problem/36686429>
+
+        Reviewed by Wenson Hsieh.
+
+        Replaced the global settings for custom pasteboard data by regular runtime enabled flags.
+
+        * dom/DataTransfer.cpp:
+        (WebCore::DataTransfer::getDataForItem const):
+        (WebCore::DataTransfer::shouldSuppressGetAndSetDataToAvoidExposingFilePaths const):
+        (WebCore::DataTransfer::setDataFromItemList):
+        (WebCore::DataTransfer::types const):
+        (WebCore::DataTransfer::commitToPasteboard):
+        * dom/DataTransferItemList.cpp:
+        (WebCore::shouldExposeTypeInItemList):
+        * editing/Editor.cpp:
+        (WebCore::createDataTransferForClipboardEvent):
+        * editing/cocoa/WebContentReaderCocoa.mm:
+        (WebCore::createFragmentAndAddResources):
+        (WebCore::WebContentReader::readWebArchive):
+        * page/DeprecatedGlobalSettings.cpp:
+        (WebCore::DeprecatedGlobalSettings::defaultCustomPasteboardDataEnabled): Deleted.
+        * page/DeprecatedGlobalSettings.h:
+        (WebCore::DeprecatedGlobalSettings::setCustomPasteboardDataEnabled): Deleted.
+        (WebCore::DeprecatedGlobalSettings::customPasteboardDataEnabled): Deleted.
+        * page/RuntimeEnabledFeatures.h:
+        (WebCore::RuntimeEnabledFeatures::setCustomPasteboardDataEnabled):
+        (WebCore::RuntimeEnabledFeatures::customPasteboardDataEnabled const):
+        * testing/InternalSettings.cpp:
+        (WebCore::InternalSettings::Backup::Backup):
+        (WebCore::InternalSettings::Backup::restoreTo):
+        (WebCore::InternalSettings::setCustomPasteboardDataEnabled):
+
 2018-01-21  Wenson Hsieh  <wenson_hsieh@apple.com>
 
         Add a new feature flag for EXTRA_ZOOM_MODE and reintroduce AdditionalFeatureDefines.h
index 6f33326..c109423 100644 (file)
@@ -30,7 +30,6 @@
 #include "CachedImageClient.h"
 #include "DataTransferItem.h"
 #include "DataTransferItemList.h"
-#include "DeprecatedGlobalSettings.h"
 #include "DocumentFragment.h"
 #include "DragData.h"
 #include "Editor.h"
@@ -41,6 +40,7 @@
 #include "HTMLParserIdioms.h"
 #include "Image.h"
 #include "Pasteboard.h"
+#include "RuntimeEnabledFeatures.h"
 #include "Settings.h"
 #include "StaticPasteboard.h"
 #include "URLParser.h"
@@ -157,7 +157,7 @@ String DataTransfer::getDataForItem(Document& document, const String& type) cons
         return { };
     }
 
-    if (!DeprecatedGlobalSettings::customPasteboardDataEnabled())
+    if (!RuntimeEnabledFeatures::sharedFeatures().customPasteboardDataEnabled())
         return m_pasteboard->readString(lowercaseType);
 
     // StaticPasteboard is only used to stage data written by websites before being committed to the system pasteboard.
@@ -188,7 +188,7 @@ String DataTransfer::getData(Document& document, const String& type) const
 
 bool DataTransfer::shouldSuppressGetAndSetDataToAvoidExposingFilePaths() const
 {
-    if (!forFileDrag() && !DeprecatedGlobalSettings::customPasteboardDataEnabled())
+    if (!forFileDrag() && !RuntimeEnabledFeatures::sharedFeatures().customPasteboardDataEnabled())
         return false;
     return m_pasteboard->containsFiles();
 }
@@ -212,7 +212,7 @@ void DataTransfer::setDataFromItemList(const String& type, const String& data)
     ASSERT(canWriteData());
     RELEASE_ASSERT(is<StaticPasteboard>(*m_pasteboard));
 
-    if (!DeprecatedGlobalSettings::customPasteboardDataEnabled()) {
+    if (!RuntimeEnabledFeatures::sharedFeatures().customPasteboardDataEnabled()) {
         m_pasteboard->writeString(type, data);
         return;
     }
@@ -274,7 +274,7 @@ Vector<String> DataTransfer::types(AddFilesType addFilesType) const
     if (!canReadTypes())
         return { };
     
-    if (!DeprecatedGlobalSettings::customPasteboardDataEnabled()) {
+    if (!RuntimeEnabledFeatures::sharedFeatures().customPasteboardDataEnabled()) {
         auto types = m_pasteboard->typesForLegacyUnsafeBindings();
         ASSERT(!types.contains("Files"));
         if (m_pasteboard->containsFiles() && addFilesType == AddFilesType::Yes)
@@ -382,7 +382,7 @@ void DataTransfer::commitToPasteboard(Pasteboard& nativePasteboard)
 {
     ASSERT(is<StaticPasteboard>(*m_pasteboard) && !is<StaticPasteboard>(nativePasteboard));
     PasteboardCustomData customData = downcast<StaticPasteboard>(*m_pasteboard).takeCustomData();
-    if (DeprecatedGlobalSettings::customPasteboardDataEnabled()) {
+    if (RuntimeEnabledFeatures::sharedFeatures().customPasteboardDataEnabled()) {
         customData.origin = m_originIdentifier;
         nativePasteboard.writeCustomData(customData);
         return;
index 45fcbeb..8127194 100644 (file)
@@ -27,9 +27,9 @@
 #include "DataTransferItemList.h"
 
 #include "DataTransferItem.h"
-#include "DeprecatedGlobalSettings.h"
 #include "FileList.h"
 #include "Pasteboard.h"
+#include "RuntimeEnabledFeatures.h"
 #include "Settings.h"
 
 namespace WebCore {
@@ -56,7 +56,7 @@ RefPtr<DataTransferItem> DataTransferItemList::item(unsigned index)
 
 static bool shouldExposeTypeInItemList(const String& type)
 {
-    return DeprecatedGlobalSettings::customPasteboardDataEnabled() || Pasteboard::isSafeTypeForDOMToReadAndWrite(type);
+    return RuntimeEnabledFeatures::sharedFeatures().customPasteboardDataEnabled() || Pasteboard::isSafeTypeForDOMToReadAndWrite(type);
 }
 
 ExceptionOr<RefPtr<DataTransferItem>> DataTransferItemList::add(const String& data, const String& type)
index feca4d1..10a998b 100644 (file)
@@ -38,7 +38,6 @@
 #include "CreateLinkCommand.h"
 #include "DataTransfer.h"
 #include "DeleteSelectionCommand.h"
-#include "DeprecatedGlobalSettings.h"
 #include "DictationAlternative.h"
 #include "DictationCommand.h"
 #include "DocumentFragment.h"
@@ -83,6 +82,7 @@
 #include "RenderedPosition.h"
 #include "ReplaceRangeWithTextCommand.h"
 #include "ReplaceSelectionCommand.h"
+#include "RuntimeEnabledFeatures.h"
 #include "Settings.h"
 #include "ShadowRoot.h"
 #include "SimplifyMarkupCommand.h"
@@ -360,7 +360,7 @@ static Ref<DataTransfer> createDataTransferForClipboardEvent(Document& document,
     case ClipboardEventKind::Cut:
         return DataTransfer::createForCopyAndPaste(document, DataTransfer::StoreMode::ReadWrite, std::make_unique<StaticPasteboard>());
     case ClipboardEventKind::PasteAsPlainText:
-        if (DeprecatedGlobalSettings::customPasteboardDataEnabled()) {
+        if (RuntimeEnabledFeatures::sharedFeatures().customPasteboardDataEnabled()) {
             auto plainTextType = ASCIILiteral("text/plain");
             auto plainText = Pasteboard::createForCopyAndPaste()->readString(plainTextType);
             auto pasteboard = std::make_unique<StaticPasteboard>();
index 80488a9..2d54f6e 100644 (file)
@@ -31,7 +31,6 @@
 #import "BlobURL.h"
 #import "CachedResourceLoader.h"
 #import "DOMURL.h"
-#import "DeprecatedGlobalSettings.h"
 #import "Document.h"
 #import "DocumentFragment.h"
 #import "DocumentLoader.h"
@@ -326,7 +325,7 @@ RefPtr<DocumentFragment> createFragmentAndAddResources(Frame& frame, NSAttribute
     if (!fragmentAndResources.fragment)
         return nullptr;
 
-    if (!DeprecatedGlobalSettings::customPasteboardDataEnabled()) {
+    if (!RuntimeEnabledFeatures::sharedFeatures().customPasteboardDataEnabled()) {
         if (DocumentLoader* loader = frame.loader().documentLoader()) {
             for (auto& resource : fragmentAndResources.resources)
                 loader->addArchiveResource(resource.copyRef());
@@ -457,7 +456,7 @@ bool WebContentReader::readWebArchive(SharedBuffer& buffer)
     if (!result)
         return false;
     
-    if (!DeprecatedGlobalSettings::customPasteboardDataEnabled()) {
+    if (!RuntimeEnabledFeatures::sharedFeatures().customPasteboardDataEnabled()) {
         fragment = createFragmentFromMarkup(*frame.document(), result->markup, result->mainResource->url(), DisallowScriptingAndPluginContent);
         if (DocumentLoader* loader = frame.loader().documentLoader())
             loader->addAllArchiveResources(result->archive.get());
index 05bb11d..269d93b 100644 (file)
 #endif
 #endif
 
-#if PLATFORM(COCOA)
-#include <wtf/spi/darwin/dyldSPI.h>
-#endif
-
 namespace WebCore {
 
 #if USE(AVFOUNDATION)
@@ -82,22 +78,6 @@ bool DeprecatedGlobalSettings::gAVKitEnabled = false;
 bool DeprecatedGlobalSettings::gShouldOptOutOfNetworkStateObservation = false;
 #endif
 bool DeprecatedGlobalSettings::gManageAudioSession = false;
-bool DeprecatedGlobalSettings::gCustomPasteboardDataEnabled = false;
-
-bool DeprecatedGlobalSettings::defaultCustomPasteboardDataEnabled()
-{
-    if (!isInWebProcess())
-        return false;
-#if PLATFORM(IOS) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 110300
-    return IOSApplication::isMobileSafari() || dyld_get_program_sdk_version() >= DYLD_IOS_VERSION_11_3;
-#elif PLATFORM(MAC) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 101300
-    return MacApplication::isSafari() || dyld_get_program_sdk_version() > DYLD_MACOSX_VERSION_10_13;
-#elif PLATFORM(MAC)
-    return MacApplication::isSafari();
-#else
-    return false;
-#endif
-}
 
 #if PLATFORM(WIN)
 void DeprecatedGlobalSettings::setShouldUseHighResolutionTimers(bool shouldUseHighResolutionTimers)
index 11ec7ec..93ed97e 100644 (file)
@@ -108,10 +108,6 @@ public:
     static void setShouldManageAudioSessionCategory(bool flag) { gManageAudioSession = flag; }
     static bool shouldManageAudioSessionCategory() { return gManageAudioSession; }
 #endif
-
-    static void setCustomPasteboardDataEnabled(bool enabled) { gCustomPasteboardDataEnabled = enabled; }
-    static bool customPasteboardDataEnabled() { return gCustomPasteboardDataEnabled; }
-    WEBCORE_EXPORT static bool defaultCustomPasteboardDataEnabled();
     
 #if ENABLE(MEDIA_STREAM)
     static bool mockCaptureDevicesEnabled();
index 6feefec..93d572c 100644 (file)
@@ -82,6 +82,9 @@ public:
     void setDataTransferItemsEnabled(bool areEnabled) { m_areDataTransferItemsEnabled = areEnabled; }
     bool dataTransferItemsEnabled() const { return m_areDataTransferItemsEnabled; }
 
+    void setCustomPasteboardDataEnabled(bool isEnabled) { m_isCustomPasteboardDataEnabled = isEnabled; }
+    bool customPasteboardDataEnabled() const { return m_isCustomPasteboardDataEnabled; }
+
 #if ENABLE(ATTACHMENT_ELEMENT)
     void setAttachmentElementEnabled(bool areEnabled) { m_isAttachmentElementEnabled = areEnabled; }
     bool attachmentElementEnabled() const { return m_isAttachmentElementEnabled; }
@@ -262,6 +265,7 @@ private:
     bool m_isMenuItemElementEnabled { false };
     bool m_isDirectoryUploadEnabled { false };
     bool m_areDataTransferItemsEnabled { false };
+    bool m_isCustomPasteboardDataEnabled { false };
     bool m_inputEventsEnabled { true };
 
 #if ENABLE(ATTACHMENT_ELEMENT)
index 7004f0d..d92e90d 100644 (file)
@@ -119,7 +119,7 @@ InternalSettings::Backup::Backup(Settings& settings)
 #if USE(AUDIO_SESSION)
     , m_shouldManageAudioSessionCategory(DeprecatedGlobalSettings::shouldManageAudioSessionCategory())
 #endif
-    , m_customPasteboardDataEnabled(DeprecatedGlobalSettings::customPasteboardDataEnabled())
+    , m_customPasteboardDataEnabled(RuntimeEnabledFeatures::sharedFeatures().customPasteboardDataEnabled())
 {
 }
 
@@ -216,11 +216,11 @@ void InternalSettings::Backup::restoreTo(Settings& settings)
 #if ENABLE(MEDIA_STREAM)
     RuntimeEnabledFeatures::sharedFeatures().setScreenCaptureEnabled(m_setScreenCaptureEnabled);
 #endif
+    RuntimeEnabledFeatures::sharedFeatures().setCustomPasteboardDataEnabled(m_customPasteboardDataEnabled);
 
 #if USE(AUDIO_SESSION)
     DeprecatedGlobalSettings::setShouldManageAudioSessionCategory(m_shouldManageAudioSessionCategory);
 #endif
-    DeprecatedGlobalSettings::setCustomPasteboardDataEnabled(m_customPasteboardDataEnabled);
 }
 
 class InternalSettingsWrapper : public Supplement<Page> {
@@ -879,7 +879,7 @@ ExceptionOr<void> InternalSettings::setShouldManageAudioSessionCategory(bool sho
 
 ExceptionOr<void> InternalSettings::setCustomPasteboardDataEnabled(bool enabled)
 {
-    DeprecatedGlobalSettings::setCustomPasteboardDataEnabled(enabled);
+    RuntimeEnabledFeatures::sharedFeatures().setCustomPasteboardDataEnabled(enabled);
     return { };
 }
 
index f75a2ab..c176aef 100644 (file)
@@ -1,3 +1,19 @@
+2018-01-21  Ryosuke Niwa  <rniwa@webkit.org>
+
+        Turning off custom pasteboard data doesn't actually turn it off in WK2
+        https://bugs.webkit.org/show_bug.cgi?id=181920
+        <rdar://problem/36686429>
+
+        Reviewed by Wenson Hsieh.
+
+        Moved the code to decide when to enable custom pasteboard data from WebCore
+        since we never enable this feature in WebKit1.
+
+        * Shared/WebPreferences.yaml:
+        * Shared/WebPreferencesDefaultValues.cpp:
+        (defaultCustomPasteboardDataEnabled): Added.
+        * Shared/WebPreferencesDefaultValues.h:
+
 2018-01-21  Wenson Hsieh  <wenson_hsieh@apple.com>
 
         Add a new feature flag for EXTRA_ZOOM_MODE and reintroduce AdditionalFeatureDefines.h
index 67c9ed6..e06e1e5 100644 (file)
@@ -779,10 +779,10 @@ DataTransferItemsEnabled:
 
 CustomPasteboardDataEnabled:
   type: bool
-  defaultValue: WebCore::DeprecatedGlobalSettings::defaultCustomPasteboardDataEnabled()
+  defaultValue: defaultCustomPasteboardDataEnabled()
   humanReadableName: "Custom pateboard data"
   humanReadableDescription: "Enable custom clipboard types and better security model for clipboard API."
-  webcoreBinding: DeprecatedGlobalSettings
+  webcoreBinding: RuntimeEnabledFeatures
 
 WebVREnabled:
   type: bool
index 9d2a068..6e3a273 100644 (file)
 
 #include "config.h"
 #include "WebPreferencesDefaultValues.h"
+#import <WebCore/RuntimeApplicationChecks.h>
+
+#if PLATFORM(COCOA)
+#include <wtf/spi/darwin/dyldSPI.h>
+#endif
 
 #if PLATFORM(IOS)
 #include "VersionChecks.h"
@@ -38,3 +43,17 @@ bool defaultPassiveTouchListenersAsDefaultOnDocument()
     return true;
 #endif
 }
+
+bool defaultCustomPasteboardDataEnabled()
+{
+#if PLATFORM(IOS) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 110300
+    return WebCore::IOSApplication::isMobileSafari() || dyld_get_program_sdk_version() >= DYLD_IOS_VERSION_11_3;
+#elif PLATFORM(MAC) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 101300
+    return WebCore::MacApplication::isSafari() || dyld_get_program_sdk_version() > DYLD_MACOSX_VERSION_10_13;
+#elif PLATFORM(MAC)
+    return WebCore::MacApplication::isSafari();
+#else
+    return false;
+#endif
+}
+
index 28fd77f..aaeac91 100644 (file)
 #endif
 
 bool defaultPassiveTouchListenersAsDefaultOnDocument();
+bool defaultCustomPasteboardDataEnabled();
index ea1148a..aa34d09 100644 (file)
@@ -1,3 +1,18 @@
+2018-01-21  Ryosuke Niwa  <rniwa@webkit.org>
+
+        Turning off custom pasteboard data doesn't actually turn it off in WK2
+        https://bugs.webkit.org/show_bug.cgi?id=181920
+        <rdar://problem/36686429>
+
+        Reviewed by Wenson Hsieh.
+
+        Always disable custom pasteboard data in WebKit1. See r226156 for details.
+
+        * WebView/WebPreferences.mm:
+        (+[WebPreferences initialize]):
+        * WebView/WebView.mm:
+        (-[WebView _preferencesChanged:]):
+
 2018-01-21  Wenson Hsieh  <wenson_hsieh@apple.com>
 
         Add a new feature flag for EXTRA_ZOOM_MODE and reintroduce AdditionalFeatureDefines.h
index 764d735..fc86b6e 100644 (file)
@@ -622,7 +622,7 @@ public:
         [NSNumber numberWithBool:YES], WebKitShadowDOMEnabledPreferenceKey,
         [NSNumber numberWithBool:YES], WebKitCustomElementsEnabledPreferenceKey,
         [NSNumber numberWithBool:YES], WebKitDataTransferItemsEnabledPreferenceKey,
-        [NSNumber numberWithBool:DeprecatedGlobalSettings::defaultCustomPasteboardDataEnabled()], WebKitCustomPasteboardDataEnabledPreferenceKey,
+        [NSNumber numberWithBool:NO], WebKitCustomPasteboardDataEnabledPreferenceKey,
         [NSNumber numberWithBool:YES], WebKitModernMediaControlsEnabledPreferenceKey,
 #if ENABLE(WEBGL2)
         [NSNumber numberWithBool:NO], WebKitWebGL2EnabledPreferenceKey,
index 2013178..9995fde 100644 (file)
@@ -2994,6 +2994,7 @@ static bool needsSelfRetainWhileLoadingQuirk()
     RuntimeEnabledFeatures::sharedFeatures().setShadowDOMEnabled([preferences shadowDOMEnabled]);
     RuntimeEnabledFeatures::sharedFeatures().setCustomElementsEnabled([preferences customElementsEnabled]);
     RuntimeEnabledFeatures::sharedFeatures().setDataTransferItemsEnabled([preferences dataTransferItemsEnabled]);
+    RuntimeEnabledFeatures::sharedFeatures().setCustomPasteboardDataEnabled([preferences customPasteboardDataEnabled]);
 
 #if ENABLE(ATTACHMENT_ELEMENT)
     RuntimeEnabledFeatures::sharedFeatures().setAttachmentElementEnabled([preferences attachmentElementEnabled]);
@@ -3073,8 +3074,6 @@ static bool needsSelfRetainWhileLoadingQuirk()
     [WAKView _setInterpolationQuality:[preferences _interpolationQuality]];
 #endif
 
-    DeprecatedGlobalSettings::setCustomPasteboardDataEnabled([preferences customPasteboardDataEnabled]);
-
 #if ENABLE(LEGACY_ENCRYPTED_MEDIA)
     settings.setMediaKeysStorageDirectory([preferences mediaKeysStorageDirectory]);
 #endif