Title: [97637] trunk/Source/WebCore
Revision
97637
Author
eric.carl...@apple.com
Date
2011-10-17 12:22:45 -0700 (Mon, 17 Oct 2011)

Log Message

2011-10-17  Eric Carlson  <eric.carl...@apple.com>

        Cues should be loaded by the cached resource loader
        https://bugs.webkit.org/show_bug.cgi?id=70134

        Reviewed by Darin Adler.

        No new tests, changes covered by existing tests.

        * CMakeLists.txt: Add CachedCues.cpp/h.
        * GNUmakefile.list.am: Ditto.
        * WebCore.gypi: Ditto.
        * WebCore.xcodeproj/project.pbxproj: Ditto.

        * loader/cache/CachedCues.cpp: Added.
        (WebCore::CachedCues::CachedCues):
        (WebCore::CachedCues::~CachedCues):
        (WebCore::CachedCues::data): Called when new data has been loaded, pass it to all registered
            clients.
        * loader/cache/CachedCues.h: Added.

        * loader/cache/CachedResource.cpp:
        (WebCore::defaultPriorityForResourceType): Cues have low loader priority.
        * loader/cache/CachedResource.h:

        * loader/cache/CachedResourceClient.h:
        (WebCore::CachedResourceClient::didReceiveData): New client interface.

        * loader/cache/CachedResourceLoader.cpp:
        (WebCore::createResource): Create and return a new cue loader.
        (WebCore::CachedResourceLoader::requestCues):
        (WebCore::CachedResourceLoader::checkInsecureContent): Cues aren't mentioned in the CPS spec
            yet, but they only work with a media element so use the mdia policy.
        (WebCore::CachedResourceLoader::canRequest): Allow cues to be loaded from any origin like media.
        * loader/cache/CachedResourceLoader.h:

        * loader/cache/CachedResourceRequest.cpp:
        (WebCore::cachedResourceTypeToTargetType):
        * platform/network/chromium/ResourceRequest.h:

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebCore/CMakeLists.txt (97636 => 97637)


--- trunk/Source/WebCore/CMakeLists.txt	2011-10-17 19:09:42 UTC (rev 97636)
+++ trunk/Source/WebCore/CMakeLists.txt	2011-10-17 19:22:45 UTC (rev 97637)
@@ -2056,6 +2056,7 @@
         html/track/WebVTTParser.cpp
         html/track/WebVTTTokenizer.cpp
         loader/CueLoader.cpp
+        loader/cache/CachedCues.cpp
     )
 ENDIF()
 

Modified: trunk/Source/WebCore/ChangeLog (97636 => 97637)


--- trunk/Source/WebCore/ChangeLog	2011-10-17 19:09:42 UTC (rev 97636)
+++ trunk/Source/WebCore/ChangeLog	2011-10-17 19:22:45 UTC (rev 97637)
@@ -1,3 +1,43 @@
+2011-10-17  Eric Carlson  <eric.carl...@apple.com>
+
+        Cues should be loaded by the cached resource loader
+        https://bugs.webkit.org/show_bug.cgi?id=70134
+
+        Reviewed by Darin Adler.
+
+        No new tests, changes covered by existing tests.
+
+        * CMakeLists.txt: Add CachedCues.cpp/h.
+        * GNUmakefile.list.am: Ditto.
+        * WebCore.gypi: Ditto.
+        * WebCore.xcodeproj/project.pbxproj: Ditto.
+
+        * loader/cache/CachedCues.cpp: Added.
+        (WebCore::CachedCues::CachedCues):
+        (WebCore::CachedCues::~CachedCues):
+        (WebCore::CachedCues::data): Called when new data has been loaded, pass it to all registered
+            clients.
+        * loader/cache/CachedCues.h: Added.
+
+        * loader/cache/CachedResource.cpp:
+        (WebCore::defaultPriorityForResourceType): Cues have low loader priority.
+        * loader/cache/CachedResource.h:
+
+        * loader/cache/CachedResourceClient.h:
+        (WebCore::CachedResourceClient::didReceiveData): New client interface.
+
+        * loader/cache/CachedResourceLoader.cpp:
+        (WebCore::createResource): Create and return a new cue loader.
+        (WebCore::CachedResourceLoader::requestCues):
+        (WebCore::CachedResourceLoader::checkInsecureContent): Cues aren't mentioned in the CPS spec
+            yet, but they only work with a media element so use the mdia policy.
+        (WebCore::CachedResourceLoader::canRequest): Allow cues to be loaded from any origin like media.
+        * loader/cache/CachedResourceLoader.h:
+
+        * loader/cache/CachedResourceRequest.cpp:
+        (WebCore::cachedResourceTypeToTargetType):
+        * platform/network/chromium/ResourceRequest.h:
+
 2011-10-17  Dan Bernstein  <m...@apple.com>
 
         <rdar://problem/10293929> REGRESSION (r97525): iChat transcript has horizontal scroll bar when the conversation includes a wide image

Modified: trunk/Source/WebCore/GNUmakefile.list.am (97636 => 97637)


--- trunk/Source/WebCore/GNUmakefile.list.am	2011-10-17 19:09:42 UTC (rev 97636)
+++ trunk/Source/WebCore/GNUmakefile.list.am	2011-10-17 19:22:45 UTC (rev 97637)
@@ -2101,6 +2101,8 @@
 	Source/WebCore/loader/cache/MemoryCache.cpp \
 	Source/WebCore/loader/cache/CachedCSSStyleSheet.cpp \
 	Source/WebCore/loader/cache/CachedCSSStyleSheet.h \
+	Source/WebCore/loader/cache/CachedCues.cpp \
+	Source/WebCore/loader/cache/CachedCues.h \
 	Source/WebCore/loader/cache/CachedFont.cpp \
 	Source/WebCore/loader/cache/CachedFont.h \
 	Source/WebCore/loader/cache/CachedImage.cpp \

Modified: trunk/Source/WebCore/WebCore.gypi (97636 => 97637)


--- trunk/Source/WebCore/WebCore.gypi	2011-10-17 19:09:42 UTC (rev 97636)
+++ trunk/Source/WebCore/WebCore.gypi	2011-10-17 19:22:45 UTC (rev 97637)
@@ -2832,6 +2832,8 @@
             'loader/archive/mhtml/MHTMLParser.cpp',
             'loader/cache/CachedCSSStyleSheet.cpp',
             'loader/cache/CachedCSSStyleSheet.h',
+            'loader/cache/CachedCues.cpp',
+            'loader/cache/CachedCues.h',
             'loader/cache/CachedFont.cpp',
             'loader/cache/CachedFont.h',
             'loader/cache/CachedImage.cpp',

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (97636 => 97637)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2011-10-17 19:09:42 UTC (rev 97636)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2011-10-17 19:22:45 UTC (rev 97637)
@@ -85,6 +85,8 @@
 		0709FC4E1025DEE30059CDBA /* AccessibilitySlider.h in Headers */ = {isa = PBXBuildFile; fileRef = 0709FC4D1025DEE30059CDBA /* AccessibilitySlider.h */; };
 		072C8B11131C518600A4FCE9 /* MediaPlayerPrivateAVFoundation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 076F0D0912B8192700C26AA4 /* MediaPlayerPrivateAVFoundation.cpp */; };
 		0735EE6A0F40C5E4004A2604 /* MediaPlayerProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 0735EE690F40C5E4004A2604 /* MediaPlayerProxy.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		0753860214489E9800B78452 /* CachedCues.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0753860014489E9800B78452 /* CachedCues.cpp */; };
+		0753860314489E9800B78452 /* CachedCues.h in Headers */ = {isa = PBXBuildFile; fileRef = 0753860114489E9800B78452 /* CachedCues.h */; };
 		076F0D0E12B8192700C26AA4 /* MediaPlayerPrivateAVFoundation.h in Headers */ = {isa = PBXBuildFile; fileRef = 076F0D0A12B8192700C26AA4 /* MediaPlayerPrivateAVFoundation.h */; };
 		07B0113F1032242200FBDC33 /* AccessibilityMediaControls.h in Headers */ = {isa = PBXBuildFile; fileRef = 07B0113E1032242200FBDC33 /* AccessibilityMediaControls.h */; };
 		0806E57A12893045007CED32 /* SVGMatrix.h in Headers */ = {isa = PBXBuildFile; fileRef = 0806E57912893045007CED32 /* SVGMatrix.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -7087,6 +7089,8 @@
 		06E81EEB0AB5DA9700C87837 /* LocalCurrentGraphicsContext.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = LocalCurrentGraphicsContext.mm; sourceTree = "<group>"; };
 		0709FC4D1025DEE30059CDBA /* AccessibilitySlider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccessibilitySlider.h; sourceTree = "<group>"; };
 		070DD8F50F01868000727DEB /* mediaControls.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = mediaControls.css; sourceTree = "<group>"; };
+		0753860014489E9800B78452 /* CachedCues.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CachedCues.cpp; sourceTree = "<group>"; };
+		0753860114489E9800B78452 /* CachedCues.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CachedCues.h; sourceTree = "<group>"; };
 		0735EE690F40C5E4004A2604 /* MediaPlayerProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaPlayerProxy.h; sourceTree = "<group>"; };
 		076F0D0912B8192700C26AA4 /* MediaPlayerPrivateAVFoundation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaPlayerPrivateAVFoundation.cpp; sourceTree = "<group>"; };
 		076F0D0A12B8192700C26AA4 /* MediaPlayerPrivateAVFoundation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaPlayerPrivateAVFoundation.h; sourceTree = "<group>"; };
@@ -18424,6 +18428,8 @@
 		A8D2B2521287A56000AF4DDA /* cache */ = {
 			isa = PBXGroup;
 			children = (
+				0753860014489E9800B78452 /* CachedCues.cpp */,
+				0753860114489E9800B78452 /* CachedCues.h */,
 				BCB16C000979C3BD00467741 /* CachedCSSStyleSheet.cpp */,
 				BCB16C010979C3BD00467741 /* CachedCSSStyleSheet.h */,
 				BC64B4C90CB4295D005F2B62 /* CachedFont.cpp */,
@@ -24617,6 +24623,7 @@
 				9B375EDB14478A0100F3CAE5 /* MicroDataItemList.h in Headers */,
 				49AF2D6914435D050016A784 /* DisplayRefreshMonitor.h in Headers */,
 				71CCB49D144824AC00C676D6 /* ImageBySizeCache.h in Headers */,
+				0753860314489E9800B78452 /* CachedCues.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -27469,6 +27476,7 @@
 				49AF2D6C14435D210016A784 /* DisplayRefreshMonitorMac.cpp in Sources */,
 				49FC7A501444AF5F00A5D864 /* DisplayRefreshMonitor.cpp in Sources */,
 				71CCB49C144824AC00C676D6 /* ImageBySizeCache.cpp in Sources */,
+				0753860214489E9800B78452 /* CachedCues.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};

Added: trunk/Source/WebCore/loader/cache/CachedCues.cpp (0 => 97637)


--- trunk/Source/WebCore/loader/cache/CachedCues.cpp	                        (rev 0)
+++ trunk/Source/WebCore/loader/cache/CachedCues.cpp	2011-10-17 19:22:45 UTC (rev 97637)
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2011 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. AND ITS 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 APPLE INC. OR ITS 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(VIDEO_TRACK)
+
+#include "CachedCues.h"
+
+#include "CachedResourceClient.h"
+#include "CachedResourceClientWalker.h"
+#include "CachedResourceLoader.h"
+#include "SharedBuffer.h"
+#include "TextResourceDecoder.h"
+#include <wtf/Vector.h>
+
+namespace WebCore {
+
+CachedCues::CachedCues(const ResourceRequest& resourceRequest)
+    : CachedResource(resourceRequest, CueResource)
+{
+}
+
+CachedCues::~CachedCues()
+{
+}
+
+void CachedCues::data(PassRefPtr<SharedBuffer> data, bool allDataReceived)
+{
+    m_data = data;
+    setEncodedSize(m_data.get() ? m_data->size() : 0);
+
+    CachedResourceClientWalker<CachedResourceClient> walker(m_clients);
+    while (CachedResourceClient *client = walker.next())
+        client->didReceiveData(this);
+
+    if (!allDataReceived)
+        return;
+    
+    setLoading(false);
+    checkNotify();
+}
+
+}
+
+#endif

Added: trunk/Source/WebCore/loader/cache/CachedCues.h (0 => 97637)


--- trunk/Source/WebCore/loader/cache/CachedCues.h	                        (rev 0)
+++ trunk/Source/WebCore/loader/cache/CachedCues.h	2011-10-17 19:22:45 UTC (rev 97637)
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2011 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. AND ITS 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 APPLE INC. OR ITS 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 CachedCues_h
+#define CachedCues_h
+
+#if ENABLE(VIDEO_TRACK)
+
+#include "CachedResource.h"
+#include "FontOrientation.h"
+
+namespace WebCore {
+
+class SharedBuffer;
+
+class CachedCues : public CachedResource {
+public:
+    CachedCues(const ResourceRequest&);
+    virtual ~CachedCues();
+
+    virtual void data(PassRefPtr<SharedBuffer> data, bool allDataReceived);
+};
+
+}
+
+#endif
+#endif

Modified: trunk/Source/WebCore/loader/cache/CachedResource.cpp (97636 => 97637)


--- trunk/Source/WebCore/loader/cache/CachedResource.cpp	2011-10-17 19:09:42 UTC (rev 97636)
+++ trunk/Source/WebCore/loader/cache/CachedResource.cpp	2011-10-17 19:22:45 UTC (rev 97637)
@@ -3,7 +3,7 @@
     Copyright (C) 2001 Dirk Mueller (muel...@kde.org)
     Copyright (C) 2002 Waldo Bastian (bast...@kde.org)
     Copyright (C) 2006 Samuel Weinig (sam.wei...@gmail.com)
-    Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
+    Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
 
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Library General Public
@@ -71,6 +71,10 @@
         case CachedResource::LinkSubresource:
             return ResourceLoadPriorityVeryLow;
 #endif
+#if ENABLE(VIDEO_TRACK)
+        case CachedResource::CueResource:
+            return ResourceLoadPriorityLow;
+#endif
     }
     ASSERT_NOT_REACHED();
     return ResourceLoadPriorityLow;

Modified: trunk/Source/WebCore/loader/cache/CachedResource.h (97636 => 97637)


--- trunk/Source/WebCore/loader/cache/CachedResource.h	2011-10-17 19:09:42 UTC (rev 97636)
+++ trunk/Source/WebCore/loader/cache/CachedResource.h	2011-10-17 19:22:45 UTC (rev 97637)
@@ -2,7 +2,7 @@
     Copyright (C) 1998 Lars Knoll (kn...@mpi-hd.mpg.de)
     Copyright (C) 2001 Dirk Mueller <muel...@kde.org>
     Copyright (C) 2006 Samuel Weinig (sam.wei...@gmail.com)
-    Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
+    Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
 
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Library General Public
@@ -73,6 +73,9 @@
         , LinkPrerender
         , LinkSubresource
 #endif
+#if ENABLE(VIDEO_TRACK)
+        , CueResource
+#endif
     };
 
     enum Status {

Modified: trunk/Source/WebCore/loader/cache/CachedResourceClient.h (97636 => 97637)


--- trunk/Source/WebCore/loader/cache/CachedResourceClient.h	2011-10-17 19:09:42 UTC (rev 97636)
+++ trunk/Source/WebCore/loader/cache/CachedResourceClient.h	2011-10-17 19:22:45 UTC (rev 97637)
@@ -1,7 +1,7 @@
 /*
     Copyright (C) 1998 Lars Knoll (kn...@mpi-hd.mpg.de)
     Copyright (C) 2001 Dirk Mueller <muel...@kde.org>
-    Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
+    Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
 
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Library General Public
@@ -43,6 +43,7 @@
 
     virtual ~CachedResourceClient() { }
     virtual void notifyFinished(CachedResource*) { }
+    virtual void didReceiveData(CachedResource*) { };
     
     static CachedResourceClientType expectedType() { return BaseResourceType; }
     virtual CachedResourceClientType resourceClientType() { return expectedType(); }

Modified: trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp (97636 => 97637)


--- trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp	2011-10-17 19:09:42 UTC (rev 97636)
+++ trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp	2011-10-17 19:22:45 UTC (rev 97637)
@@ -2,7 +2,7 @@
     Copyright (C) 1998 Lars Knoll (kn...@mpi-hd.mpg.de)
     Copyright (C) 2001 Dirk Mueller (muel...@kde.org)
     Copyright (C) 2002 Waldo Bastian (bast...@kde.org)
-    Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved.
+    Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
     Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/
 
     This library is free software; you can redistribute it and/or
@@ -52,6 +52,10 @@
 #include <wtf/text/CString.h>
 #include <wtf/text/WTFString.h>
 
+#if ENABLE(VIDEO_TRACK)
+#include "CachedCues.h"
+#endif
+
 #define PRELOAD_DEBUG 0
 
 namespace WebCore {
@@ -81,6 +85,10 @@
     case CachedResource::LinkSubresource:
         return new CachedResource(request, CachedResource::LinkSubresource);
 #endif
+#if ENABLE(VIDEO_TRACK)
+    case CachedResource::CueResource:
+        return new CachedCues(request);
+#endif
     }
     ASSERT_NOT_REACHED();
     return 0;
@@ -153,6 +161,13 @@
     return static_cast<CachedFont*>(requestResource(CachedResource::FontResource, request, String(), defaultCachedResourceOptions()));
 }
 
+#if ENABLE(VIDEO_TRACK)
+CachedCues* CachedResourceLoader::requestCues(ResourceRequest& request)
+{
+    return static_cast<CachedCues*>(requestResource(CachedResource::CueResource, request, String(), defaultCachedResourceOptions()));
+}
+#endif
+
 CachedCSSStyleSheet* CachedResourceLoader::requestCSSStyleSheet(ResourceRequest& request, const String& charset, ResourceLoadPriority priority)
 {
     return static_cast<CachedCSSStyleSheet*>(requestResource(CachedResource::CSSStyleSheet, request, charset, defaultCachedResourceOptions(), priority));
@@ -224,6 +239,9 @@
             if (!f->loader()->checkIfRunInsecureContent(m_document->securityOrigin(), url))
                 return false;
         break;
+#if ENABLE(VIDEO_TRACK)
+    case CachedResource::CueResource:
+#endif
     case CachedResource::ImageResource:
     case CachedResource::FontResource: {
         // These resources can corrupt only the frame's pixels.
@@ -269,6 +287,9 @@
     case CachedResource::LinkPrerender:
     case CachedResource::LinkSubresource:
 #endif
+#if ENABLE(VIDEO_TRACK)
+    case CachedResource::CueResource:
+#endif
         // These types of resources can be loaded from any origin.
         // FIXME: Are we sure about CachedResource::FontResource?
         break;
@@ -323,6 +344,14 @@
     case CachedResource::LinkSubresource:
 #endif
         break;
+#if ENABLE(VIDEO_TRACK)
+    case CachedResource::CueResource:
+        // Cues aren't called out in the CPS spec yet, but they only work with a media element
+        // so use the media policy.
+        if (!m_document->contentSecurityPolicy()->allowMediaFromSource(url))
+            return false;
+        break;
+#endif
     }
 
     return true;

Modified: trunk/Source/WebCore/loader/cache/CachedResourceLoader.h (97636 => 97637)


--- trunk/Source/WebCore/loader/cache/CachedResourceLoader.h	2011-10-17 19:09:42 UTC (rev 97636)
+++ trunk/Source/WebCore/loader/cache/CachedResourceLoader.h	2011-10-17 19:22:45 UTC (rev 97637)
@@ -1,7 +1,7 @@
 /*
     Copyright (C) 1998 Lars Knoll (kn...@mpi-hd.mpg.de)
     Copyright (C) 2001 Dirk Mueller <muel...@kde.org>
-    Copyright (C) 2004, 2005, 2006 Apple Computer, Inc.
+    Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
     Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/
 
     This library is free software; you can redistribute it and/or
@@ -39,6 +39,7 @@
 
 namespace WebCore {
 
+class CachedCues;
 class CachedCSSStyleSheet;
 class CachedFont;
 class CachedImage;
@@ -73,6 +74,9 @@
 #if ENABLE(LINK_PREFETCH)
     CachedResource* requestLinkResource(CachedResource::Type, ResourceRequest&, ResourceLoadPriority = ResourceLoadPriorityUnresolved);
 #endif
+#if ENABLE(VIDEO_TRACK)
+    CachedCues* requestCues(ResourceRequest&);
+#endif
 
     // Logs an access denied message to the console for the specified URL.
     void printAccessDeniedMessage(const KURL& url) const;

Modified: trunk/Source/WebCore/loader/cache/CachedResourceRequest.cpp (97636 => 97637)


--- trunk/Source/WebCore/loader/cache/CachedResourceRequest.cpp	2011-10-17 19:09:42 UTC (rev 97636)
+++ trunk/Source/WebCore/loader/cache/CachedResourceRequest.cpp	2011-10-17 19:22:45 UTC (rev 97637)
@@ -3,7 +3,7 @@
     Copyright (C) 2001 Dirk Mueller (muel...@kde.org)
     Copyright (C) 2002 Waldo Bastian (bast...@kde.org)
     Copyright (C) 2006 Samuel Weinig (sam.wei...@gmail.com)
-    Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
+    Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
 
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Library General Public
@@ -70,6 +70,10 @@
     case CachedResource::LinkSubresource:
         return ResourceRequest::TargetIsSubresource;
 #endif
+#if ENABLE(VIDEO_TRACK)
+    case CachedResource::CueResource:
+        return ResourceRequest::TargetIsCue;
+#endif
     }
     ASSERT_NOT_REACHED();
     return ResourceRequest::TargetIsSubresource;

Modified: trunk/Source/WebCore/platform/network/chromium/ResourceRequest.h (97636 => 97637)


--- trunk/Source/WebCore/platform/network/chromium/ResourceRequest.h	2011-10-17 19:09:42 UTC (rev 97636)
+++ trunk/Source/WebCore/platform/network/chromium/ResourceRequest.h	2011-10-17 19:22:45 UTC (rev 97637)
@@ -56,6 +56,7 @@
             TargetIsPrerender,
             TargetIsFavicon,
             TargetIsXHR,
+            TargetIsCue,
         };
 
         class ExtraData : public RefCounted<ExtraData> {
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to