Changeset 30092 in webkit
- Timestamp:
- Feb 8, 2008 8:24:14 AM (16 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r30091 r30092 1 2008-02-08 Rodney Dawes <dobey@wayofthemonkey.com> 2 3 Reviewed by Jon Honeycutt. 4 5 Redefine some platform-specific types as cross-platform types 6 Add pathGetFileName method to get the filename from a path string 7 Add unloadModule method to unload a loadable module from the process 8 Implement new methods for GTK+ and Windows 9 Implement missing homeDirectoryPath method for GTK+ 10 Add stub methods for new and missing methods for Wx and Qt 11 12 * platform/FileSystem.h: 13 * platform/gtk/FileSystemGtk.cpp: 14 * platform/qt/FileSystemQt.cpp: 15 * platform/win/FileSystemWin.cpp: 16 * platform/wx/FileSystemWx.cpp: 17 1 18 2008-02-08 Adam Roben <aroben@apple.com> 2 19 -
trunk/WebCore/platform/FileSystem.h
r30078 r30092 31 31 #define FileSystem_h 32 32 33 #if PLATFORM(GTK) 34 #include <gmodule.h> 35 #endif 36 33 37 #include <wtf/Platform.h> 34 38 … … 42 46 #if PLATFORM(WIN) 43 47 typedef HANDLE PlatformFileHandle; 48 typedef FILETIME PlatformFileTime; 49 typedef HMODULE PlatformModule; 44 50 const PlatformFileHandle invalidPlatformFileHandle = INVALID_HANDLE_VALUE; 45 51 #else 46 52 typedef int PlatformFileHandle; 53 typedef time_t PlatformFileTime; 54 #if PLATFORM(GTK) 55 typedef GModule* PlatformModule; 56 #else 57 typedef void* PlatformModule; 58 #endif 47 59 const PlatformFileHandle invalidPlatformFileHandle = -1; 48 60 #endif … … 56 68 bool makeAllDirectories(const String& path); 57 69 String homeDirectoryPath(); 70 String pathGetFileName(const String&); 58 71 59 72 CString fileSystemRepresentation(const String&); … … 65 78 void closeFile(PlatformFileHandle&); 66 79 int writeToFile(PlatformFileHandle, const char* data, int length); 80 81 // Methods for dealing with loadable modules 82 bool unloadModule(PlatformModule); 67 83 68 84 #if PLATFORM(WIN) -
trunk/WebCore/platform/gtk/FileSystemGtk.cpp
r30080 r30092 114 114 } 115 115 116 String homeDirectoryPath() 117 { 118 return String::fromUTF8(g_get_home_dir()); 119 } 120 121 String pathGetFileName(const String& pathName) 122 { 123 char* baseName = g_path_get_basename(pathName.utf8().data()); 124 String fileName = String::fromUTF8(baseName); 125 g_free(baseName); 126 127 return fileName; 128 } 129 116 130 CString openTemporaryFile(const char* prefix, PlatformFileHandle& handle) 117 131 { … … 153 167 return totalBytesWritten; 154 168 } 169 170 bool unloadModule(PlatformModule module) 171 { 172 return g_module_close(module); 155 173 } 174 } -
trunk/WebCore/platform/qt/FileSystemQt.cpp
r30080 r30092 3 3 * Copyright (C) 2007 Holger Hans Peter Freyther 4 4 * Copyright (C) 2008 Apple, Inc. All rights reserved. 5 * Copyright (C) 2008 Collabora, Ltd. All rights reserved. 5 6 * 6 7 * Redistribution and use in source and binary forms, with or without … … 29 30 */ 30 31 32 #include "config.h" 33 #include "FileSystem.h" 34 35 #include "CString.h" 31 36 #include "NotImplemented.h" 32 37 #include "PlatformString.h" … … 76 81 } 77 82 83 String pathGetFileName(const String&) 84 { 85 notImplemented(); 86 return String(); 87 } 88 89 bool unloadModule(PlatformModule) 90 { 91 notImplemented(); 92 return false; 93 } 94 78 95 } 79 96 -
trunk/WebCore/platform/win/FileSystemWin.cpp
r30078 r30092 127 127 } 128 128 129 String pathGetFileName(const String& path) 130 { 131 return String(PathFindFileName(String(path).charactersWithNullTermination())); 132 } 133 129 134 static String bundleName() 130 135 { … … 215 220 return static_cast<int>(bytesWritten); 216 221 } 222 223 bool unloadModule(PlatformModule module) 224 { 225 return ::FreeLibrary(module); 226 } 227 217 228 String localUserSpecificStorageDirectory() 218 229 { -
trunk/WebCore/platform/wx/FileSystemWx.cpp
r30078 r30092 1 1 /* 2 2 * Copyright (C) 2007 Kevin Ollivier 3 * Copyright (C) 2008 Collabora, Ltd. 4 * 3 5 * All rights reserved. 4 * 6 * 5 7 * Redistribution and use in source and binary forms, with or without 6 8 * modification, are permitted provided that the following conditions … … 76 78 } 77 79 80 String homeDirectoryPath() 81 { 82 notImplemented(); 83 return String(); 78 84 } 85 86 String pathGetFileName(const String&) 87 { 88 notImplemented(); 89 return String(); 90 } 91 92 CString openTemporaryFile(const char* prefix, PlatformFileHandle& handle) 93 { 94 notImplemented(); 95 handle = invalidPlatformFileHandle; 96 return CString(); 97 } 98 99 void closeFile(PlatformFileHandle&) 100 { 101 notImplemented(); 102 } 103 104 int writeToFile(PlatformFileHandle, const char* data, int length) 105 { 106 notImplemented(); 107 return 0; 108 } 109 110 bool unloadModule(PlatformModule) 111 { 112 notImplemented(); 113 return false; 114 } 115 116 }
Note: See TracChangeset
for help on using the changeset viewer.