| 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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 { | 197 { |
| 198 } | 198 } |
| 199 | 199 |
| 200 const char* LocalFileSystem::supplementName() | 200 const char* LocalFileSystem::supplementName() |
| 201 { | 201 { |
| 202 return "LocalFileSystem"; | 202 return "LocalFileSystem"; |
| 203 } | 203 } |
| 204 | 204 |
| 205 LocalFileSystem* LocalFileSystem::from(ExecutionContext& context) | 205 LocalFileSystem* LocalFileSystem::from(ExecutionContext& context) |
| 206 { | 206 { |
| 207 if (context.isDocument()) { | 207 if (context.isDocument()) |
| 208 return static_cast<LocalFileSystem*>(WillBeHeapSupplement<LocalFrame>::f
rom(toDocument(context).frame(), supplementName())); | 208 return static_cast<LocalFileSystem*>(WillBeHeapSupplement<LocalFrame>::f
rom(toDocument(context).frame(), supplementName())); |
| 209 } | 209 |
| 210 ASSERT(context.isWorkerGlobalScope()); | 210 ASSERT(context.isWorkerGlobalScope()); |
| 211 return static_cast<LocalFileSystem*>(WillBeHeapSupplement<WorkerClients>::fr
om(toWorkerGlobalScope(context).clients(), supplementName())); | 211 WorkerClients* clients = toWorkerGlobalScope(context).clients(); |
| 212 ASSERT(clients); |
| 213 return static_cast<LocalFileSystem*>(WillBeHeapSupplement<WorkerClients>::fr
om(clients, supplementName())); |
| 212 } | 214 } |
| 213 | 215 |
| 214 void provideLocalFileSystemTo(LocalFrame& frame, PassOwnPtr<FileSystemClient> cl
ient) | 216 void provideLocalFileSystemTo(LocalFrame& frame, PassOwnPtr<FileSystemClient> cl
ient) |
| 215 { | 217 { |
| 216 frame.provideSupplement(LocalFileSystem::supplementName(), LocalFileSystem::
create(client)); | 218 frame.provideSupplement(LocalFileSystem::supplementName(), LocalFileSystem::
create(client)); |
| 217 } | 219 } |
| 218 | 220 |
| 219 void provideLocalFileSystemToWorker(WorkerClients* clients, PassOwnPtr<FileSyste
mClient> client) | 221 void provideLocalFileSystemToWorker(WorkerClients* clients, PassOwnPtr<FileSyste
mClient> client) |
| 220 { | 222 { |
| 221 clients->provideSupplement(LocalFileSystem::supplementName(), LocalFileSyste
m::create(client)); | 223 clients->provideSupplement(LocalFileSystem::supplementName(), LocalFileSyste
m::create(client)); |
| 222 } | 224 } |
| 223 | 225 |
| 224 } // namespace blink | 226 } // namespace blink |
| OLD | NEW |