Title: [171708] trunk/Source/WebCore
Revision
171708
Author
beid...@apple.com
Date
2014-07-28 16:14:04 -0700 (Mon, 28 Jul 2014)

Log Message

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):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (171707 => 171708)


--- trunk/Source/WebCore/ChangeLog	2014-07-28 22:47:24 UTC (rev 171707)
+++ trunk/Source/WebCore/ChangeLog	2014-07-28 23:14:04 UTC (rev 171708)
@@ -1,3 +1,26 @@
+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-28  Mark Hahnenberg  <mhahnenb...@apple.com>
 
         ASSERTION FAILED: m_heap->vm()->currentThreadIsHoldingAPILock()

Modified: trunk/Source/WebCore/editing/mac/EditorMac.mm (171707 => 171708)


--- trunk/Source/WebCore/editing/mac/EditorMac.mm	2014-07-28 22:47:24 UTC (rev 171707)
+++ trunk/Source/WebCore/editing/mac/EditorMac.mm	2014-07-28 23:14:04 UTC (rev 171708)
@@ -583,10 +583,7 @@
     typeAsFilenameWithExtension.replace('/', '.');
     URL imageURL = URL::fakeURLWithRelativePart(typeAsFilenameWithExtension);
 
-    RefPtr<ArchiveResource> archiveResource = ArchiveResource::create(buffer, imageURL, type, emptyString(), emptyString());
-    archiveResource->setShouldLoadImmediately(true);
-
-    fragment = frame.editor().createFragmentForImageResourceAndAddResource(archiveResource.release());
+    fragment = frame.editor().createFragmentForImageResourceAndAddResource(ArchiveResource::create(buffer, imageURL, type, emptyString(), emptyString()));
     return fragment;
 }
 

Modified: trunk/Source/WebCore/loader/archive/ArchiveResource.cpp (171707 => 171708)


--- trunk/Source/WebCore/loader/archive/ArchiveResource.cpp	2014-07-28 22:47:24 UTC (rev 171707)
+++ trunk/Source/WebCore/loader/archive/ArchiveResource.cpp	2014-07-28 23:14:04 UTC (rev 171708)
@@ -39,7 +39,6 @@
     , m_textEncoding(textEncoding)
     , m_frameName(frameName)
     , m_shouldIgnoreWhenUnarchiving(false)
-    , m_shouldLoadImmediately(false)
 {
 }
 

Modified: trunk/Source/WebCore/loader/archive/ArchiveResource.h (171707 => 171708)


--- trunk/Source/WebCore/loader/archive/ArchiveResource.h	2014-07-28 22:47:24 UTC (rev 171707)
+++ trunk/Source/WebCore/loader/archive/ArchiveResource.h	2014-07-28 23:14:04 UTC (rev 171708)
@@ -47,9 +47,6 @@
     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&);
 
@@ -58,7 +55,6 @@
     String m_frameName;
 
     bool m_shouldIgnoreWhenUnarchiving;
-    bool m_shouldLoadImmediately;
 };
 
 }

Modified: trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp (171707 => 171708)


--- trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp	2014-07-28 22:47:24 UTC (rev 171707)
+++ trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp	2014-07-28 23:14:04 UTC (rev 171708)
@@ -27,7 +27,6 @@
 #include "config.h"
 #include "CachedResourceLoader.h"
 
-#include "ArchiveResource.h"
 #include "CachedCSSStyleSheet.h"
 #include "CachedSVGDocument.h"
 #include "CachedFont.h"
@@ -52,7 +51,6 @@
 #include "PingLoader.h"
 #include "PlatformStrategies.h"
 #include "RenderElement.h"
-#include "ResourceBuffer.h"
 #include "ResourceLoadScheduler.h"
 #include "ScriptController.h"
 #include "SecurityOrigin.h"
@@ -471,17 +469,9 @@
         resource->setLoadPriority(request.priority());
 
     if ((policy != Use || resource->stillNeedsLoad()) && CachedResourceRequest::NoDefer == request.defer()) {
-        ArchiveResource* archiveResource = m_documentLoader ? m_documentLoader->archiveResourceForURL(request.resourceRequest().url()) : nullptr;
+        resource->load(this, request.options());
 
-        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.
+        // We don't support immediate loads, but we do 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