Commit 7c5db478 authored by eric@webkit.org's avatar eric@webkit.org
Browse files

2009-11-12 Adam Barth <abarth>

        Reviewed by Dimitri Glazkov.

        [Chromium] reload-subframe-object.html fails
        https://bugs.webkit.org/show_bug.cgi?id=31398

        More closely match FrameLoaderClient.mm.  Turns out we don't want to
        use MIMETypeRegistry::getMIMETypeForPath because we can't distinguish
        between application/octet-stream and lack of knowledge of the MIME
        type.

        Covered by reload-subframe-object.html.

        * src/FrameLoaderClientImpl.cpp:
        (WebKit::FrameLoaderClientImpl::objectContentType):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@50891 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 8c6bc199
2009-11-12 Adam Barth <abarth>
Reviewed by Dimitri Glazkov.
[Chromium] reload-subframe-object.html fails
https://bugs.webkit.org/show_bug.cgi?id=31398
More closely match FrameLoaderClient.mm. Turns out we don't want to
use MIMETypeRegistry::getMIMETypeForPath because we can't distinguish
between application/octet-stream and lack of knowledge of the MIME
type.
Covered by reload-subframe-object.html.
* src/FrameLoaderClientImpl.cpp:
(WebKit::FrameLoaderClientImpl::objectContentType):
2009-11-12 Nate Chapin <japhet@chromium.org>
Unreviewed, Chromium build fix.
......
......@@ -47,6 +47,7 @@
#include "Page.h"
#include "PlatformString.h"
#include "PluginData.h"
#include "PluginDataChromium.h"
#include "StringExtras.h"
#include "WebDataSourceImpl.h"
#include "WebDevToolsAgentPrivate.h"
......@@ -1348,8 +1349,15 @@ ObjectContentType FrameLoaderClientImpl::objectContentType(
// Try to guess the MIME type based off the extension.
String filename = url.lastPathComponent();
int extensionPos = filename.reverseFind('.');
if (extensionPos >= 0)
mimeType = MIMETypeRegistry::getMIMETypeForPath(url.path());
if (extensionPos >= 0) {
String extension = filename.substring(extensionPos + 1);
mimeType = MIMETypeRegistry::getMIMETypeForExtension(extension);
if (mimeType.isEmpty()) {
// If there's no mimetype registered for the extension, check to see
// if a plugin can handle the extension.
mimeType = getPluginMimeTypeFromExtension(extension);
}
}
if (mimeType.isEmpty())
return ObjectContentFrame;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment