| 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 16 matching lines...) Expand all Loading... |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "config.h" | 31 #include "config.h" |
| 32 #include "WebDOMFileSystem.h" | 32 #include "WebDOMFileSystem.h" |
| 33 | 33 |
| 34 #include "V8DOMFileSystem.h" | 34 #include "V8DOMFileSystem.h" |
| 35 #include "V8DirectoryEntry.h" | 35 #include "V8DirectoryEntry.h" |
| 36 #include "V8FileEntry.h" | 36 #include "V8FileEntry.h" |
| 37 #include "WebFrameImpl.h" | 37 #include "WebLocalFrameImpl.h" |
| 38 #include "bindings/v8/WrapperTypeInfo.h" | 38 #include "bindings/v8/WrapperTypeInfo.h" |
| 39 #include "core/dom/Document.h" | 39 #include "core/dom/Document.h" |
| 40 #include "modules/filesystem/DOMFileSystem.h" | 40 #include "modules/filesystem/DOMFileSystem.h" |
| 41 #include "modules/filesystem/DirectoryEntry.h" | 41 #include "modules/filesystem/DirectoryEntry.h" |
| 42 #include "modules/filesystem/FileEntry.h" | 42 #include "modules/filesystem/FileEntry.h" |
| 43 #include <v8.h> | 43 #include <v8.h> |
| 44 | 44 |
| 45 using namespace WebCore; | 45 using namespace WebCore; |
| 46 | 46 |
| 47 namespace blink { | 47 namespace blink { |
| 48 | 48 |
| 49 WebDOMFileSystem WebDOMFileSystem::fromV8Value(v8::Handle<v8::Value> value) | 49 WebDOMFileSystem WebDOMFileSystem::fromV8Value(v8::Handle<v8::Value> value) |
| 50 { | 50 { |
| 51 if (!V8DOMFileSystem::hasInstance(value, v8::Isolate::GetCurrent())) | 51 if (!V8DOMFileSystem::hasInstance(value, v8::Isolate::GetCurrent())) |
| 52 return WebDOMFileSystem(); | 52 return WebDOMFileSystem(); |
| 53 v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(value); | 53 v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(value); |
| 54 DOMFileSystem* domFileSystem = V8DOMFileSystem::toNative(object); | 54 DOMFileSystem* domFileSystem = V8DOMFileSystem::toNative(object); |
| 55 ASSERT(domFileSystem); | 55 ASSERT(domFileSystem); |
| 56 return WebDOMFileSystem(domFileSystem); | 56 return WebDOMFileSystem(domFileSystem); |
| 57 } | 57 } |
| 58 | 58 |
| 59 WebDOMFileSystem WebDOMFileSystem::create( | 59 WebDOMFileSystem WebDOMFileSystem::create( |
| 60 WebLocalFrame* frame, | 60 WebLocalFrame* frame, |
| 61 WebFileSystemType type, | 61 WebFileSystemType type, |
| 62 const WebString& name, | 62 const WebString& name, |
| 63 const WebURL& rootURL, | 63 const WebURL& rootURL, |
| 64 SerializableType serializableType) | 64 SerializableType serializableType) |
| 65 { | 65 { |
| 66 ASSERT(frame && toWebFrameImpl(frame)->frame()); | 66 ASSERT(frame && toWebLocalFrameImpl(frame)->frame()); |
| 67 RefPtrWillBeRawPtr<DOMFileSystem> domFileSystem = DOMFileSystem::create(toWe
bFrameImpl(frame)->frame()->document(), name, static_cast<WebCore::FileSystemTyp
e>(type), rootURL); | 67 RefPtrWillBeRawPtr<DOMFileSystem> domFileSystem = DOMFileSystem::create(toWe
bLocalFrameImpl(frame)->frame()->document(), name, static_cast<WebCore::FileSyst
emType>(type), rootURL); |
| 68 if (serializableType == SerializableTypeSerializable) | 68 if (serializableType == SerializableTypeSerializable) |
| 69 domFileSystem->makeClonable(); | 69 domFileSystem->makeClonable(); |
| 70 return WebDOMFileSystem(domFileSystem); | 70 return WebDOMFileSystem(domFileSystem); |
| 71 } | 71 } |
| 72 | 72 |
| 73 void WebDOMFileSystem::reset() | 73 void WebDOMFileSystem::reset() |
| 74 { | 74 { |
| 75 m_private.reset(); | 75 m_private.reset(); |
| 76 } | 76 } |
| 77 | 77 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 { | 134 { |
| 135 } | 135 } |
| 136 | 136 |
| 137 WebDOMFileSystem& WebDOMFileSystem::operator=(const PassRefPtrWillBeRawPtr<WebCo
re::DOMFileSystem>& domFileSystem) | 137 WebDOMFileSystem& WebDOMFileSystem::operator=(const PassRefPtrWillBeRawPtr<WebCo
re::DOMFileSystem>& domFileSystem) |
| 138 { | 138 { |
| 139 m_private = domFileSystem; | 139 m_private = domFileSystem; |
| 140 return *this; | 140 return *this; |
| 141 } | 141 } |
| 142 | 142 |
| 143 } // namespace blink | 143 } // namespace blink |
| OLD | NEW |