andersca | 5eadba0 | 2006-08-14 16:32:34 +0000 | [diff] [blame] | 1 | /* |
darin@apple.com | 4b47a4d | 2016-10-19 16:57:31 +0000 | [diff] [blame] | 2 | * Copyright (C) 2003, 2006 Apple Inc. All rights reserved. |
andersca | 5eadba0 | 2006-08-14 16:32:34 +0000 | [diff] [blame] | 3 | * |
| 4 | * This library is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU Lesser General Public |
| 6 | * License as published by the Free Software Foundation; either |
| 7 | * version 2 of the License, or (at your option) any later version. |
| 8 | * |
| 9 | * This library is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 12 | * Lesser General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU Lesser General Public |
| 15 | * License along with this library; if not, write to the Free Software |
ddkilzer | c8eccec | 2007-09-26 02:29:57 +0000 | [diff] [blame] | 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
andersca | 5eadba0 | 2006-08-14 16:32:34 +0000 | [diff] [blame] | 17 | */ |
| 18 | |
darin@apple.com | 4b47a4d | 2016-10-19 16:57:31 +0000 | [diff] [blame] | 19 | #pragma once |
andersca | 5eadba0 | 2006-08-14 16:32:34 +0000 | [diff] [blame] | 20 | |
darin@apple.com | 4b47a4d | 2016-10-19 16:57:31 +0000 | [diff] [blame] | 21 | #include "ExceptionOr.h" |
cdumez@apple.com | 7621476 | 2016-09-27 23:33:08 +0000 | [diff] [blame] | 22 | #include <wtf/WeakPtr.h> |
andersca | 5eadba0 | 2006-08-14 16:32:34 +0000 | [diff] [blame] | 23 | |
| 24 | namespace WebCore { |
darin@apple.com | 734fbf6 | 2008-02-10 19:27:12 +0000 | [diff] [blame] | 25 | |
tonyg@chromium.org | aa1d388 | 2010-12-30 23:41:56 +0000 | [diff] [blame] | 26 | class Document; |
| 27 | |
| 28 | class DOMParser : public RefCounted<DOMParser> { |
| 29 | public: |
darin@apple.com | 4b47a4d | 2016-10-19 16:57:31 +0000 | [diff] [blame] | 30 | static Ref<DOMParser> create(Document& contextDocument); |
cdumez@apple.com | 7ca8445 | 2019-09-20 21:35:58 +0000 | [diff] [blame] | 31 | ExceptionOr<Ref<Document>> parseFromString(const String&, const String& contentType); |
tonyg@chromium.org | aa1d388 | 2010-12-30 23:41:56 +0000 | [diff] [blame] | 32 | |
| 33 | private: |
cdumez@apple.com | 7621476 | 2016-09-27 23:33:08 +0000 | [diff] [blame] | 34 | explicit DOMParser(Document& contextDocument); |
| 35 | |
| 36 | WeakPtr<Document> m_contextDocument; |
tonyg@chromium.org | aa1d388 | 2010-12-30 23:41:56 +0000 | [diff] [blame] | 37 | }; |
darin@apple.com | 734fbf6 | 2008-02-10 19:27:12 +0000 | [diff] [blame] | 38 | |
andersca | 5eadba0 | 2006-08-14 16:32:34 +0000 | [diff] [blame] | 39 | } |