ページ

2009年5月28日木曜日

WebKit検証(34) - キャッシュ設定を変更(その2)

このエントリーをブックマークに追加 このエントリーを含むはてなブックマーク

ネットで調べていると WebKit のソースコードらしきものが見つかった。

WebPreferences.m

この中にこんなコードがあった。

static WebCacheModel cacheModelForMainBundle(void)
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];

// Apps that probably need the small setting
static const char* const documentViewerIDs[] = {
"Microsoft/com.microsoft.Messenger",
"com.adiumX.adiumX",
"com.alientechnology.Proteus",
"com.apple.Dashcode",
"com.apple.iChat",
"com.barebones.bbedit",
"com.barebones.textwrangler",
"com.barebones.yojimbo",
"com.equinux.iSale4",
"com.growl.growlframework",
"com.intrarts.PandoraMan",
"com.karelia.Sandvox",
"com.macromates.textmate",
"com.realmacsoftware.rapidweaverpro",
"com.red-sweater.marsedit",
"com.yahoo.messenger3",
"de.codingmonkeys.SubEthaEdit",
"fi.karppinen.Pyro",
"info.colloquy",
"kungfoo.tv.ecto",
};

// Apps that probably need the medium setting
static const char* const documentBrowserIDs[] = {
"com.apple.Dictionary",
"com.apple.Xcode",
"com.apple.dashboard.client",
"com.apple.helpviewer",
"com.culturedcode.xyle",
"com.macrabbit.CSSEdit",
"com.panic.Coda",
"com.ranchero.NetNewsWire",
"com.thinkmac.NewsLife",
"org.xlife.NewsFire",
"uk.co.opencommunity.vienna2",
};

// Apps that probably need the large setting
static const char* const primaryWebBrowserIDs[] = {
"com.app4mac.KidsBrowser"
"com.app4mac.wKiosk",
"com.freeverse.bumpercar",
"com.omnigroup.OmniWeb5",
"com.sunrisebrowser.Sunrise",
"net.hmdt-web.Shiira",
};

WebCacheModel cacheModel;

const char* bundleID = [[[NSBundle mainBundle] bundleIdentifier] UTF8String];
if (contains(documentViewerIDs, sizeof(documentViewerIDs) / sizeof(documentViewerIDs[0]), bundleID))
cacheModel = WebCacheModelDocumentViewer;
else if (contains(documentBrowserIDs, sizeof(documentBrowserIDs) / sizeof(documentBrowserIDs[0]), bundleID))
cacheModel = WebCacheModelDocumentBrowser;
else if (contains(primaryWebBrowserIDs, sizeof(primaryWebBrowserIDs) / sizeof(primaryWebBrowserIDs[0]), bundleID))
cacheModel = WebCacheModelPrimaryWebBrowser;
else {
bool isLegacyApp = !WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_CACHE_MODEL_API);
if (isLegacyApp)
cacheModel = WebCacheModelDocumentBrowser; // To avoid regressions in apps that depended on old WebKit's large cache.
else
cacheModel = WebCacheModelDocumentViewer; // To save memory.
}

[pool drain];

return cacheModel;
}


キャッシュモデルを自動判別しているようだが、どうもアプリの種類によって決めているようだ。

シイラがあった。
     "net.hmdt-web.Shiira",



進展無し...