| 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 29 matching lines...) Expand all Loading... |
| 40 class SecurityOrigin; | 40 class SecurityOrigin; |
| 41 class TextResourceDecoder; | 41 class TextResourceDecoder; |
| 42 | 42 |
| 43 class DocumentWriter { | 43 class DocumentWriter { |
| 44 WTF_MAKE_NONCOPYABLE(DocumentWriter); | 44 WTF_MAKE_NONCOPYABLE(DocumentWriter); |
| 45 public: | 45 public: |
| 46 DocumentWriter(Frame*); | 46 DocumentWriter(Frame*); |
| 47 | 47 |
| 48 // This is only called by ScriptController::executeIfJavaScriptURL | 48 // This is only called by ScriptController::executeIfJavaScriptURL |
| 49 // and always contains the result of evaluating a javascript: url. | 49 // and always contains the result of evaluating a javascript: url. |
| 50 void replaceDocument(const String&); | 50 void replaceDocument(const String&, Document* ownerDocument); |
| 51 | |
| 52 enum SecurityOriginSource { CreateNewSecurityOrigin, InheritSecurityOrigin }
; | |
| 53 | 51 |
| 54 void begin(); | 52 void begin(); |
| 55 void begin(const KURL&, bool dispatchWindowObjectAvailable = true, SecurityO
riginSource = CreateNewSecurityOrigin); | 53 void begin(const KURL&, bool dispatchWindowObjectAvailable = true, Document*
ownerDocument = 0); |
| 56 void addData(const char* bytes, size_t length); | 54 void addData(const char* bytes, size_t length); |
| 57 void end(); | 55 void end(); |
| 58 void endIfNotLoadingMainResource(); | 56 void endIfNotLoadingMainResource(); |
| 59 | 57 |
| 60 void setFrame(Frame* frame) { m_frame = frame; } | 58 void setFrame(Frame* frame) { m_frame = frame; } |
| 61 | 59 |
| 62 String encoding() const; | 60 String encoding() const; |
| 63 void setEncoding(const String& encoding, bool userChosen); | 61 void setEncoding(const String& encoding, bool userChosen); |
| 64 | 62 |
| 65 // FIXME: It's really unforunate to need to expose this piece of state. | 63 // FIXME: It's really unforunate to need to expose this piece of state. |
| (...skipping 23 matching lines...) Expand all Loading... |
| 89 | 87 |
| 90 bool m_encodingWasChosenByUser; | 88 bool m_encodingWasChosenByUser; |
| 91 String m_encoding; | 89 String m_encoding; |
| 92 RefPtr<TextResourceDecoder> m_decoder; | 90 RefPtr<TextResourceDecoder> m_decoder; |
| 93 RefPtr<DocumentParser> m_parser; | 91 RefPtr<DocumentParser> m_parser; |
| 94 }; | 92 }; |
| 95 | 93 |
| 96 } // namespace WebCore | 94 } // namespace WebCore |
| 97 | 95 |
| 98 #endif // DocumentWriter_h | 96 #endif // DocumentWriter_h |
| OLD | NEW |