Title: [171768] branches/safari-600.1.4-branch/Source/WebCore

Diff

Modified: branches/safari-600.1.4-branch/Source/WebCore/ChangeLog (171767 => 171768)


--- branches/safari-600.1.4-branch/Source/WebCore/ChangeLog	2014-07-29 21:49:53 UTC (rev 171767)
+++ branches/safari-600.1.4-branch/Source/WebCore/ChangeLog	2014-07-29 22:35:20 UTC (rev 171768)
@@ -1,5 +1,36 @@
 2014-07-29  Matthew Hanson  <matthew_han...@apple.com>
 
+        Rollout r171708. <rdar://problem/17844894>
+
+    2014-07-29  Matthew Hanson  <matthew_han...@apple.com>
+
+            Merge r171708. <rdar://problem/17844894>
+
+        2014-07-28  Brady Eidson  <beid...@apple.com>
+        
+                REGRESSION(168376): Standalone images pasted to Outlook 2011 don't display
+                <rdar://problem/17768371> and https://bugs.webkit.org/show_bug.cgi?id=135363
+        
+                Reviewed by Tim Horton.
+        
+                Outlook isn’t prepared to handle the resource load callbacks when sent synchronously.
+        
+                r168376 was an optimization that we no longer need, so the simplest fix is to roll it out.
+        
+                * editing/mac/EditorMac.mm:
+                (WebCore::Editor::WebContentReader::readImage):
+        
+                * loader/archive/ArchiveResource.cpp:
+                (WebCore::ArchiveResource::ArchiveResource):
+                * loader/archive/ArchiveResource.h:
+                (WebCore::ArchiveResource::setShouldLoadImmediately): Deleted.
+                (WebCore::ArchiveResource::shouldLoadImmediately): Deleted.
+        
+                * loader/cache/CachedResourceLoader.cpp:
+                (WebCore::CachedResourceLoader::requestResource):
+
+2014-07-29  Matthew Hanson  <matthew_han...@apple.com>
+
         Merge r171711. <rdar://problem/17756281>
 
     2014-07-28  Dean Jackson  <d...@apple.com>
@@ -14,7 +45,7 @@
     
             * Modules/mediacontrols/mediaControlsiOS.css:
             (audio::-webkit-media-controls-start-playback-button:active):
-    
+
 2014-07-29  Matthew Hanson  <matthew_han...@apple.com>
 
         Merge r171708. <rdar://problem/17844894>

Modified: branches/safari-600.1.4-branch/Source/WebCore/editing/mac/EditorMac.mm (171767 => 171768)


--- branches/safari-600.1.4-branch/Source/WebCore/editing/mac/EditorMac.mm	2014-07-29 21:49:53 UTC (rev 171767)
+++ branches/safari-600.1.4-branch/Source/WebCore/editing/mac/EditorMac.mm	2014-07-29 22:35:20 UTC (rev 171768)
@@ -583,7 +583,10 @@
     typeAsFilenameWithExtension.replace('/', '.');
     URL imageURL = URL::fakeURLWithRelativePart(typeAsFilenameWithExtension);
 
-    fragment = frame.editor().createFragmentForImageResourceAndAddResource(ArchiveResource::create(buffer, imageURL, type, emptyString(), emptyString()));
+    RefPtr<ArchiveResource> archiveResource = ArchiveResource::create(buffer, imageURL, type, emptyString(), emptyString());
+    archiveResource->setShouldLoadImmediately(true);
+
+    fragment = frame.editor().createFragmentForImageResourceAndAddResource(archiveResource.release());
     return fragment;
 }
 

Modified: branches/safari-600.1.4-branch/Source/WebCore/loader/archive/ArchiveResource.cpp (171767 => 171768)


--- branches/safari-600.1.4-branch/Source/WebCore/loader/archive/ArchiveResource.cpp	2014-07-29 21:49:53 UTC (rev 171767)
+++ branches/safari-600.1.4-branch/Source/WebCore/loader/archive/ArchiveResource.cpp	2014-07-29 22:35:20 UTC (rev 171768)
@@ -39,6 +39,7 @@
     , m_textEncoding(textEncoding)
     , m_frameName(frameName)
     , m_shouldIgnoreWhenUnarchiving(false)
+    , m_shouldLoadImmediately(false)
 {
 }
 

Modified: branches/safari-600.1.4-branch/Source/WebCore/loader/archive/ArchiveResource.h (171767 => 171768)


--- branches/safari-600.1.4-branch/Source/WebCore/loader/archive/ArchiveResource.h	2014-07-29 21:49:53 UTC (rev 171767)
+++ branches/safari-600.1.4-branch/Source/WebCore/loader/archive/ArchiveResource.h	2014-07-29 22:35:20 UTC (rev 171768)
@@ -47,6 +47,9 @@
     void ignoreWhenUnarchiving() { m_shouldIgnoreWhenUnarchiving = true; }
     bool shouldIgnoreWhenUnarchiving() const { return m_shouldIgnoreWhenUnarchiving; }
 
+    void setShouldLoadImmediately(bool shouldLoadImmediately) { m_shouldLoadImmediately = shouldLoadImmediately; }
+    bool shouldLoadImmediately() const { return m_shouldLoadImmediately; }
+
 private:
     ArchiveResource(PassRefPtr<SharedBuffer>, const URL&, const String& mimeType, const String& textEncoding, const String& frameName, const ResourceResponse&);
 
@@ -55,6 +58,7 @@
     String m_frameName;
 
     bool m_shouldIgnoreWhenUnarchiving;
+    bool m_shouldLoadImmediately;
 };
 
 }

Modified: branches/safari-600.1.4-branch/Source/WebCore/loader/cache/CachedResourceLoader.cpp (171767 => 171768)


--- branches/safari-600.1.4-branch/Source/WebCore/loader/cache/CachedResourceLoader.cpp	2014-07-29 21:49:53 UTC (rev 171767)
+++ branches/safari-600.1.4-branch/Source/WebCore/loader/cache/CachedResourceLoader.cpp	2014-07-29 22:35:20 UTC (rev 171768)
@@ -27,6 +27,7 @@
 #include "config.h"
 #include "CachedResourceLoader.h"
 
+#include "ArchiveResource.h"
 #include "CachedCSSStyleSheet.h"
 #include "CachedSVGDocument.h"
 #include "CachedFont.h"
@@ -51,6 +52,7 @@
 #include "PingLoader.h"
 #include "PlatformStrategies.h"
 #include "RenderElement.h"
+#include "ResourceBuffer.h"
 #include "ResourceLoadScheduler.h"
 #include "ScriptController.h"
 #include "SecurityOrigin.h"
@@ -469,9 +471,17 @@
         resource->setLoadPriority(request.priority());
 
     if ((policy != Use || resource->stillNeedsLoad()) && CachedResourceRequest::NoDefer == request.defer()) {
-        resource->load(this, request.options());
+        ArchiveResource* archiveResource = m_documentLoader ? m_documentLoader->archiveResourceForURL(request.resourceRequest().url()) : nullptr;
 
-        // We don't support immediate loads, but we do support immediate failure.
+        if (archiveResource && archiveResource->shouldLoadImmediately()) {
+            resource->responseReceived(resource->response());
+            RefPtr<ResourceBuffer> buffer = ResourceBuffer::adoptSharedBuffer(archiveResource->data());
+            resource->finishLoading(buffer.get());
+            resource->finish();
+        } else
+            resource->load(this, request.options());
+
+        // We only sometimes support immediate loads, but we always support immediate failure.
         if (resource->errorOccurred()) {
             if (resource->inCache())
                 memoryCache()->remove(resource.get());
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to