| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 if (!item.hasFileSystemId()) | 44 if (!item.hasFileSystemId()) |
| 45 return nullptr; | 45 return nullptr; |
| 46 const String fileSystemId = item.fileSystemId(); | 46 const String fileSystemId = item.fileSystemId(); |
| 47 DraggedIsolatedFileSystemImpl* draggedIsolatedFileSystem = from(host); | 47 DraggedIsolatedFileSystemImpl* draggedIsolatedFileSystem = from(host); |
| 48 if (!draggedIsolatedFileSystem) | 48 if (!draggedIsolatedFileSystem) |
| 49 return nullptr; | 49 return nullptr; |
| 50 auto it = draggedIsolatedFileSystem->m_filesystems.find(fileSystemId); | 50 auto it = draggedIsolatedFileSystem->m_filesystems.find(fileSystemId); |
| 51 if (it != draggedIsolatedFileSystem->m_filesystems.end()) | 51 if (it != draggedIsolatedFileSystem->m_filesystems.end()) |
| 52 return it->value; | 52 return it->value; |
| 53 return draggedIsolatedFileSystem->m_filesystems | 53 return draggedIsolatedFileSystem->m_filesystems |
| 54 .add(fileSystemId, DOMFileSystem::createIsolatedFileSystem( | 54 .insert(fileSystemId, DOMFileSystem::createIsolatedFileSystem( |
| 55 executionContext, fileSystemId)) | 55 executionContext, fileSystemId)) |
| 56 .storedValue->value; | 56 .storedValue->value; |
| 57 } | 57 } |
| 58 | 58 |
| 59 // static | 59 // static |
| 60 const char* DraggedIsolatedFileSystemImpl::supplementName() { | 60 const char* DraggedIsolatedFileSystemImpl::supplementName() { |
| 61 ASSERT(isMainThread()); | 61 ASSERT(isMainThread()); |
| 62 return "DraggedIsolatedFileSystemImpl"; | 62 return "DraggedIsolatedFileSystemImpl"; |
| 63 } | 63 } |
| 64 | 64 |
| 65 DraggedIsolatedFileSystemImpl* DraggedIsolatedFileSystemImpl::from( | 65 DraggedIsolatedFileSystemImpl* DraggedIsolatedFileSystemImpl::from( |
| 66 DataObject* dataObject) { | 66 DataObject* dataObject) { |
| 67 return static_cast<DraggedIsolatedFileSystemImpl*>( | 67 return static_cast<DraggedIsolatedFileSystemImpl*>( |
| 68 Supplement<DataObject>::from(dataObject, supplementName())); | 68 Supplement<DataObject>::from(dataObject, supplementName())); |
| 69 } | 69 } |
| 70 | 70 |
| 71 DEFINE_TRACE(DraggedIsolatedFileSystemImpl) { | 71 DEFINE_TRACE(DraggedIsolatedFileSystemImpl) { |
| 72 visitor->trace(m_filesystems); | 72 visitor->trace(m_filesystems); |
| 73 Supplement<DataObject>::trace(visitor); | 73 Supplement<DataObject>::trace(visitor); |
| 74 } | 74 } |
| 75 | 75 |
| 76 void DraggedIsolatedFileSystemImpl::prepareForDataObject( | 76 void DraggedIsolatedFileSystemImpl::prepareForDataObject( |
| 77 DataObject* dataObject) { | 77 DataObject* dataObject) { |
| 78 DraggedIsolatedFileSystemImpl* fileSystem = | 78 DraggedIsolatedFileSystemImpl* fileSystem = |
| 79 new DraggedIsolatedFileSystemImpl(); | 79 new DraggedIsolatedFileSystemImpl(); |
| 80 DraggedIsolatedFileSystemImpl::provideTo( | 80 DraggedIsolatedFileSystemImpl::provideTo( |
| 81 *dataObject, DraggedIsolatedFileSystemImpl::supplementName(), fileSystem); | 81 *dataObject, DraggedIsolatedFileSystemImpl::supplementName(), fileSystem); |
| 82 } | 82 } |
| 83 | 83 |
| 84 } // namespace blink | 84 } // namespace blink |
| OLD | NEW |