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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 } | 78 } |
79 | 79 |
80 WebFileSystem* DOMFileSystemBase::fileSystem() const | 80 WebFileSystem* DOMFileSystemBase::fileSystem() const |
81 { | 81 { |
82 Platform* platform = Platform::current(); | 82 Platform* platform = Platform::current(); |
83 if (!platform) | 83 if (!platform) |
84 return nullptr; | 84 return nullptr; |
85 return platform->fileSystem(); | 85 return platform->fileSystem(); |
86 } | 86 } |
87 | 87 |
88 SecurityOrigin* DOMFileSystemBase::securityOrigin() const | 88 SecurityOrigin* DOMFileSystemBase::getSecurityOrigin() const |
89 { | 89 { |
90 return m_context->securityOrigin(); | 90 return m_context->getSecurityOrigin(); |
91 } | 91 } |
92 | 92 |
93 bool DOMFileSystemBase::isValidType(FileSystemType type) | 93 bool DOMFileSystemBase::isValidType(FileSystemType type) |
94 { | 94 { |
95 return type == FileSystemTypeTemporary || type == FileSystemTypePersistent |
| type == FileSystemTypeIsolated || type == FileSystemTypeExternal; | 95 return type == FileSystemTypeTemporary || type == FileSystemTypePersistent |
| type == FileSystemTypeIsolated || type == FileSystemTypeExternal; |
96 } | 96 } |
97 | 97 |
98 bool DOMFileSystemBase::crackFileSystemURL(const KURL& url, FileSystemType& type
, String& filePath) | 98 bool DOMFileSystemBase::crackFileSystemURL(const KURL& url, FileSystemType& type
, String& filePath) |
99 { | 99 { |
100 if (!url.protocolIs("filesystem")) | 100 if (!url.protocolIs("filesystem")) |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 } | 139 } |
140 | 140 |
141 KURL DOMFileSystemBase::createFileSystemURL(const String& fullPath) const | 141 KURL DOMFileSystemBase::createFileSystemURL(const String& fullPath) const |
142 { | 142 { |
143 ASSERT(DOMFilePath::isAbsolute(fullPath)); | 143 ASSERT(DOMFilePath::isAbsolute(fullPath)); |
144 | 144 |
145 if (type() == FileSystemTypeExternal) { | 145 if (type() == FileSystemTypeExternal) { |
146 // For external filesystem originString could be different from what we
have in m_filesystemRootURL. | 146 // For external filesystem originString could be different from what we
have in m_filesystemRootURL. |
147 StringBuilder result; | 147 StringBuilder result; |
148 result.appendLiteral("filesystem:"); | 148 result.appendLiteral("filesystem:"); |
149 result.append(securityOrigin()->toString()); | 149 result.append(getSecurityOrigin()->toString()); |
150 result.append('/'); | 150 result.append('/'); |
151 result.append(externalPathPrefix); | 151 result.append(externalPathPrefix); |
152 result.append(m_filesystemRootURL.path()); | 152 result.append(m_filesystemRootURL.path()); |
153 // Remove the extra leading slash. | 153 // Remove the extra leading slash. |
154 result.append(encodeWithURLEscapeSequences(fullPath.substring(1))); | 154 result.append(encodeWithURLEscapeSequences(fullPath.substring(1))); |
155 return KURL(ParsedURLString, result.toString()); | 155 return KURL(ParsedURLString, result.toString()); |
156 } | 156 } |
157 | 157 |
158 // For regular types we can just append the entry's fullPath to the m_filesy
stemRootURL that should look like 'filesystem:<origin>/<typePrefix>'. | 158 // For regular types we can just append the entry's fullPath to the m_filesy
stemRootURL that should look like 'filesystem:<origin>/<typePrefix>'. |
159 ASSERT(!m_filesystemRootURL.isEmpty()); | 159 ASSERT(!m_filesystemRootURL.isEmpty()); |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 } | 407 } |
408 | 408 |
409 bool DOMFileSystemBase::waitForAdditionalResult(int callbacksId) | 409 bool DOMFileSystemBase::waitForAdditionalResult(int callbacksId) |
410 { | 410 { |
411 if (!fileSystem()) | 411 if (!fileSystem()) |
412 return false; | 412 return false; |
413 return fileSystem()->waitForAdditionalResult(callbacksId); | 413 return fileSystem()->waitForAdditionalResult(callbacksId); |
414 } | 414 } |
415 | 415 |
416 } // namespace blink | 416 } // namespace blink |
OLD | NEW |