| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010. Adam Barth. All rights reserved. | 2 * Copyright (C) 2010. Adam Barth. 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 #include "core/loader/TextResourceDecoderBuilder.h" | 33 #include "core/loader/TextResourceDecoderBuilder.h" |
| 34 #include "platform/heap/Handle.h" | 34 #include "platform/heap/Handle.h" |
| 35 #include "wtf/RefCounted.h" | 35 #include "wtf/RefCounted.h" |
| 36 #include "wtf/text/WTFString.h" | 36 #include "wtf/text/WTFString.h" |
| 37 | 37 |
| 38 namespace blink { | 38 namespace blink { |
| 39 | 39 |
| 40 class Document; | 40 class Document; |
| 41 class DocumentParser; | 41 class DocumentParser; |
| 42 | 42 |
| 43 class DocumentWriter final : public RefCountedWillBeGarbageCollectedFinalized<Do
cumentWriter> { | 43 class DocumentWriter final : public GarbageCollectedFinalized<DocumentWriter> { |
| 44 WTF_MAKE_NONCOPYABLE(DocumentWriter); | 44 WTF_MAKE_NONCOPYABLE(DocumentWriter); |
| 45 public: | 45 public: |
| 46 static PassRefPtrWillBeRawPtr<DocumentWriter> create(Document*, ParserSynchr
onizationPolicy, const AtomicString& mimeType, const AtomicString& encoding); | 46 static RawPtr<DocumentWriter> create(Document*, ParserSynchronizationPolicy,
const AtomicString& mimeType, const AtomicString& encoding); |
| 47 | 47 |
| 48 ~DocumentWriter(); | 48 ~DocumentWriter(); |
| 49 DECLARE_TRACE(); | 49 DECLARE_TRACE(); |
| 50 | 50 |
| 51 void end(); | 51 void end(); |
| 52 | 52 |
| 53 void addData(const char* bytes, size_t length); | 53 void addData(const char* bytes, size_t length); |
| 54 | 54 |
| 55 const AtomicString& mimeType() const { return m_decoderBuilder.mimeType(); } | 55 const AtomicString& mimeType() const { return m_decoderBuilder.mimeType(); } |
| 56 const AtomicString& encoding() const { return m_decoderBuilder.encoding(); } | 56 const AtomicString& encoding() const { return m_decoderBuilder.encoding(); } |
| 57 | 57 |
| 58 // Exposed for DocumentLoader::replaceDocumentWhileExecutingJavaScriptURL. | 58 // Exposed for DocumentLoader::replaceDocumentWhileExecutingJavaScriptURL. |
| 59 void appendReplacingData(const String&); | 59 void appendReplacingData(const String&); |
| 60 | 60 |
| 61 void setDocumentWasLoadedAsPartOfNavigation(); | 61 void setDocumentWasLoadedAsPartOfNavigation(); |
| 62 | 62 |
| 63 private: | 63 private: |
| 64 DocumentWriter(Document*, ParserSynchronizationPolicy, const AtomicString& m
imeType, const AtomicString& encoding); | 64 DocumentWriter(Document*, ParserSynchronizationPolicy, const AtomicString& m
imeType, const AtomicString& encoding); |
| 65 | 65 |
| 66 RawPtrWillBeMember<Document> m_document; | 66 Member<Document> m_document; |
| 67 TextResourceDecoderBuilder m_decoderBuilder; | 67 TextResourceDecoderBuilder m_decoderBuilder; |
| 68 | 68 |
| 69 RefPtrWillBeMember<DocumentParser> m_parser; | 69 Member<DocumentParser> m_parser; |
| 70 }; | 70 }; |
| 71 | 71 |
| 72 } // namespace blink | 72 } // namespace blink |
| 73 | 73 |
| 74 #endif // DocumentWriter_h | 74 #endif // DocumentWriter_h |
| OLD | NEW |