summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authoragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-11 18:09:12 +0000
committeragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-11 18:09:12 +0000
commitf963b1d5006ed35450befe042bf58810d9d36bea (patch)
treefe7f035ae7972e055f648fcf8e527f1e777c5984 /webkit
parentcb5ea4db21261528710f13c5513e1143ca757386 (diff)
downloadchromium_src-f963b1d5006ed35450befe042bf58810d9d36bea.zip
chromium_src-f963b1d5006ed35450befe042bf58810d9d36bea.tar.gz
chromium_src-f963b1d5006ed35450befe042bf58810d9d36bea.tar.bz2
Linux: Make SandboxIPCProcess not be a WebKitClient
Previously, SandboxIPCProcess had to be a full WebKitClient because of the following assertion failure: 0 0x08af0a77 in buildBaseTextCodecMaps () at third_party/WebKit/WebCore/platform/text/TextEncodingRegistry.cpp:176 1 0x08af0e73 in WebCore::atomicCanonicalTextEncodingName (name=0x985d665 "UTF-8") at third_party/WebKit/WebCore/platform/text/TextEncodingRegistry.cpp:241 2 0x08aee811 in TextEncoding (this=0xb876ef8, name=0x985d665 "UTF-8") at third_party/WebKit/WebCore/platform/text/TextEncoding.cpp:61 3 0x08aee88a in WebCore::UTF8Encoding () at third_party/WebKit/WebCore/platform/text/TextEncoding.cpp:266 4 0x08ae744c in WebCore::String::fromUTF8 (string=0x56d7a120 "�226\207�211�233正�221", size=15) at third_party/WebKit/WebCore/platform/text/String.cpp:674 5 0x0872a7c0 in WebKit::WebString::fromUTF8 (data=0x56d7a120 "�226\207�211�233正�221", length=15) at webkit/api/src/WebString.cpp:72 6 0x087245bd in WebKit::WebFontInfo::familyForChars (characters=0x56c11628, numCharacters=1) at webkit/api/src/gtk/WebFontInfo.cpp:98 7 0x0847599a in SandboxIPCProcess::HandleGetFontFamilyForChars (this=0xff869ba8, fd=29, pickle=@0xff86900c, iter=0xff869054, fds=@0xff86901c) at chrome/browser/renderer_host/render_sandbox_host_linux.cc:215 8 0x08475d70 in SandboxIPCProcess::HandleRequestFromRenderer (this=0xff869ba8, fd=29) at chrome/browser/renderer_host/render_sandbox_host_linux.cc:115 9 0x08475fea in SandboxIPCProcess::Run (this=0xff869ba8) at chrome/browser/renderer_host/render_sandbox_host_linux.cc:84 10 0x084747f9 in RenderSandboxHostLinux (this=0x56c10e78) at chrome/browser/renderer_host/render_sandbox_host_linux.cc:299 This this patch, we remove the need to use WebString and the codec translation (which was just a translation from UTF8 to UTF16 and back again anyway) and thus can remove all of the WebKitClient gubbins. BUG=17260 http://codereview.chromium.org/164112 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23050 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/api/public/gtk/WebFontInfo.h4
-rw-r--r--webkit/api/src/ChromiumBridge.cpp9
-rw-r--r--webkit/api/src/gtk/WebFontInfo.cpp10
3 files changed, 14 insertions, 9 deletions
diff --git a/webkit/api/public/gtk/WebFontInfo.h b/webkit/api/public/gtk/WebFontInfo.h
index b5543c2..2a0b7f9 100644
--- a/webkit/api/public/gtk/WebFontInfo.h
+++ b/webkit/api/public/gtk/WebFontInfo.h
@@ -31,7 +31,7 @@
#ifndef WebFontInfo_h
#define WebFontInfo_h
-#include "../WebString.h"
+#include "../WebCString.h"
#include <string.h>
#include <unistd.h>
@@ -47,7 +47,7 @@ namespace WebKit {
//
// Returns: the font family or an empty string if the request could not be
// satisfied.
- WEBKIT_API static WebString familyForChars(const WebUChar* characters, size_t numCharacters);
+ WEBKIT_API static WebCString familyForChars(const WebUChar* characters, size_t numCharacters);
};
} // namespace WebKit
diff --git a/webkit/api/src/ChromiumBridge.cpp b/webkit/api/src/ChromiumBridge.cpp
index e48b4b7..b668178 100644
--- a/webkit/api/src/ChromiumBridge.cpp
+++ b/webkit/api/src/ChromiumBridge.cpp
@@ -208,8 +208,13 @@ String ChromiumBridge::getFontFamilyForCharacters(const UChar* characters, size_
{
if (webKitClient()->sandboxSupport())
return webKitClient()->sandboxSupport()->getFontFamilyForCharacters(characters, numCharacters);
- else
- return WebFontInfo::familyForChars(characters, numCharacters);
+ else {
+ WebCString family = WebFontInfo::familyForChars(characters, numCharacters);
+ if (family.data())
+ return WebString::fromUTF8(family.data());
+ else
+ return WebString();
+ }
}
#endif
diff --git a/webkit/api/src/gtk/WebFontInfo.cpp b/webkit/api/src/gtk/WebFontInfo.cpp
index 059ad4b..9365ed2 100644
--- a/webkit/api/src/gtk/WebFontInfo.cpp
+++ b/webkit/api/src/gtk/WebFontInfo.cpp
@@ -38,7 +38,7 @@
namespace WebKit {
-WebString WebFontInfo::familyForChars(const WebUChar* characters, size_t numCharacters)
+WebCString WebFontInfo::familyForChars(const WebUChar* characters, size_t numCharacters)
{
FcCharSet* cset = FcCharSetCreate();
for (int i = 0; i < numCharacters; ++i) {
@@ -71,7 +71,7 @@ WebString WebFontInfo::familyForChars(const WebUChar* characters, size_t numChar
FcCharSetDestroy(cset);
if (!fontSet)
- return WebString();
+ return WebCString();
// Older versions of fontconfig have a bug where they cannot select
// only scalable fonts so we have to manually filter the results.
@@ -92,17 +92,17 @@ WebString WebFontInfo::familyForChars(const WebUChar* characters, size_t numChar
continue;
FcChar8* family;
- WebString result;
+ WebCString result;
if (FcPatternGetString(current, FC_FAMILY, 0, &family) == FcResultMatch) {
const char* charFamily = reinterpret_cast<char*>(family);
- result = WebString::fromUTF8(charFamily, strlen(charFamily));
+ result = WebCString(charFamily, strlen(charFamily));
}
FcFontSetDestroy(fontSet);
return result;
}
FcFontSetDestroy(fontSet);
- return WebString();
+ return WebCString();
}
} // namespace WebKit