static char* getPathToImageResource(char* resource) { if (g_getenv("WEBKIT_TOP_LEVEL")) return g_build_filename(g_getenv("WEBKIT_TOP_LEVEL"), "Source", "WebCore", "Resources", resource, NULL); return g_build_filename(sharedResourcesPath().data(), "images", resource, NULL); }
PassOwnPtr<AudioBus> AudioBus::loadPlatformResource(const char* name, float sampleRate) { GOwnPtr<gchar> filename(g_strdup_printf("%s.wav", name)); const char* environmentPath = getenv("AUDIO_RESOURCES_PATH"); GOwnPtr<gchar> absoluteFilename; if (environmentPath) absoluteFilename.set(g_build_filename(environmentPath, filename.get(), NULL)); else absoluteFilename.set(g_build_filename(sharedResourcesPath().data(), "resources", "audio", filename.get(), NULL)); return createBusFromAudioFile(absoluteFilename.get(), false, sampleRate); }
const char* InspectorClient::inspectorFilesPath() { if (m_inspectorFilesPath) return m_inspectorFilesPath.get(); const char* environmentPath = getenv("WEBKIT_INSPECTOR_PATH"); if (environmentPath && g_file_test(environmentPath, G_FILE_TEST_IS_DIR)) m_inspectorFilesPath.set(g_strdup(environmentPath)); else m_inspectorFilesPath.set(g_build_filename(sharedResourcesPath().data(), "webinspector", NULL)); return m_inspectorFilesPath.get(); }