| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2006, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2006, 2008 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2005-2007 Alexey Proskuryakov <ap@webkit.org> | 3 * Copyright (C) 2005-2007 Alexey Proskuryakov <ap@webkit.org> |
| 4 * Copyright (C) 2007, 2008 Julien Chaffraix <jchaffraix@webkit.org> | 4 * Copyright (C) 2007, 2008 Julien Chaffraix <jchaffraix@webkit.org> |
| 5 * Copyright (C) 2008, 2011 Google Inc. All rights reserved. | 5 * Copyright (C) 2008, 2011 Google Inc. All rights reserved. |
| 6 * Copyright (C) 2012 Intel Corporation | 6 * Copyright (C) 2012 Intel Corporation |
| 7 * | 7 * |
| 8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Lesser General Public | 9 * modify it under the terms of the GNU Lesser General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 { | 158 { |
| 159 m_xhr->didFinishLoadingFromBlob(); | 159 m_xhr->didFinishLoadingFromBlob(); |
| 160 } | 160 } |
| 161 void didFail(FileError::ErrorCode error) override | 161 void didFail(FileError::ErrorCode error) override |
| 162 { | 162 { |
| 163 m_xhr->didFailLoadingFromBlob(); | 163 m_xhr->didFailLoadingFromBlob(); |
| 164 } | 164 } |
| 165 | 165 |
| 166 void cancel() | 166 void cancel() |
| 167 { | 167 { |
| 168 m_loader.cancel(); | 168 m_loader->cancel(); |
| 169 } | 169 } |
| 170 | 170 |
| 171 DEFINE_INLINE_TRACE() | 171 DEFINE_INLINE_TRACE() |
| 172 { | 172 { |
| 173 visitor->trace(m_xhr); | 173 visitor->trace(m_xhr); |
| 174 } | 174 } |
| 175 | 175 |
| 176 private: | 176 private: |
| 177 BlobLoader(XMLHttpRequest* xhr, PassRefPtr<BlobDataHandle> handle) | 177 BlobLoader(XMLHttpRequest* xhr, PassRefPtr<BlobDataHandle> handle) |
| 178 : m_xhr(xhr) | 178 : m_xhr(xhr) |
| 179 , m_loader(FileReaderLoader::ReadByClient, this) | 179 , m_loader(FileReaderLoader::create(FileReaderLoader::ReadByClient, this
)) |
| 180 { | 180 { |
| 181 m_loader.start(m_xhr->getExecutionContext(), handle); | 181 m_loader->start(m_xhr->getExecutionContext(), handle); |
| 182 } | 182 } |
| 183 | 183 |
| 184 Member<XMLHttpRequest> m_xhr; | 184 Member<XMLHttpRequest> m_xhr; |
| 185 FileReaderLoader m_loader; | 185 std::unique_ptr<FileReaderLoader> m_loader; |
| 186 }; | 186 }; |
| 187 | 187 |
| 188 XMLHttpRequest* XMLHttpRequest::create(ScriptState* scriptState) | 188 XMLHttpRequest* XMLHttpRequest::create(ScriptState* scriptState) |
| 189 { | 189 { |
| 190 ExecutionContext* context = scriptState->getExecutionContext(); | 190 ExecutionContext* context = scriptState->getExecutionContext(); |
| 191 DOMWrapperWorld& world = scriptState->world(); | 191 DOMWrapperWorld& world = scriptState->world(); |
| 192 RefPtr<SecurityOrigin> isolatedWorldSecurityOrigin = world.isIsolatedWorld()
? world.isolatedWorldSecurityOrigin() : nullptr; | 192 RefPtr<SecurityOrigin> isolatedWorldSecurityOrigin = world.isIsolatedWorld()
? world.isolatedWorldSecurityOrigin() : nullptr; |
| 193 XMLHttpRequest* xmlHttpRequest = new XMLHttpRequest(context, isolatedWorldSe
curityOrigin); | 193 XMLHttpRequest* xmlHttpRequest = new XMLHttpRequest(context, isolatedWorldSe
curityOrigin); |
| 194 xmlHttpRequest->suspendIfNeeded(); | 194 xmlHttpRequest->suspendIfNeeded(); |
| 195 | 195 |
| (...skipping 1522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1718 | 1718 |
| 1719 DEFINE_TRACE_WRAPPERS(XMLHttpRequest) | 1719 DEFINE_TRACE_WRAPPERS(XMLHttpRequest) |
| 1720 { | 1720 { |
| 1721 visitor->traceWrappers(m_responseBlob); | 1721 visitor->traceWrappers(m_responseBlob); |
| 1722 visitor->traceWrappers(m_responseLegacyStream); | 1722 visitor->traceWrappers(m_responseLegacyStream); |
| 1723 visitor->traceWrappers(m_responseDocument); | 1723 visitor->traceWrappers(m_responseDocument); |
| 1724 visitor->traceWrappers(m_responseArrayBuffer); | 1724 visitor->traceWrappers(m_responseArrayBuffer); |
| 1725 } | 1725 } |
| 1726 | 1726 |
| 1727 } // namespace blink | 1727 } // namespace blink |
| OLD | NEW |