| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 SecurityOrigin* DOMFileSystemBase::getSecurityOrigin() const | 87 SecurityOrigin* DOMFileSystemBase::getSecurityOrigin() const |
| 88 { | 88 { |
| 89 return m_context->getSecurityOrigin(); | 89 return m_context->getSecurityOrigin(); |
| 90 } | 90 } |
| 91 | 91 |
| 92 bool DOMFileSystemBase::isValidType(FileSystemType type) | 92 bool DOMFileSystemBase::isValidType(FileSystemType type) |
| 93 { | 93 { |
| 94 return type == FileSystemTypeTemporary || type == FileSystemTypePersistent |
| type == FileSystemTypeIsolated || type == FileSystemTypeExternal; | 94 return type == FileSystemTypeTemporary || type == FileSystemTypePersistent |
| type == FileSystemTypeIsolated || type == FileSystemTypeExternal; |
| 95 } | 95 } |
| 96 | 96 |
| 97 bool DOMFileSystemBase::crackFileSystemURL(const KURL& url, FileSystemType& type
, String& filePath) | |
| 98 { | |
| 99 if (!url.protocolIs("filesystem")) | |
| 100 return false; | |
| 101 | |
| 102 if (!url.innerURL()) | |
| 103 return false; | |
| 104 | |
| 105 String typeString = url.innerURL()->path().substring(1); | |
| 106 if (!pathPrefixToFileSystemType(typeString, type)) | |
| 107 return false; | |
| 108 | |
| 109 filePath = decodeURLEscapeSequences(url.path()); | |
| 110 return true; | |
| 111 } | |
| 112 | |
| 113 KURL DOMFileSystemBase::createFileSystemRootURL(const String& origin, FileSystem
Type type) | 97 KURL DOMFileSystemBase::createFileSystemRootURL(const String& origin, FileSystem
Type type) |
| 114 { | 98 { |
| 115 String typeString; | 99 String typeString; |
| 116 if (type == FileSystemTypeTemporary) | 100 if (type == FileSystemTypeTemporary) |
| 117 typeString = temporaryPathPrefix; | 101 typeString = temporaryPathPrefix; |
| 118 else if (type == FileSystemTypePersistent) | 102 else if (type == FileSystemTypePersistent) |
| 119 typeString = persistentPathPrefix; | 103 typeString = persistentPathPrefix; |
| 120 else if (type == FileSystemTypeExternal) | 104 else if (type == FileSystemTypeExternal) |
| 121 typeString = externalPathPrefix; | 105 typeString = externalPathPrefix; |
| 122 else | 106 else |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 } | 390 } |
| 407 | 391 |
| 408 bool DOMFileSystemBase::waitForAdditionalResult(int callbacksId) | 392 bool DOMFileSystemBase::waitForAdditionalResult(int callbacksId) |
| 409 { | 393 { |
| 410 if (!fileSystem()) | 394 if (!fileSystem()) |
| 411 return false; | 395 return false; |
| 412 return fileSystem()->waitForAdditionalResult(callbacksId); | 396 return fileSystem()->waitForAdditionalResult(callbacksId); |
| 413 } | 397 } |
| 414 | 398 |
| 415 } // namespace blink | 399 } // namespace blink |
| OLD | NEW |