Unreviewed, rolling out r144126 and r144176.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 28 Feb 2013 19:46:28 +0000 (19:46 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 28 Feb 2013 19:46:28 +0000 (19:46 +0000)
http://trac.webkit.org/changeset/144126
http://trac.webkit.org/changeset/144176
https://bugs.webkit.org/show_bug.cgi?id=111096

Caused fast/notifications/notifications-request-
permission.html to crash (Requested by abarth on #webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2013-02-28

Source/WebCore:

* GNUmakefile.list.am:
* Modules/notifications/Notification.h:
(Notification):
* Modules/notifications/Notification.idl:
* Target.pri:
* UseJSC.cmake:
* UseV8.cmake:
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSNotificationCustom.cpp: Added.
(WebCore):
(WebCore::JSNotification::requestPermission):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateParametersCheck):
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/v8/custom/V8NotificationCustom.cpp: Added.
(WebCore):
(WebCore::V8Notification::requestPermissionMethodCustom):

LayoutTests:

* fast/notifications/notifications-request-permission-optional-expected.txt: Removed.
* fast/notifications/notifications-request-permission-optional.html: Removed.

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

19 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/notifications/notifications-request-permission-optional-expected.txt [deleted file]
LayoutTests/fast/notifications/notifications-request-permission-optional.html [deleted file]
Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.list.am
Source/WebCore/Modules/notifications/Notification.h
Source/WebCore/Modules/notifications/Notification.idl
Source/WebCore/Target.pri
Source/WebCore/UseJSC.cmake
Source/WebCore/UseV8.cmake
Source/WebCore/WebCore.gypi
Source/WebCore/WebCore.vcproj/WebCore.vcproj
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/bindings/js/JSNotificationCustom.cpp [new file with mode: 0644]
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
Source/WebCore/bindings/v8/custom/V8NotificationCustom.cpp [new file with mode: 0644]

index 0634c26..ec78e70 100644 (file)
@@ -1,3 +1,16 @@
+2013-02-28  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r144126 and r144176.
+        http://trac.webkit.org/changeset/144126
+        http://trac.webkit.org/changeset/144176
+        https://bugs.webkit.org/show_bug.cgi?id=111096
+
+        Caused fast/notifications/notifications-request-
+        permission.html to crash (Requested by abarth on #webkit).
+
+        * fast/notifications/notifications-request-permission-optional-expected.txt: Removed.
+        * fast/notifications/notifications-request-permission-optional.html: Removed.
+
 2013-02-28  Nate Chapin  <japhet@chromium.org>
 
         Test for https://bugs.webkit.org/show_bug.cgi?id=110482
diff --git a/LayoutTests/fast/notifications/notifications-request-permission-optional-expected.txt b/LayoutTests/fast/notifications/notifications-request-permission-optional-expected.txt
deleted file mode 100644 (file)
index 3a60345..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-PASS window.webkitNotifications is not undefined
-PASS window.webkitNotifications.requestPermission() did not throw exception.
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
diff --git a/LayoutTests/fast/notifications/notifications-request-permission-optional.html b/LayoutTests/fast/notifications/notifications-request-permission-optional.html
deleted file mode 100644 (file)
index 57e35cd..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../js/resources/js-test-pre.js"></script>
-<script type="text/javascript">
-shouldNotBe('window.webkitNotifications', 'undefined');
-shouldNotThrow('window.webkitNotifications.requestPermission()');
-</script>
-<script src="../js/resources/js-test-post.js"></script>
-</head>
-</html>
index 848a2ba..f3cf6bf 100644 (file)
@@ -1,3 +1,35 @@
+2013-02-28  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r144126 and r144176.
+        http://trac.webkit.org/changeset/144126
+        http://trac.webkit.org/changeset/144176
+        https://bugs.webkit.org/show_bug.cgi?id=111096
+
+        Caused fast/notifications/notifications-request-
+        permission.html to crash (Requested by abarth on #webkit).
+
+        * GNUmakefile.list.am:
+        * Modules/notifications/Notification.h:
+        (Notification):
+        * Modules/notifications/Notification.idl:
+        * Target.pri:
+        * UseJSC.cmake:
+        * UseV8.cmake:
+        * WebCore.gypi:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.vcxproj/WebCore.vcxproj:
+        * WebCore.vcxproj/WebCore.vcxproj.filters:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/JSNotificationCustom.cpp: Added.
+        (WebCore):
+        (WebCore::JSNotification::requestPermission):
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateParametersCheck):
+        * bindings/scripts/test/JS/JSTestObj.cpp:
+        * bindings/v8/custom/V8NotificationCustom.cpp: Added.
+        (WebCore):
+        (WebCore::V8Notification::requestPermissionMethodCustom):
+
 2013-02-28  Nate Chapin  <japhet@chromium.org>
 
         Crash in CachedRawResource::responseReceived().
index 5cb7830..de35dc1 100644 (file)
@@ -2418,6 +2418,7 @@ webcore_sources += \
        Source/WebCore/bindings/js/JSNodeFilterCustom.cpp \
        Source/WebCore/bindings/js/JSNodeIteratorCustom.cpp \
        Source/WebCore/bindings/js/JSNodeListCustom.cpp \
+       Source/WebCore/bindings/js/JSNotificationCustom.cpp \
        Source/WebCore/bindings/js/JSOscillatorNodeCustom.cpp \
        Source/WebCore/bindings/js/JSPannerNodeCustom.cpp \
        Source/WebCore/bindings/js/JSPerformanceEntryCustom.cpp \
index 89fb2f6..6fce5ed 100644 (file)
@@ -147,7 +147,7 @@ public:
 #if ENABLE(NOTIFICATIONS)
     static const String& permission(ScriptExecutionContext*);
     static const String& permissionString(NotificationClient::Permission);
-    static void requestPermission(ScriptExecutionContext*, PassRefPtr<NotificationPermissionCallback> = 0);
+    static void requestPermission(ScriptExecutionContext*, PassRefPtr<NotificationPermissionCallback>);
 #endif
 
 private:
index 194e89b..e0a21f9 100644 (file)
@@ -51,7 +51,7 @@
 
 #if defined(ENABLE_NOTIFICATIONS) && ENABLE_NOTIFICATIONS
     static readonly attribute [CallWith=ScriptExecutionContext] DOMString permission;
-    [CallWith=ScriptExecutionContext] static void requestPermission(in [Optional, Callback] NotificationPermissionCallback callback);
+    [Custom] static void requestPermission(in NotificationPermissionCallback callback);
 #endif
 
     attribute EventListener onshow;
index d607912..de4247e 100644 (file)
@@ -171,6 +171,7 @@ SOURCES += \
      bindings/js/JSNodeFilterCustom.cpp \
      bindings/js/JSNodeIteratorCustom.cpp \
      bindings/js/JSNodeListCustom.cpp \
+     bindings/js/JSNotificationCustom.cpp \
      bindings/js/JSPluginElementFunctions.cpp \
      bindings/js/JSPopStateEventCustom.cpp \
      bindings/js/JSProcessingInstructionCustom.cpp \
index 839f4bf..83b8b9f 100644 (file)
@@ -121,6 +121,7 @@ list(APPEND WebCore_SOURCES
     bindings/js/JSNodeFilterCustom.cpp
     bindings/js/JSNodeIteratorCustom.cpp
     bindings/js/JSNodeListCustom.cpp
+    bindings/js/JSNotificationCustom.cpp
     bindings/js/JSPluginElementFunctions.cpp
     bindings/js/JSPopStateEventCustom.cpp
     bindings/js/JSProcessingInstructionCustom.cpp
@@ -236,6 +237,7 @@ endif ()
 if (ENABLE_NOTIFICATIONS)
     list(APPEND WebCore_SOURCES
         bindings/js/JSDesktopNotificationsCustom.cpp
+        bindings/js/JSNotificationCustom.cpp
     )
 endif ()
 
index cde56a4..09ab846 100644 (file)
@@ -134,6 +134,7 @@ list(APPEND WebCore_SOURCES
     bindings/v8/custom/V8NamedNodesCollection.cpp
     bindings/v8/custom/V8NodeCustom.cpp
     bindings/v8/custom/V8NodeListCustom.cpp
+    bindings/v8/custom/V8NotificationCustom.cpp
     bindings/v8/custom/V8NotificationCenterCustom.cpp
     bindings/v8/custom/V8OscillatorNodeCustom.cpp
     bindings/v8/custom/V8PerformanceEntryCustom.cpp
index a8aedcd..08db81a 100644 (file)
             'bindings/v8/custom/V8NamedNodesCollection.h',
             'bindings/v8/custom/V8NodeCustom.cpp',
             'bindings/v8/custom/V8NodeListCustom.cpp',
+            'bindings/v8/custom/V8NotificationCustom.cpp',
             'bindings/v8/custom/V8NotificationCenterCustom.cpp',
             'bindings/v8/custom/V8OscillatorNodeCustom.cpp',
             'bindings/v8/custom/V8PannerNodeCustom.cpp',
index 589adf5..74a19d6 100755 (executable)
                                        </FileConfiguration>
                                </File>
                                <File
+                                       RelativePath="..\bindings\js\JSNotificationCustom.cpp"
+                                       >
+                                       <FileConfiguration
+                                               Name="Debug|Win32"
+                                               ExcludedFromBuild="true"
+                                               >
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                               />
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Release|Win32"
+                                               ExcludedFromBuild="true"
+                                               >
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                               />
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Debug_Cairo_CFLite|Win32"
+                                               ExcludedFromBuild="true"
+                                               >
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                               />
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Release_Cairo_CFLite|Win32"
+                                               ExcludedFromBuild="true"
+                                               >
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                               />
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Debug_All|Win32"
+                                               ExcludedFromBuild="true"
+                                               >
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                               />
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Production|Win32"
+                                               ExcludedFromBuild="true"
+                                               >
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                               />
+                                       </FileConfiguration>
+                               </File>
+                               <File
                                        RelativePath="..\bindings\js\JSPluginElementFunctions.cpp"
                                        >
                                        <FileConfiguration
index 70bef46..6f6cc29 100644 (file)
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
     </ClCompile>
+    <ClCompile Include="..\bindings\js\JSNotificationCustom.cpp">
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
+    </ClCompile>
     <ClCompile Include="..\bindings\js\JSPluginElementFunctions.cpp">
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">true</ExcludedFromBuild>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
-</Project>
+</Project>
\ No newline at end of file
index a582948..29e5e16 100644 (file)
     <ClCompile Include="..\bindings\js\JSNodeListCustom.cpp">
       <Filter>bindings\js</Filter>
     </ClCompile>
+    <ClCompile Include="..\bindings\js\JSNotificationCustom.cpp">
+      <Filter>bindings\js</Filter>
+    </ClCompile>
     <ClCompile Include="..\bindings\js\JSPluginElementFunctions.cpp">
       <Filter>bindings\js</Filter>
     </ClCompile>
       <Filter>rendering</Filter>
     </CustomBuildStep>
   </ItemGroup>
-</Project>
+</Project>
\ No newline at end of file
index f15c9f1..d816496 100644 (file)
                31FB1A66120A5D3F00DC02A0 /* JSDeviceMotionEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 31FB1A64120A5D3F00DC02A0 /* JSDeviceMotionEvent.h */; };
                31FB1A6C120A5D6900DC02A0 /* JSDeviceMotionEventCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31FB1A6B120A5D6900DC02A0 /* JSDeviceMotionEventCustom.cpp */; };
                31FE6DFA15004C2A0004EBC4 /* NotificationPermissionCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 31EC1DAC14FF26EA00C94662 /* NotificationPermissionCallback.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               31FE6E6D1501A3BF0004EBC4 /* JSNotificationCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31FE6E6C1501A3BF0004EBC4 /* JSNotificationCustom.cpp */; };
                3314ACEB10892086000F0E56 /* JSExceptionBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3314ACE910892086000F0E56 /* JSExceptionBase.cpp */; };
                3314ACEC10892086000F0E56 /* JSExceptionBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 3314ACEA10892086000F0E56 /* JSExceptionBase.h */; };
                33503C9A10179A74003B47E1 /* NotificationClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 33503C9910179A74003B47E1 /* NotificationClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
                31FB1A63120A5D3F00DC02A0 /* JSDeviceMotionEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDeviceMotionEvent.cpp; sourceTree = "<group>"; };
                31FB1A64120A5D3F00DC02A0 /* JSDeviceMotionEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDeviceMotionEvent.h; sourceTree = "<group>"; };
                31FB1A6B120A5D6900DC02A0 /* JSDeviceMotionEventCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDeviceMotionEventCustom.cpp; sourceTree = "<group>"; };
+               31FE6E6C1501A3BF0004EBC4 /* JSNotificationCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSNotificationCustom.cpp; sourceTree = "<group>"; };
                3314ACE910892086000F0E56 /* JSExceptionBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSExceptionBase.cpp; sourceTree = "<group>"; };
                3314ACEA10892086000F0E56 /* JSExceptionBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSExceptionBase.h; sourceTree = "<group>"; };
                333F704E0FB49CA2008E12A6 /* Notification.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Notification.idl; path = Modules/notifications/Notification.idl; sourceTree = "<group>"; };
                                BCB773600C17853D00132BA4 /* JSNodeFilterCustom.cpp */,
                                1A750DD30A90E729000FF215 /* JSNodeIteratorCustom.cpp */,
                                BCD9C2610C17AA67005C90A2 /* JSNodeListCustom.cpp */,
+                               31FE6E6C1501A3BF0004EBC4 /* JSNotificationCustom.cpp */,
                                FDBD1DFB167FE27D0051A11E /* JSOscillatorNodeCustom.cpp */,
                                FD8AA63D169514A700D2EA68 /* JSPannerNodeCustom.cpp */,
                                A85F22081430377D007CC884 /* JSPopStateEventCustom.cpp */,
                                65DF31FD09D1CC60000BE325 /* JSNotation.cpp in Sources */,
                                33503CA310179AD7003B47E1 /* JSNotification.cpp in Sources */,
                                33503CA510179AD7003B47E1 /* JSNotificationCenter.cpp in Sources */,
+                               31FE6E6D1501A3BF0004EBC4 /* JSNotificationCustom.cpp in Sources */,
                                31EC1E2814FF60EE00C94662 /* JSNotificationPermissionCallback.cpp in Sources */,
                                7E46F6FA1627A2CA00062223 /* JSOESElementIndexUint.cpp in Sources */,
                                9001788012E0370700648462 /* JSOESStandardDerivatives.cpp in Sources */,
diff --git a/Source/WebCore/bindings/js/JSNotificationCustom.cpp b/Source/WebCore/bindings/js/JSNotificationCustom.cpp
new file mode 100644 (file)
index 0000000..f395765
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2012 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#if ENABLE(NOTIFICATIONS)
+#include "JSNotification.h"
+
+#include "CallbackFunction.h"
+#include "JSNotificationPermissionCallback.h"
+#include <runtime/Error.h>
+
+using namespace JSC;
+
+namespace WebCore {
+
+JSValue JSNotification::requestPermission(ExecState* exec)
+{
+    // Arguments: NotificationPermissionCallback
+    if (!exec->argument(0).isObject())
+        return throwTypeError(exec);
+    
+    RefPtr<NotificationPermissionCallback> callback = createFunctionOnlyCallback<JSNotificationPermissionCallback>(exec, static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject()), exec->argument(0));
+    if (exec->hadException())
+        return jsUndefined();
+    
+    ASSERT(callback);
+    ScriptExecutionContext* scriptContext = static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
+    Notification::requestPermission(scriptContext, callback.release());
+    return jsUndefined();
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(NOTIFICATIONS)
index 6adc988..e451523 100644 (file)
@@ -2704,7 +2704,6 @@ sub GenerateParametersCheck
                 push(@$outputArray, "        if (!exec->argument($argsIndex).isFunction())\n");
                 push(@$outputArray, "            return throwVMTypeError(exec);\n");
                 if ($function->isStatic) {
-                    AddToImplIncludes("CallbackFunction.h");
                     push(@$outputArray, "        $name = createFunctionOnlyCallback<${callbackClassName}>(exec, static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject()), exec->argument($argsIndex));\n");
                 } else {
                     push(@$outputArray, "        $name = ${callbackClassName}::create(asObject(exec->argument($argsIndex)), castedThis->globalObject());\n");
@@ -2714,7 +2713,6 @@ sub GenerateParametersCheck
                 push(@$outputArray, "    if (exec->argumentCount() <= $argsIndex || !exec->argument($argsIndex).isFunction())\n");
                 push(@$outputArray, "        return throwVMTypeError(exec);\n");
                 if ($function->isStatic) {
-                    AddToImplIncludes("CallbackFunction.h");
                     push(@$outputArray, "    RefPtr<$argType> $name = createFunctionOnlyCallback<${callbackClassName}>(exec, static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject()), exec->argument($argsIndex));\n");
                 } else {
                     push(@$outputArray, "    RefPtr<$argType> $name = ${callbackClassName}::create(asObject(exec->argument($argsIndex)), castedThis->globalObject());\n");
index 0aefb06..6ea97e1 100644 (file)
@@ -21,7 +21,6 @@
 #include "config.h"
 #include "JSTestObj.h"
 
-#include "CallbackFunction.h"
 #include "DOMStringList.h"
 #include "Dictionary.h"
 #include "Document.h"
diff --git a/Source/WebCore/bindings/v8/custom/V8NotificationCustom.cpp b/Source/WebCore/bindings/v8/custom/V8NotificationCustom.cpp
new file mode 100644 (file)
index 0000000..e0e97e1
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2012 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#if ENABLE(NOTIFICATIONS)
+#include "V8Notification.h"
+
+#include "ExceptionCode.h"
+#include "V8Callback.h"
+#include "V8NotificationPermissionCallback.h"
+
+namespace WebCore {
+
+v8::Handle<v8::Value> V8Notification::requestPermissionMethodCustom(const v8::Arguments& args)
+{
+    bool succeeded = false;
+    RefPtr<V8NotificationPermissionCallback> callback = createFunctionOnlyCallback<V8NotificationPermissionCallback>(args[0], succeeded, args.GetIsolate());
+    if (!succeeded)
+        return v8::Undefined();
+    ASSERT(callback);
+
+    Notification::requestPermission(getScriptExecutionContext(), callback.release());
+    return v8::Undefined();
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(NOTIFICATIONS)