Title: [124515] trunk/Source/WebCore
Revision
124515
Author
[email protected]
Date
2012-08-02 15:46:01 -0700 (Thu, 02 Aug 2012)

Log Message

BindingSecurityBase serves no purpose and should be removed
https://bugs.webkit.org/show_bug.cgi?id=93025

Reviewed by Eric Seidel.

Now that we don't use templates in the generic bindings, we can merge
BindingSecurity and BindingSecurityBase. This patch also removes some
functions that are no longer used (and reduces the number of
#includes).

No behavior change.

* GNUmakefile.list.am:
* WebCore.gypi:
* bindings/generic/BindingSecurity.h:
(WebCore):
(BindingSecurity):
* bindings/generic/BindingSecurityBase.cpp: Removed.
* bindings/generic/BindingSecurityBase.h: Removed.
* bindings/v8/V8Binding.h:
* bindings/v8/V8Utilities.cpp:
* bindings/v8/custom/V8MutationObserverCustom.cpp:

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (124514 => 124515)


--- trunk/Source/WebCore/ChangeLog	2012-08-02 22:41:18 UTC (rev 124514)
+++ trunk/Source/WebCore/ChangeLog	2012-08-02 22:46:01 UTC (rev 124515)
@@ -1,3 +1,28 @@
+2012-08-02  Adam Barth  <[email protected]>
+
+        BindingSecurityBase serves no purpose and should be removed
+        https://bugs.webkit.org/show_bug.cgi?id=93025
+
+        Reviewed by Eric Seidel.
+
+        Now that we don't use templates in the generic bindings, we can merge
+        BindingSecurity and BindingSecurityBase. This patch also removes some
+        functions that are no longer used (and reduces the number of
+        #includes).
+
+        No behavior change.
+
+        * GNUmakefile.list.am:
+        * WebCore.gypi:
+        * bindings/generic/BindingSecurity.h:
+        (WebCore):
+        (BindingSecurity):
+        * bindings/generic/BindingSecurityBase.cpp: Removed.
+        * bindings/generic/BindingSecurityBase.h: Removed.
+        * bindings/v8/V8Binding.h:
+        * bindings/v8/V8Utilities.cpp:
+        * bindings/v8/custom/V8MutationObserverCustom.cpp:
+
 2012-08-02  Ryosuke Niwa  <[email protected]>
 
         Let XCode have its own away and also sort the files.

Modified: trunk/Source/WebCore/GNUmakefile.list.am (124514 => 124515)


--- trunk/Source/WebCore/GNUmakefile.list.am	2012-08-02 22:41:18 UTC (rev 124514)
+++ trunk/Source/WebCore/GNUmakefile.list.am	2012-08-02 22:46:01 UTC (rev 124515)
@@ -1363,8 +1363,6 @@
 	Source/WebCore/accessibility/AXObjectCache.h \
 	Source/WebCore/bindings/generic/ActiveDOMCallback.cpp \
 	Source/WebCore/bindings/generic/ActiveDOMCallback.h \
-	Source/WebCore/bindings/generic/BindingSecurityBase.cpp \
-	Source/WebCore/bindings/generic/BindingSecurityBase.h \
 	Source/WebCore/bindings/generic/BindingSecurity.h \
 	Source/WebCore/bindings/generic/GenericBinding.h \
 	Source/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp \

Modified: trunk/Source/WebCore/UseV8.cmake (124514 => 124515)


--- trunk/Source/WebCore/UseV8.cmake	2012-08-02 22:41:18 UTC (rev 124514)
+++ trunk/Source/WebCore/UseV8.cmake	2012-08-02 22:46:01 UTC (rev 124515)
@@ -16,6 +16,8 @@
 )
 
 LIST(APPEND WebCore_SOURCES
+    bindings/generic/BindingSecurity.cpp
+
     bindings/v8/BindingState.cpp
     bindings/v8/DOMData.cpp
     bindings/v8/DOMDataStore.cpp

Modified: trunk/Source/WebCore/WebCore.gypi (124514 => 124515)


--- trunk/Source/WebCore/WebCore.gypi	2012-08-02 22:41:18 UTC (rev 124514)
+++ trunk/Source/WebCore/WebCore.gypi	2012-08-02 22:46:01 UTC (rev 124515)
@@ -1898,9 +1898,8 @@
             'bindings/cpp/WebNativeNodeFilterCondition.h',
             'bindings/generic/ActiveDOMCallback.cpp',
             'bindings/generic/ActiveDOMCallback.h',
+            'bindings/generic/BindingSecurity.cpp',
             'bindings/generic/BindingSecurity.h',
-            'bindings/generic/BindingSecurityBase.cpp',
-            'bindings/generic/BindingSecurityBase.h',
             'bindings/generic/GenericBinding.h',
             'bindings/generic/RuntimeEnabledFeatures.cpp',
             'bindings/generic/RuntimeEnabledFeatures.h',

Modified: trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj (124514 => 124515)


--- trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj	2012-08-02 22:41:18 UTC (rev 124514)
+++ trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj	2012-08-02 22:46:01 UTC (rev 124515)
@@ -63774,18 +63774,6 @@
 					>
 				</File>
 				<File
-					RelativePath="..\bindings\generic\BindingSecurity.h"
-					>
-				</File>
-				<File
-					RelativePath="..\bindings\generic\BindingSecurityBase.cpp"
-					>
-				</File>
-				<File
-					RelativePath="..\bindings\generic\BindingSecurityBase.h"
-					>
-				</File>
-				<File
 					RelativePath="..\bindings\generic\GenericBinding.h"
 					>
 				</File>

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (124514 => 124515)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2012-08-02 22:41:18 UTC (rev 124514)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2012-08-02 22:46:01 UTC (rev 124515)
@@ -3785,9 +3785,6 @@
 		A6148A6812E41D940044A784 /* DOMHTMLKeygenElement.mm in Sources */ = {isa = PBXBuildFile; fileRef = A6148A6612E41D940044A784 /* DOMHTMLKeygenElement.mm */; };
 		A6148A7812E41E3B0044A784 /* JSHTMLKeygenElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A6148A7612E41E3B0044A784 /* JSHTMLKeygenElement.cpp */; };
 		A6148A7912E41E3B0044A784 /* JSHTMLKeygenElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A6148A7712E41E3B0044A784 /* JSHTMLKeygenElement.h */; };
-		A622A8FB122C44A600A785B3 /* BindingSecurity.h in Headers */ = {isa = PBXBuildFile; fileRef = A622A8F5122C44A600A785B3 /* BindingSecurity.h */; };
-		A622A8FC122C44A600A785B3 /* BindingSecurityBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A622A8F6122C44A600A785B3 /* BindingSecurityBase.cpp */; };
-		A622A8FD122C44A600A785B3 /* BindingSecurityBase.h in Headers */ = {isa = PBXBuildFile; fileRef = A622A8F7122C44A600A785B3 /* BindingSecurityBase.h */; };
 		A622A8FF122C44A600A785B3 /* GenericBinding.h in Headers */ = {isa = PBXBuildFile; fileRef = A622A8F9122C44A600A785B3 /* GenericBinding.h */; };
 		A6D169621346B49B000EB770 /* ShadowRoot.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A6D169611346B49B000EB770 /* ShadowRoot.cpp */; };
 		A6D169641346B4C1000EB770 /* ShadowRoot.h in Headers */ = {isa = PBXBuildFile; fileRef = A6D169631346B4C1000EB770 /* ShadowRoot.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -10971,9 +10968,6 @@
 		A6148A7612E41E3B0044A784 /* JSHTMLKeygenElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLKeygenElement.cpp; sourceTree = "<group>"; };
 		A6148A7712E41E3B0044A784 /* JSHTMLKeygenElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSHTMLKeygenElement.h; sourceTree = "<group>"; };
 		A6148A7F12E41ED10044A784 /* HTMLKeygenElement.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = HTMLKeygenElement.idl; sourceTree = "<group>"; };
-		A622A8F5122C44A600A785B3 /* BindingSecurity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BindingSecurity.h; path = generic/BindingSecurity.h; sourceTree = "<group>"; };
-		A622A8F6122C44A600A785B3 /* BindingSecurityBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BindingSecurityBase.cpp; path = generic/BindingSecurityBase.cpp; sourceTree = "<group>"; };
-		A622A8F7122C44A600A785B3 /* BindingSecurityBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BindingSecurityBase.h; path = generic/BindingSecurityBase.h; sourceTree = "<group>"; };
 		A622A8F9122C44A600A785B3 /* GenericBinding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GenericBinding.h; path = generic/GenericBinding.h; sourceTree = "<group>"; };
 		A6D169611346B49B000EB770 /* ShadowRoot.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ShadowRoot.cpp; sourceTree = "<group>"; };
 		A6D169631346B4C1000EB770 /* ShadowRoot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShadowRoot.h; sourceTree = "<group>"; };
@@ -19999,9 +19993,6 @@
 			children = (
 				B5D31DF811CF610B009F22B4 /* ActiveDOMCallback.cpp */,
 				B5D31DF911CF610B009F22B4 /* ActiveDOMCallback.h */,
-				A622A8F5122C44A600A785B3 /* BindingSecurity.h */,
-				A622A8F6122C44A600A785B3 /* BindingSecurityBase.cpp */,
-				A622A8F7122C44A600A785B3 /* BindingSecurityBase.h */,
 				A622A8F9122C44A600A785B3 /* GenericBinding.h */,
 			);
 			name = generic;
@@ -22236,8 +22227,6 @@
 				BCE789861120E7A60060ECE5 /* BidiRun.h in Headers */,
 				A8C402931348B2220063F1E5 /* BidiRunList.h in Headers */,
 				938192050F87E1EC00D5352A /* BinaryPropertyList.h in Headers */,
-				A622A8FB122C44A600A785B3 /* BindingSecurity.h in Headers */,
-				A622A8FD122C44A600A785B3 /* BindingSecurityBase.h in Headers */,
 				F35AE5AC14925F5B004D5776 /* BindingVisitors.h in Headers */,
 				FD31608D12B026F700C1A359 /* Biquad.h in Headers */,
 				FD31602512B0267600C1A359 /* BiquadDSPKernel.h in Headers */,
@@ -24205,7 +24194,6 @@
 				2917B5631473496C0052C9D0 /* LayerFlushSchedulerClient.h in Headers */,
 				A12538D413F9B60A00024754 /* LayoutRepainter.h in Headers */,
 				2D9066070BE141D400956998 /* LayoutState.h in Headers */,
-				D630E2AC149BF344005B2F93 /* LayoutTestSupport.h in Headers */,
 				BACF290113B2A0D500781F90 /* LayoutTypes.h in Headers */,
 				512DD8F50D91E6AF000F89EE /* LegacyWebArchive.h in Headers */,
 				BCE65BEB0EACDF16007E4533 /* Length.h in Headers */,
@@ -24280,6 +24268,7 @@
 				BCB16C180979C3BD00467741 /* MemoryCache.h in Headers */,
 				9FFE3E7B11B59C5D0037874E /* MemoryInfo.h in Headers */,
 				4F32BB1B14FA85E800F6C1A3 /* MemoryInstrumentation.h in Headers */,
+				4F8565EA1530356E00FAE776 /* MemoryInstrumentationImpl.h in Headers */,
 				6571DCC81385E6A400702DD0 /* MemoryPressureHandler.h in Headers */,
 				D630E2AC149BF344005B2F95 /* MemoryUsageSupport.h in Headers */,
 				93309DFA099E64920056E581 /* MergeIdenticalElementsCommand.h in Headers */,
@@ -25375,7 +25364,6 @@
 				E1BE512E0CF6C512002EA959 /* XSLTUnicodeSort.h in Headers */,
 				977E2E0F12F0FC9C00C13379 /* XSSAuditor.h in Headers */,
 				FD537353137B651800008DCE /* ZeroPole.h in Headers */,
-				4F8565EA1530356E00FAE776 /* MemoryInstrumentationImpl.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -25819,7 +25807,6 @@
 				B2C3DA230D006C1D00EF6F26 /* BidiContext.cpp in Sources */,
 				BCE7898B1120E8020060ECE5 /* BidiRun.cpp in Sources */,
 				938192030F87E1E600D5352A /* BinaryPropertyList.cpp in Sources */,
-				A622A8FC122C44A600A785B3 /* BindingSecurityBase.cpp in Sources */,
 				FD31608C12B026F700C1A359 /* Biquad.cpp in Sources */,
 				FD31602412B0267600C1A359 /* BiquadDSPKernel.cpp in Sources */,
 				FDC54F041399B0DA008D9117 /* BiquadFilterNode.cpp in Sources */,
@@ -27564,6 +27551,7 @@
 				BCB16C170979C3BD00467741 /* MemoryCache.cpp in Sources */,
 				9FFE3E7A11B59C5D0037874E /* MemoryInfo.cpp in Sources */,
 				F3BFC9D315C177EC004244E5 /* MemoryInstrumentation.cpp in Sources */,
+				4F8565E91530356E00FAE776 /* MemoryInstrumentationImpl.cpp in Sources */,
 				657EDA081385CB97004E0645 /* MemoryPressureHandler.cpp in Sources */,
 				657EDA0B1385CBD8004E0645 /* MemoryPressureHandlerMac.mm in Sources */,
 				D6FDAEF3149C06190037B1E3 /* MemoryUsageSupport.cpp in Sources */,
@@ -28450,7 +28438,6 @@
 				E1BE512D0CF6C512002EA959 /* XSLTUnicodeSort.cpp in Sources */,
 				977E2E0E12F0FC9C00C13379 /* XSSAuditor.cpp in Sources */,
 				FD537352137B651800008DCE /* ZeroPole.cpp in Sources */,
-				4F8565E91530356E00FAE776 /* MemoryInstrumentationImpl.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};

Added: trunk/Source/WebCore/bindings/generic/BindingSecurity.cpp (0 => 124515)


--- trunk/Source/WebCore/bindings/generic/BindingSecurity.cpp	                        (rev 0)
+++ trunk/Source/WebCore/bindings/generic/BindingSecurity.cpp	2012-08-02 22:46:01 UTC (rev 124515)
@@ -0,0 +1,103 @@
+/*
+ * Copyright (C) 2009 Google 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:
+ * 
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * 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.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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 THE COPYRIGHT
+ * OWNER 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"
+#include "BindingSecurity.h"
+
+#include "BindingState.h"
+#include "DOMWindow.h"
+#include "Document.h"
+#include "Frame.h"
+#include "HTMLFrameElementBase.h"
+#include "HTMLParserIdioms.h"
+#include "SecurityOrigin.h"
+#include "Settings.h"
+
+namespace WebCore {
+
+static bool canAccess(DOMWindow* activeWindow, DOMWindow* targetWindow)
+{
+    ASSERT(targetWindow);
+    if (activeWindow == targetWindow)
+        return true;
+
+    if (!activeWindow)
+        return false;
+
+    SecurityOrigin* activeSecurityOrigin = activeWindow->securityOrigin();
+    SecurityOrigin* targetSecurityOrigin = targetWindow->securityOrigin();
+
+    // We have seen crashes were the security origin of the target has not been
+    // initialized. Defend against that.
+    if (!targetSecurityOrigin)
+        return false;
+
+    if (activeSecurityOrigin->canAccess(targetSecurityOrigin))
+        return true;
+
+    return false;
+}
+
+bool BindingSecurity::canAccessFrame(BindingState* state, Frame* target, bool reportError)
+{
+    if (!target)
+        return false;
+
+    if (!canAccess(activeWindow(state), target->domWindow())) {
+        if (reportError)
+            immediatelyReportUnsafeAccessTo(state, target);
+        return false;
+    }
+    return true;
+}
+
+bool BindingSecurity::shouldAllowAccessToNode(BindingState* state, Node* node)
+{
+    if (!node)
+        return false;
+
+    Frame* target = node->document()->frame();
+    if (!target)
+        return false;
+
+    return canAccessFrame(state, target, true);
+}
+
+bool BindingSecurity::allowSettingFrameSrcToJavascriptUrl(BindingState* state, HTMLFrameElementBase* frame, const String& value)
+{
+    if (protocolIsJavaScript(stripLeadingAndTrailingHTMLSpaces(value))) {
+        Node* contentDocument = frame->contentDocument();
+        if (contentDocument && !shouldAllowAccessToNode(state, contentDocument))
+            return false;
+    }
+    return true;
+}
+
+}

Modified: trunk/Source/WebCore/bindings/generic/BindingSecurity.h (124514 => 124515)


--- trunk/Source/WebCore/bindings/generic/BindingSecurity.h	2012-08-02 22:41:18 UTC (rev 124514)
+++ trunk/Source/WebCore/bindings/generic/BindingSecurity.h	2012-08-02 22:46:01 UTC (rev 124515)
@@ -31,95 +31,23 @@
 #ifndef BindingSecurity_h
 #define BindingSecurity_h
 
-#include "BindingSecurityBase.h"
-#include "DOMWindow.h"
-#include "Document.h"
-#include "Element.h"
-#include "Frame.h"
-#include "GenericBinding.h"
-#include "HTMLFrameElementBase.h"
-#include "HTMLNames.h"
-#include "HTMLParserIdioms.h"
-#include "ScriptController.h"
-#include "Settings.h"
+#include <wtf/text/WTFString.h>
 
 namespace WebCore {
 
+class BindingState;
 class DOMWindow;
+class Frame;
+class HTMLFrameElementBase;
 class Node;
 
-class BindingSecurity : public BindingSecurityBase {
+class BindingSecurity {
 public:
-    static bool canAccessFrame(BindingState*, Frame*, bool reportError);
     static bool shouldAllowAccessToNode(BindingState*, Node* target);
-    static bool allowPopUp(BindingState*);
+    static bool canAccessFrame(BindingState*, Frame*, bool reportError);
     static bool allowSettingFrameSrcToJavascriptUrl(BindingState*, HTMLFrameElementBase*, const String& value);
-    static bool allowSettingSrcToJavascriptURL(BindingState*, Element*, const String& name, const String& value);
-
-private:
-    static bool canAccessWindow(BindingState*, DOMWindow* target);
 };
 
-inline bool BindingSecurity::canAccessWindow(BindingState* state, DOMWindow* targetWindow)
-{
-    DOMWindow* active = activeWindow(state);
-    return canAccess(active, targetWindow);
 }
 
-inline bool BindingSecurity::canAccessFrame(BindingState* state, Frame* target, bool reportError)
-{
-    // The subject is detached from a frame, deny accesses.
-    if (!target)
-        return false;
-
-    if (!canAccessWindow(state, getDOMWindow(target))) {
-        if (reportError)
-            immediatelyReportUnsafeAccessTo(state, target);
-        return false;
-    }
-    return true;
-}
-
-inline bool BindingSecurity::shouldAllowAccessToNode(BindingState* state, Node* node)
-{
-    if (!node)
-        return false;
-
-    Frame* target = getFrame(node);
-    if (!target)
-        return false;
-
-    return canAccessFrame(state, target, true);
-}
-
-inline bool BindingSecurity::allowPopUp(BindingState* state)
-{
-    if (ScriptController::processingUserGesture())
-        return true;
-
-    Frame* frame = firstFrame(state);
-    ASSERT(frame);
-    Settings* settings = frame->settings();
-    return settings && settings->_javascript_CanOpenWindowsAutomatically();
-}
-
-inline bool BindingSecurity::allowSettingFrameSrcToJavascriptUrl(BindingState* state, HTMLFrameElementBase* frame, const String& value)
-{
-    if (protocolIsJavaScript(stripLeadingAndTrailingHTMLSpaces(value))) {
-        Node* contentDoc = frame->contentDocument();
-        if (contentDoc && !shouldAllowAccessToNode(state, contentDoc))
-            return false;
-    }
-    return true;
-}
-
-inline bool BindingSecurity::allowSettingSrcToJavascriptURL(BindingState* state, Element* element, const String& name, const String& value)
-{
-    if ((element->hasTagName(HTMLNames::iframeTag) || element->hasTagName(HTMLNames::frameTag)) && equalIgnoringCase(name, "src"))
-        return allowSettingFrameSrcToJavascriptUrl(state, static_cast<HTMLFrameElementBase*>(element), value);
-    return true;
-}
-
-}
-
-#endif // BindingSecurity_h
+#endif

Deleted: trunk/Source/WebCore/bindings/generic/BindingSecurityBase.cpp (124514 => 124515)


--- trunk/Source/WebCore/bindings/generic/BindingSecurityBase.cpp	2012-08-02 22:41:18 UTC (rev 124514)
+++ trunk/Source/WebCore/bindings/generic/BindingSecurityBase.cpp	2012-08-02 22:46:01 UTC (rev 124515)
@@ -1,74 +0,0 @@
-/*
- * Copyright (C) 2009 Google 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:
- * 
- *     * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *     * 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.
- *     * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "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 THE COPYRIGHT
- * OWNER 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"
-#include "BindingSecurityBase.h"
-
-#include "DOMWindow.h"
-#include "Document.h"
-#include "Frame.h"
-#include "SecurityOrigin.h"
-
-namespace WebCore {
-
-DOMWindow* BindingSecurityBase::getDOMWindow(Frame* frame)
-{
-    return frame->domWindow();
-}
-
-Frame* BindingSecurityBase::getFrame(Node* node)
-{
-    return node->document()->frame();
-}
-
-bool BindingSecurityBase::canAccess(DOMWindow* activeWindow, DOMWindow* targetWindow)
-{
-    ASSERT(targetWindow);
-    if (activeWindow == targetWindow)
-        return true;
-
-    if (!activeWindow)
-        return false;
-
-    SecurityOrigin* activeSecurityOrigin = activeWindow->securityOrigin();
-    SecurityOrigin* targetSecurityOrigin = targetWindow->securityOrigin();
-
-    // We have seen crashes were the security origin of the target has not been
-    // initialized. Defend against that.
-    if (!targetSecurityOrigin)
-        return false;
-
-    if (activeSecurityOrigin->canAccess(targetSecurityOrigin))
-        return true;
-
-    return false;
-}
-
-}

Deleted: trunk/Source/WebCore/bindings/generic/BindingSecurityBase.h (124514 => 124515)


--- trunk/Source/WebCore/bindings/generic/BindingSecurityBase.h	2012-08-02 22:41:18 UTC (rev 124514)
+++ trunk/Source/WebCore/bindings/generic/BindingSecurityBase.h	2012-08-02 22:46:01 UTC (rev 124515)
@@ -1,52 +0,0 @@
-/*
- * Copyright (C) 2009 Google 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:
- * 
- *     * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *     * 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.
- *     * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "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 THE COPYRIGHT
- * OWNER 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.
- */
-
-#ifndef BindingSecurityBase_h
-#define BindingSecurityBase_h
-
-namespace WebCore {
-
-class DOMWindow;
-class Frame;
-class Node;
-
-// Helper functions for BindingSecurity that depend on WebCore classes, and
-// thus should not be implemented in BindingSecurity.h, which contains template
-// method definitions.
-class BindingSecurityBase {
-protected:
-    static DOMWindow* getDOMWindow(Frame*);
-    static Frame* getFrame(Node*);
-    static bool canAccess(DOMWindow* active, DOMWindow* target);
-};
-
-}
-
-#endif // BindingSecurityBase_h

Modified: trunk/Source/WebCore/bindings/v8/V8Binding.h (124514 => 124515)


--- trunk/Source/WebCore/bindings/v8/V8Binding.h	2012-08-02 22:41:18 UTC (rev 124514)
+++ trunk/Source/WebCore/bindings/v8/V8Binding.h	2012-08-02 22:46:01 UTC (rev 124515)
@@ -33,15 +33,17 @@
 
 #include "BindingSecurity.h"
 #include "DOMDataStore.h"
+#include "Document.h"
+#include "Frame.h"
 #include "PlatformString.h"
 #include "V8BindingMacros.h"
 #include "V8DOMWrapper.h"
 #include "V8GCController.h"
 #include "V8HiddenPropertyName.h"
+#include "V8Proxy.h"
 #include <wtf/MathExtras.h>
 #include <wtf/Noncopyable.h>
 #include <wtf/text/AtomicString.h>
-
 #include <v8.h>
 
 namespace WebCore {

Modified: trunk/Source/WebCore/bindings/v8/V8Utilities.cpp (124514 => 124515)


--- trunk/Source/WebCore/bindings/v8/V8Utilities.cpp	2012-08-02 22:41:18 UTC (rev 124514)
+++ trunk/Source/WebCore/bindings/v8/V8Utilities.cpp	2012-08-02 22:46:01 UTC (rev 124515)
@@ -35,6 +35,7 @@
 #include "Document.h"
 #include "ExceptionCode.h"
 #include "Frame.h"
+#include "GenericBinding.h"
 #include "MessagePort.h"
 #include "ScriptExecutionContext.h"
 #include "ScriptState.h"

Modified: trunk/Source/WebCore/bindings/v8/custom/V8MutationObserverCustom.cpp (124514 => 124515)


--- trunk/Source/WebCore/bindings/v8/custom/V8MutationObserverCustom.cpp	2012-08-02 22:41:18 UTC (rev 124514)
+++ trunk/Source/WebCore/bindings/v8/custom/V8MutationObserverCustom.cpp	2012-08-02 22:46:01 UTC (rev 124515)
@@ -34,6 +34,7 @@
 
 #include "V8MutationObserver.h"
 
+#include "ExceptionCode.h"
 #include "MutationObserver.h"
 #include "V8Binding.h"
 #include "V8BindingMacros.h"
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to