| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 } | 79 } |
| 80 | 80 |
| 81 LocalFileSystem::~LocalFileSystem() | 81 LocalFileSystem::~LocalFileSystem() |
| 82 { | 82 { |
| 83 } | 83 } |
| 84 | 84 |
| 85 void LocalFileSystem::resolveURL(ExecutionContext* context, const KURL& fileSyst
emURL, std::unique_ptr<AsyncFileSystemCallbacks> callbacks) | 85 void LocalFileSystem::resolveURL(ExecutionContext* context, const KURL& fileSyst
emURL, std::unique_ptr<AsyncFileSystemCallbacks> callbacks) |
| 86 { | 86 { |
| 87 CallbackWrapper* wrapper = new CallbackWrapper(std::move(callbacks)); | 87 CallbackWrapper* wrapper = new CallbackWrapper(std::move(callbacks)); |
| 88 requestFileSystemAccessInternal(context, | 88 requestFileSystemAccessInternal(context, |
| 89 WTF::bind(&LocalFileSystem::resolveURLInternal, wrapPersistent(this), wr
apPersistent(context), fileSystemURL, wrapPersistent(wrapper)), | 89 WTF::bind(&LocalFileSystem::resolveURLInternal, wrapCrossThreadPersisten
t(this), wrapPersistent(context), fileSystemURL, wrapPersistent(wrapper)), |
| 90 WTF::bind(&LocalFileSystem::fileSystemNotAllowedInternal, wrapPersistent
(this), wrapPersistent(context), wrapPersistent(wrapper))); | 90 WTF::bind(&LocalFileSystem::fileSystemNotAllowedInternal, wrapCrossThrea
dPersistent(this), wrapPersistent(context), wrapPersistent(wrapper))); |
| 91 } | 91 } |
| 92 | 92 |
| 93 void LocalFileSystem::requestFileSystem(ExecutionContext* context, FileSystemTyp
e type, long long size, std::unique_ptr<AsyncFileSystemCallbacks> callbacks) | 93 void LocalFileSystem::requestFileSystem(ExecutionContext* context, FileSystemTyp
e type, long long size, std::unique_ptr<AsyncFileSystemCallbacks> callbacks) |
| 94 { | 94 { |
| 95 CallbackWrapper* wrapper = new CallbackWrapper(std::move(callbacks)); | 95 CallbackWrapper* wrapper = new CallbackWrapper(std::move(callbacks)); |
| 96 requestFileSystemAccessInternal(context, | 96 requestFileSystemAccessInternal(context, |
| 97 WTF::bind(&LocalFileSystem::fileSystemAllowedInternal, wrapPersistent(th
is), wrapPersistent(context), type, wrapPersistent(wrapper)), | 97 WTF::bind(&LocalFileSystem::fileSystemAllowedInternal, wrapCrossThreadPe
rsistent(this), wrapPersistent(context), type, wrapPersistent(wrapper)), |
| 98 WTF::bind(&LocalFileSystem::fileSystemNotAllowedInternal, wrapPersistent
(this), wrapPersistent(context), wrapPersistent(wrapper))); | 98 WTF::bind(&LocalFileSystem::fileSystemNotAllowedInternal, wrapCrossThrea
dPersistent(this), wrapPersistent(context), wrapPersistent(wrapper))); |
| 99 } | 99 } |
| 100 | 100 |
| 101 void LocalFileSystem::deleteFileSystem(ExecutionContext* context, FileSystemType
type, std::unique_ptr<AsyncFileSystemCallbacks> callbacks) | 101 void LocalFileSystem::deleteFileSystem(ExecutionContext* context, FileSystemType
type, std::unique_ptr<AsyncFileSystemCallbacks> callbacks) |
| 102 { | 102 { |
| 103 ASSERT(context); | 103 ASSERT(context); |
| 104 ASSERT_WITH_SECURITY_IMPLICATION(context->isDocument()); | 104 ASSERT_WITH_SECURITY_IMPLICATION(context->isDocument()); |
| 105 | 105 |
| 106 CallbackWrapper* wrapper = new CallbackWrapper(std::move(callbacks)); | 106 CallbackWrapper* wrapper = new CallbackWrapper(std::move(callbacks)); |
| 107 requestFileSystemAccessInternal(context, | 107 requestFileSystemAccessInternal(context, |
| 108 WTF::bind(&LocalFileSystem::deleteFileSystemInternal, wrapPersistent(thi
s), wrapPersistent(context), type, wrapPersistent(wrapper)), | 108 WTF::bind(&LocalFileSystem::deleteFileSystemInternal, wrapCrossThreadPer
sistent(this), wrapPersistent(context), type, wrapPersistent(wrapper)), |
| 109 WTF::bind(&LocalFileSystem::fileSystemNotAllowedInternal, wrapPersistent
(this), wrapPersistent(context), wrapPersistent(wrapper))); | 109 WTF::bind(&LocalFileSystem::fileSystemNotAllowedInternal, wrapCrossThrea
dPersistent(this), wrapPersistent(context), wrapPersistent(wrapper))); |
| 110 } | 110 } |
| 111 | 111 |
| 112 WebFileSystem* LocalFileSystem::getFileSystem() const | 112 WebFileSystem* LocalFileSystem::getFileSystem() const |
| 113 { | 113 { |
| 114 Platform* platform = Platform::current(); | 114 Platform* platform = Platform::current(); |
| 115 if (!platform) | 115 if (!platform) |
| 116 return nullptr; | 116 return nullptr; |
| 117 | 117 |
| 118 return platform->fileSystem(); | 118 return platform->fileSystem(); |
| 119 } | 119 } |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 { | 220 { |
| 221 frame.provideSupplement(LocalFileSystem::supplementName(), LocalFileSystem::
create(std::move(client))); | 221 frame.provideSupplement(LocalFileSystem::supplementName(), LocalFileSystem::
create(std::move(client))); |
| 222 } | 222 } |
| 223 | 223 |
| 224 void provideLocalFileSystemToWorker(WorkerClients* clients, std::unique_ptr<File
SystemClient> client) | 224 void provideLocalFileSystemToWorker(WorkerClients* clients, std::unique_ptr<File
SystemClient> client) |
| 225 { | 225 { |
| 226 clients->provideSupplement(LocalFileSystem::supplementName(), LocalFileSyste
m::create(std::move(client))); | 226 clients->provideSupplement(LocalFileSystem::supplementName(), LocalFileSyste
m::create(std::move(client))); |
| 227 } | 227 } |
| 228 | 228 |
| 229 } // namespace blink | 229 } // namespace blink |
| OLD | NEW |