| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 | 145 |
| 146 void ChromiumBridge::prefetchDNS(const String& hostname) | 146 void ChromiumBridge::prefetchDNS(const String& hostname) |
| 147 { | 147 { |
| 148 webKitClient()->prefetchHostName(hostname); | 148 webKitClient()->prefetchHostName(hostname); |
| 149 } | 149 } |
| 150 | 150 |
| 151 // File ------------------------------------------------------------------------ | 151 // File ------------------------------------------------------------------------ |
| 152 | 152 |
| 153 bool ChromiumBridge::fileExists(const String& path) | 153 bool ChromiumBridge::fileExists(const String& path) |
| 154 { | 154 { |
| 155 ASSERT_NOT_REACHED(); | 155 return webKitClient()->fileExists(path); |
| 156 return false; | |
| 157 } | 156 } |
| 158 | 157 |
| 159 bool ChromiumBridge::deleteFile(const String& path) | 158 bool ChromiumBridge::deleteFile(const String& path) |
| 160 { | 159 { |
| 161 ASSERT_NOT_REACHED(); | 160 return webKitClient()->deleteFile(path); |
| 162 return false; | |
| 163 } | 161 } |
| 164 | 162 |
| 165 bool ChromiumBridge::deleteEmptyDirectory(const String& path) | 163 bool ChromiumBridge::deleteEmptyDirectory(const String& path) |
| 166 { | 164 { |
| 167 ASSERT_NOT_REACHED(); | 165 return webKitClient()->deleteEmptyDirectory(path); |
| 168 return false; | |
| 169 } | 166 } |
| 170 | 167 |
| 171 bool ChromiumBridge::getFileSize(const String& path, long long& result) | 168 bool ChromiumBridge::getFileSize(const String& path, long long& result) |
| 172 { | 169 { |
| 173 return webKitClient()->getFileSize(path, result); | 170 return webKitClient()->getFileSize(path, result); |
| 174 } | 171 } |
| 175 | 172 |
| 176 bool ChromiumBridge::getFileModificationTime(const String& path, time_t& result) | 173 bool ChromiumBridge::getFileModificationTime(const String& path, time_t& result) |
| 177 { | 174 { |
| 178 ASSERT_NOT_REACHED(); | 175 return webKitClient()->getFileModificationTime(path, result); |
| 179 return false; | |
| 180 } | 176 } |
| 181 | 177 |
| 182 String ChromiumBridge::directoryName(const String& path) | 178 String ChromiumBridge::directoryName(const String& path) |
| 183 { | 179 { |
| 184 ASSERT_NOT_REACHED(); | 180 return webKitClient()->directoryName(path); |
| 185 return String(); | |
| 186 } | 181 } |
| 187 | 182 |
| 188 String ChromiumBridge::pathByAppendingComponent(const String& path, const String& component) | 183 String ChromiumBridge::pathByAppendingComponent(const String& path, const String& component) |
| 189 { | 184 { |
| 190 ASSERT_NOT_REACHED(); | 185 return webKitClient()->pathByAppendingComponent(path, component); |
| 191 return String(); | |
| 192 } | 186 } |
| 193 | 187 |
| 194 bool ChromiumBridge::makeAllDirectories(const String& path) | 188 bool ChromiumBridge::makeAllDirectories(const String& path) |
| 195 { | 189 { |
| 196 ASSERT_NOT_REACHED(); | 190 return webKitClient()->makeAllDirectories(path); |
| 197 return false; | |
| 198 } | 191 } |
| 199 | 192 |
| 200 // Font ----------------------------------------------------------------------- | 193 // Font ----------------------------------------------------------------------- |
| 201 | 194 |
| 202 #if PLATFORM(WIN_OS) | 195 #if PLATFORM(WIN_OS) |
| 203 bool ChromiumBridge::ensureFontLoaded(HFONT font) | 196 bool ChromiumBridge::ensureFontLoaded(HFONT font) |
| 204 { | 197 { |
| 205 WebSandboxSupport* ss = webKitClient()->sandboxSupport(); | 198 WebSandboxSupport* ss = webKitClient()->sandboxSupport(); |
| 206 | 199 |
| 207 // if there is no sandbox, then we can assume the font | 200 // if there is no sandbox, then we can assume the font |
| 208 // was able to be loaded successfully already | 201 // was able to be loaded successfully already |
| 209 return ss ? ss->ensureFontLoaded(font) : true; | 202 return ss ? ss->ensureFontLoaded(font) : true; |
| 210 } | 203 } |
| 211 #endif | 204 #endif |
| 212 | 205 |
| 213 #if PLATFORM(LINUX) | 206 #if PLATFORM(LINUX) |
| 214 String ChromiumBridge::getFontFamilyForCharacters(const UChar* characters, size_t numCharacters) | 207 String ChromiumBridge::getFontFamilyForCharacters(const UChar* characters, size_t numCharacters) |
| 215 { | 208 { |
| 216 if (webKitClient()->sandboxSupport()) | 209 if (webKitClient()->sandboxSupport()) |
| 217 return webKitClient()->sandboxSupport()->getFontFamilyForCharacters(characters, numCharacters); | 210 return webKitClient()->sandboxSupport()->getFontFamilyForCharacters(characters, numCharacters); |
| 218 else | 211 else |
| 219 return WebFontInfo::familyForChars(characters, numCharacters); | 212 return WebFontInfo::familyForChars(characters, numCharacters); |
| 220 } | 213 } |
| 221 #endif | 214 #endif |
| 222 | 215 |
| 216 // HTML5 DB ------------------------------------------------------------------- |
| 217 |
| 218 #if ENABLE(DATABASE) |
| 219 PlatformFileHandle ChromiumBridge::databaseOpenFile(const String& fileName, int desiredFlags) |
| 220 { |
| 221 return webKitClient()->databaseOpenFile(WebString(fileName), desiredFlags); |
| 222 } |
| 223 |
| 224 bool ChromiumBridge::databaseDeleteFile(const String& fileName) |
| 225 { |
| 226 return webKitClient()->databaseDeleteFile(WebString(fileName)); |
| 227 } |
| 228 |
| 229 long ChromiumBridge::databaseGetFileAttributes(const String& fileName) |
| 230 { |
| 231 return webKitClient()->databaseGetFileAttributes(WebString(fileName)); |
| 232 } |
| 233 |
| 234 long long ChromiumBridge::databaseGetFileSize(const String& fileName) |
| 235 { |
| 236 return webKitClient()->databaseGetFileSize(WebString(fileName)); |
| 237 } |
| 238 #endif |
| 239 |
| 223 // Language ------------------------------------------------------------------- | 240 // Language ------------------------------------------------------------------- |
| 224 | 241 |
| 225 String ChromiumBridge::computedDefaultLanguage() | 242 String ChromiumBridge::computedDefaultLanguage() |
| 226 { | 243 { |
| 227 return webKitClient()->defaultLocale(); | 244 return webKitClient()->defaultLocale(); |
| 228 } | 245 } |
| 229 | 246 |
| 230 // LayoutTestMode ------------------------------------------------------------- | 247 // LayoutTestMode ------------------------------------------------------------- |
| 231 | 248 |
| 232 bool ChromiumBridge::layoutTestMode() | 249 bool ChromiumBridge::layoutTestMode() |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 | 305 |
| 289 RefPtr<Image> image = BitmapImage::create(); | 306 RefPtr<Image> image = BitmapImage::create(); |
| 290 image->setData(resource, true); | 307 image->setData(resource, true); |
| 291 return image; | 308 return image; |
| 292 } | 309 } |
| 293 | 310 |
| 294 // Sandbox -------------------------------------------------------------------- | 311 // Sandbox -------------------------------------------------------------------- |
| 295 | 312 |
| 296 bool ChromiumBridge::sandboxEnabled() | 313 bool ChromiumBridge::sandboxEnabled() |
| 297 { | 314 { |
| 298 return true; | 315 return webKitClient()->sandboxEnabled(); |
| 299 } | 316 } |
| 300 | 317 |
| 301 // SharedTimers --------------------------------------------------------------- | 318 // SharedTimers --------------------------------------------------------------- |
| 302 | 319 |
| 303 void ChromiumBridge::setSharedTimerFiredFunction(void (*func)()) | 320 void ChromiumBridge::setSharedTimerFiredFunction(void (*func)()) |
| 304 { | 321 { |
| 305 webKitClient()->setSharedTimerFiredFunction(func); | 322 webKitClient()->setSharedTimerFiredFunction(func); |
| 306 } | 323 } |
| 307 | 324 |
| 308 void ChromiumBridge::setSharedTimerFireTime(double fireTime) | 325 void ChromiumBridge::setSharedTimerFireTime(double fireTime) |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 465 return 0; // Invalid resolved URL. | 482 return 0; // Invalid resolved URL. |
| 466 | 483 |
| 467 return webKitClient()->visitedLinkHash(buffer.data(), buffer.length()); | 484 return webKitClient()->visitedLinkHash(buffer.data(), buffer.length()); |
| 468 } | 485 } |
| 469 | 486 |
| 470 bool ChromiumBridge::isLinkVisited(WebCore::LinkHash visitedLinkHash) | 487 bool ChromiumBridge::isLinkVisited(WebCore::LinkHash visitedLinkHash) |
| 471 { | 488 { |
| 472 return webKitClient()->isLinkVisited(visitedLinkHash); | 489 return webKitClient()->isLinkVisited(visitedLinkHash); |
| 473 } | 490 } |
| 474 | 491 |
| 475 // HTML5 DB ------------------------------------------------------------------- | |
| 476 | |
| 477 #if ENABLE(DATABASE) | |
| 478 PlatformFileHandle ChromiumBridge::databaseOpenFile(const String& fileName, | |
| 479 int desiredFlags) | |
| 480 { | |
| 481 return webKitClient()->databaseOpenFile(WebString(fileName), desiredFlags); | |
| 482 } | |
| 483 | |
| 484 bool ChromiumBridge::databaseDeleteFile(const String& fileName) | |
| 485 { | |
| 486 return webKitClient()->databaseDeleteFile(WebString(fileName)); | |
| 487 } | |
| 488 | |
| 489 long ChromiumBridge::databaseGetFileAttributes(const String& fileName) | |
| 490 { | |
| 491 return webKitClient()->databaseGetFileAttributes(WebString(fileName)); | |
| 492 } | |
| 493 | |
| 494 long long ChromiumBridge::databaseGetFileSize(const String& fileName) | |
| 495 { | |
| 496 return webKitClient()->databaseGetFileSize(WebString(fileName)); | |
| 497 } | |
| 498 #endif | |
| 499 | |
| 500 } // namespace WebCore | 492 } // namespace WebCore |
| OLD | NEW |