| 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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 return WebFileSystem::TypeTemporary; | 109 return WebFileSystem::TypeTemporary; |
| 110 } | 110 } |
| 111 } | 111 } |
| 112 | 112 |
| 113 WebURL WebDOMFileSystem::rootURL() const | 113 WebURL WebDOMFileSystem::rootURL() const |
| 114 { | 114 { |
| 115 ASSERT(m_private.get()); | 115 ASSERT(m_private.get()); |
| 116 return m_private->rootURL(); | 116 return m_private->rootURL(); |
| 117 } | 117 } |
| 118 | 118 |
| 119 v8::Local<v8::Value> WebDOMFileSystem::toV8Value(v8::Local<v8::Object> creationC
ontext, v8::Isolate* isolate) | 119 v8::Local<v8::Value> WebDOMFileSystem::toV8Value(v8::Local<v8::Object> /* creati
onContext */, v8::Isolate* isolate) |
| 120 { | 120 { |
| 121 // We no longer use |creationContext| because it's often misused and points |
| 122 // to a context faked by user script. |
| 121 if (!m_private.get()) | 123 if (!m_private.get()) |
| 122 return v8::Local<v8::Value>(); | 124 return v8::Local<v8::Value>(); |
| 123 return toV8(m_private.get(), creationContext, isolate); | 125 return toV8(m_private.get(), isolate->GetCurrentContext()->Global(), isolate
); |
| 124 } | 126 } |
| 125 | 127 |
| 126 v8::Local<v8::Value> WebDOMFileSystem::createV8Entry( | 128 v8::Local<v8::Value> WebDOMFileSystem::createV8Entry( |
| 127 const WebString& path, | 129 const WebString& path, |
| 128 EntryType entryType, | 130 EntryType entryType, |
| 129 v8::Local<v8::Object> creationContext, | 131 v8::Local<v8::Object> creationContext, |
| 130 v8::Isolate* isolate) | 132 v8::Isolate* isolate) |
| 131 { | 133 { |
| 132 if (!m_private.get()) | 134 if (!m_private.get()) |
| 133 return v8::Local<v8::Value>(); | 135 return v8::Local<v8::Value>(); |
| 134 if (entryType == EntryTypeDirectory) | 136 if (entryType == EntryTypeDirectory) |
| 135 return toV8(DirectoryEntry::create(m_private.get(), path), creationConte
xt, isolate); | 137 return toV8(DirectoryEntry::create(m_private.get(), path), isolate->GetC
urrentContext()->Global(), isolate); |
| 136 ASSERT(entryType == EntryTypeFile); | 138 ASSERT(entryType == EntryTypeFile); |
| 137 return toV8(FileEntry::create(m_private.get(), path), creationContext, isola
te); | 139 return toV8(FileEntry::create(m_private.get(), path), isolate->GetCurrentCon
text()->Global(), isolate); |
| 138 } | 140 } |
| 139 | 141 |
| 140 WebDOMFileSystem::WebDOMFileSystem(DOMFileSystem* domFileSystem) | 142 WebDOMFileSystem::WebDOMFileSystem(DOMFileSystem* domFileSystem) |
| 141 : m_private(domFileSystem) | 143 : m_private(domFileSystem) |
| 142 { | 144 { |
| 143 } | 145 } |
| 144 | 146 |
| 145 WebDOMFileSystem& WebDOMFileSystem::operator=(DOMFileSystem* domFileSystem) | 147 WebDOMFileSystem& WebDOMFileSystem::operator=(DOMFileSystem* domFileSystem) |
| 146 { | 148 { |
| 147 m_private = domFileSystem; | 149 m_private = domFileSystem; |
| 148 return *this; | 150 return *this; |
| 149 } | 151 } |
| 150 | 152 |
| 151 } // namespace blink | 153 } // namespace blink |
| OLD | NEW |