Changeset 108206 in webkit
- Timestamp:
- Feb 19, 2012 9:24:14 PM (12 years ago)
- Location:
- trunk/Source
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r108202 r108206 1 2012-02-19 Paweł Forysiuk <tuxator@o2.pl> 2 3 [GTK] Can't find webinspector and error page redirection on Windows 4 https://bugs.webkit.org/show_bug.cgi?id=51616 5 6 Create and use an abstraction for finding shared resources on Windows. 7 8 Reviewed by Martin Robinson. 9 10 * platform/FileSystem.h: 11 (WebCore): 12 * platform/audio/gtk/AudioBusGtk.cpp: 13 (WebCore::AudioBus::loadPlatformResource): 14 * platform/graphics/gtk/ImageGtk.cpp: 15 (WebCore::getPathToImageResource): 16 * platform/gtk/FileSystemGtk.cpp: 17 (WebCore::sharedResourcesPath): 18 (WebCore): 19 1 20 2012-02-19 James Robinson <jamesr@chromium.org> 2 21 -
trunk/Source/WebCore/platform/FileSystem.h
r107101 r108206 199 199 String filenameForDisplay(const String&); 200 200 CString applicationDirectoryPath(); 201 CString sharedResourcesPath(); 201 202 uint64_t getVolumeFreeSizeForPath(const char*); 202 203 #endif -
trunk/Source/WebCore/platform/audio/gtk/AudioBusGtk.cpp
r101644 r108206 24 24 25 25 #include "AudioFileReader.h" 26 #include "FileSystem.h" 26 27 #include "GOwnPtr.h" 27 28 … … 34 35 { 35 36 GOwnPtr<gchar> filename(g_strdup_printf("%s.wav", name)); 36 GOwnPtr<gchar> absoluteFilename(g_build_filename( DATA_DIR, "webkitgtk-"WEBKITGTK_API_VERSION_STRING, "resources", "audio", filename.get(), NULL));37 GOwnPtr<gchar> absoluteFilename(g_build_filename(sharedResourcesPath().data(), "resources", "audio", filename.get(), NULL)); 37 38 38 39 GFile* file = g_file_new_for_path(filename.get()); -
trunk/Source/WebCore/platform/graphics/gtk/ImageGtk.cpp
r105686 r108206 27 27 28 28 #include "BitmapImage.h" 29 #include "FileSystem.h" 29 30 #include "GdkCairoUtilities.h" 30 31 #include "GOwnPtrGtk.h" … … 34 35 #include <gtk/gtk.h> 35 36 36 #if PLATFORM(WIN) 37 #include <mbstring.h> 38 #include <shlobj.h> 39 40 static HMODULE hmodule; 41 42 extern "C" { 43 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) 44 { 45 if (fdwReason == DLL_PROCESS_ATTACH) 46 hmodule = hinstDLL; 47 return TRUE; 48 } 49 } 50 51 static char* getPathToImageResource(char* resource) 52 { 53 static char* dataDirectory = 0; 54 if (!dataDirectory) { 55 dataDirectory = new char[PATH_MAX]; 56 if (!GetModuleFileName(hmodule, static_cast<CHAR*>(dataDirectory), sizeof(dataDirectory) - 10)) 57 dataDirectory = DATA_DIR; 58 59 // FIXME: This is pretty ugly. Ideally we should be using Windows API 60 // functions or GLib methods to calculate paths. 61 unsigned char *p; 62 p = _mbsrchr(static_cast<const unsigned char *>(dataDirectory), '\\'); 63 *p = '\0'; 64 p = _mbsrchr(static_cast<const unsigned char *>(dataDirectory), '\\'); 65 if (p) { 66 if (!stricmp((const char *) (p+1), "bin")) 67 *p = '\0'; 68 } 69 strcat(dataDirectory, "\\share\\webkitgtk-"WEBKITGTK_API_VERSION_STRING"\\images\\"); 70 } 71 72 char* imageResourcePath = new char[PATH_MAX]; 73 strcat(imageResourcePath, dataDirectory); 74 strcat(imageResourcePath, resource); 75 76 return imageResourcePath; 77 } 78 79 #else 37 namespace WebCore { 80 38 81 39 static char* getPathToImageResource(char* resource) … … 84 42 return g_build_filename(g_getenv("WEBKIT_TOP_LEVEL"), "Source", "WebCore", "Resources", resource, NULL); 85 43 86 return g_build_filename( DATA_DIR, "webkitgtk-"WEBKITGTK_API_VERSION_STRING, "images", resource, NULL);44 return g_build_filename(sharedResourcesPath().data(), "images", resource, NULL); 87 45 } 88 89 #endif90 91 namespace WebCore {92 46 93 47 static CString getThemeIconFileName(const char* name, int size) -
trunk/Source/WebCore/platform/gtk/FileSystemGtk.cpp
r101710 r108206 191 191 } 192 192 193 CString sharedResourcesPath() 194 { 195 static CString cachedPath; 196 if (!cachedPath.isNull()) 197 return cachedPath; 198 199 #if OS(WINDOWS) 200 HMODULE hmodule = 0; 201 GetModuleHandleExA(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, reinterpret_cast<char*>(sharedResourcesPath), &hmodule); 202 203 GOwnPtr<gchar> runtimeDir(g_win32_get_package_installation_directory_of_module(hmodule)); 204 GOwnPtr<gchar> dataPath(g_build_filename(runtimeDir.get(), "share", "webkitgtk-"WEBKITGTK_API_VERSION_STRING, NULL)); 205 #else 206 GOwnPtr<gchar> dataPath(g_build_filename(DATA_DIR, "webkitgtk-"WEBKITGTK_API_VERSION_STRING, NULL)); 207 #endif 208 209 cachedPath = dataPath.get(); 210 return cachedPath; 211 } 212 193 213 uint64_t getVolumeFreeSizeForPath(const char* path) 194 214 { -
trunk/Source/WebKit/gtk/ChangeLog
r108193 r108206 1 2012-02-19 Paweł Forysiuk <tuxator@o2.pl> 2 [GTK] Can't find webinspector and error page redirection on Windows 3 https://bugs.webkit.org/show_bug.cgi?id=51616 4 5 Use an abstraction for finding shared resources on Windows. 6 7 Reviewed by Martin Robinson. 8 9 * WebCoreSupport/FrameLoaderClientGtk.cpp: 10 (WebKit::FrameLoaderClient::dispatchDidFailLoad): 11 * WebCoreSupport/InspectorClientGtk.cpp: 12 (WebKit::InspectorClient::inspectorFilesPath): 13 1 14 2012-02-19 Gustavo Noronha Silva <gns@gnome.org> 2 15 -
trunk/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
r107249 r108206 34 34 #include "DocumentLoaderGtk.h" 35 35 #include "ErrorsGtk.h" 36 #include "FileSystem.h" 36 37 #include "FormState.h" 37 38 #include "FrameLoader.h" … … 1106 1107 String content; 1107 1108 gchar* fileContent = 0; 1108 gchar* errorURI = g_filename_to_uri(DATA_DIR"/webkit-1.0/resources/error.html", NULL, NULL); 1109 GOwnPtr<gchar> errorPath(g_build_filename(sharedResourcesPath().data(), "resources", "error.html", NULL)); 1110 gchar* errorURI = g_filename_to_uri(errorPath.get(), 0, 0); 1111 1109 1112 GFile* errorFile = g_file_new_for_uri(errorURI); 1110 1113 g_free(errorURI); -
trunk/Source/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp
r108190 r108206 21 21 #include "InspectorClientGtk.h" 22 22 23 #include "FileSystem.h" 23 24 #include "Frame.h" 24 25 #include "InspectorController.h" … … 164 165 m_inspectorFilesPath.set(g_strdup(environmentPath)); 165 166 else 166 m_inspectorFilesPath.set(g_build_filename( DATA_DIR, "webkitgtk-"WEBKITGTK_API_VERSION_STRING, "webinspector", NULL));167 m_inspectorFilesPath.set(g_build_filename(sharedResourcesPath().data(), "webinspector", NULL)); 167 168 168 169 return m_inspectorFilesPath.get();
Note: See TracChangeset
for help on using the changeset viewer.