| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 return fileSystem; | 60 return fileSystem; |
| 61 } | 61 } |
| 62 | 62 |
| 63 DOMFileSystem* DOMFileSystem::createIsolatedFileSystem(ExecutionContext* context
, const String& filesystemId) | 63 DOMFileSystem* DOMFileSystem::createIsolatedFileSystem(ExecutionContext* context
, const String& filesystemId) |
| 64 { | 64 { |
| 65 if (filesystemId.isEmpty()) | 65 if (filesystemId.isEmpty()) |
| 66 return 0; | 66 return 0; |
| 67 | 67 |
| 68 StringBuilder filesystemName; | 68 StringBuilder filesystemName; |
| 69 filesystemName.append(createDatabaseIdentifierFromSecurityOrigin(context->se
curityOrigin())); | 69 filesystemName.append(createDatabaseIdentifierFromSecurityOrigin(context->se
curityOrigin())); |
| 70 filesystemName.append(":Isolated_"); | 70 filesystemName.appendLiteral(":Isolated_"); |
| 71 filesystemName.append(filesystemId); | 71 filesystemName.append(filesystemId); |
| 72 | 72 |
| 73 // The rootURL created here is going to be attached to each filesystem reque
st and | 73 // The rootURL created here is going to be attached to each filesystem reque
st and |
| 74 // is to be validated each time the request is being handled. | 74 // is to be validated each time the request is being handled. |
| 75 StringBuilder rootURL; | 75 StringBuilder rootURL; |
| 76 rootURL.append("filesystem:"); | 76 rootURL.appendLiteral("filesystem:"); |
| 77 rootURL.append(context->securityOrigin()->toString()); | 77 rootURL.append(context->securityOrigin()->toString()); |
| 78 rootURL.append("/"); | 78 rootURL.append('/'); |
| 79 rootURL.append(isolatedPathPrefix); | 79 rootURL.append(isolatedPathPrefix); |
| 80 rootURL.append("/"); | 80 rootURL.append('/'); |
| 81 rootURL.append(filesystemId); | 81 rootURL.append(filesystemId); |
| 82 rootURL.append("/"); | 82 rootURL.append('/'); |
| 83 | 83 |
| 84 return DOMFileSystem::create(context, filesystemName.toString(), FileSystemT
ypeIsolated, KURL(ParsedURLString, rootURL.toString())); | 84 return DOMFileSystem::create(context, filesystemName.toString(), FileSystemT
ypeIsolated, KURL(ParsedURLString, rootURL.toString())); |
| 85 } | 85 } |
| 86 | 86 |
| 87 DOMFileSystem::DOMFileSystem(ExecutionContext* context, const String& name, File
SystemType type, const KURL& rootURL) | 87 DOMFileSystem::DOMFileSystem(ExecutionContext* context, const String& name, File
SystemType type, const KURL& rootURL) |
| 88 : DOMFileSystemBase(context, name, type, rootURL) | 88 : DOMFileSystemBase(context, name, type, rootURL) |
| 89 , ActiveDOMObject(context) | 89 , ActiveDOMObject(context) |
| 90 , m_numberOfPendingCallbacks(0) | 90 , m_numberOfPendingCallbacks(0) |
| 91 { | 91 { |
| 92 ScriptWrappable::init(this); | 92 ScriptWrappable::init(this); |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 KURL fileSystemURL = createFileSystemURL(fileEntry); | 162 KURL fileSystemURL = createFileSystemURL(fileEntry); |
| 163 if (!fileSystem()) { | 163 if (!fileSystem()) { |
| 164 reportError(errorCallback, FileError::create(FileError::ABORT_ERR)); | 164 reportError(errorCallback, FileError::create(FileError::ABORT_ERR)); |
| 165 return; | 165 return; |
| 166 } | 166 } |
| 167 | 167 |
| 168 fileSystem()->createSnapshotFileAndReadMetadata(fileSystemURL, SnapshotFileC
allback::create(this, fileEntry->name(), fileSystemURL, successCallback, errorCa
llback, m_context)); | 168 fileSystem()->createSnapshotFileAndReadMetadata(fileSystemURL, SnapshotFileC
allback::create(this, fileEntry->name(), fileSystemURL, successCallback, errorCa
llback, m_context)); |
| 169 } | 169 } |
| 170 | 170 |
| 171 } // namespace blink | 171 } // namespace blink |
| OLD | NEW |