Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(99)

Side by Side Diff: Source/core/loader/DocumentWriter.h

Issue 495743003: Add an extra guard to replaceDocument() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Landing Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/loader/DocumentLoader.cpp ('k') | Source/core/loader/FrameLoader.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 public: 48 public:
49 static PassRefPtrWillBeRawPtr<DocumentWriter> create(Document*, const Atomic String& mimeType = emptyAtom, const AtomicString& encoding = emptyAtom); 49 static PassRefPtrWillBeRawPtr<DocumentWriter> create(Document*, const Atomic String& mimeType = emptyAtom, const AtomicString& encoding = emptyAtom);
50 50
51 ~DocumentWriter(); 51 ~DocumentWriter();
52 void trace(Visitor*); 52 void trace(Visitor*);
53 53
54 void end(); 54 void end();
55 55
56 // This is only called by ScriptController::executeScriptIfJavaScriptURL 56 // This is only called by ScriptController::executeScriptIfJavaScriptURL
57 // and always contains the result of evaluating a javascript: url. 57 // and always contains the result of evaluating a javascript: url.
58 void replaceDocument(const String&, Document* ownerDocument); 58 void replaceDocumentWhileExecutingJavaScriptURL(const String&, Document* own erDocument);
59 59
60 void addData(const char* bytes, size_t length); 60 void addData(const char* bytes, size_t length);
61 61
62 const AtomicString& mimeType() const { return m_decoderBuilder.mimeType(); } 62 const AtomicString& mimeType() const { return m_decoderBuilder.mimeType(); }
63 const AtomicString& encoding() const { return m_decoderBuilder.encoding(); } 63 const AtomicString& encoding() const { return m_decoderBuilder.encoding(); }
64 64
65 // Exposed for DocumentLoader::replaceDocument. 65 // Exposed for DocumentLoader::replaceDocumentWhileExecutingJavaScriptURL.
66 void appendReplacingData(const String&); 66 void appendReplacingData(const String&);
67 67
68 void setUserChosenEncoding(const String& charset); 68 void setUserChosenEncoding(const String& charset);
69 69
70 void setDocumentWasLoadedAsPartOfNavigation(); 70 void setDocumentWasLoadedAsPartOfNavigation();
71 71
72 private: 72 private:
73 DocumentWriter(Document*, const AtomicString& mimeType, const AtomicString& encoding); 73 DocumentWriter(Document*, const AtomicString& mimeType, const AtomicString& encoding);
74 74
75 RawPtrWillBeMember<Document> m_document; 75 RawPtrWillBeMember<Document> m_document;
76 TextResourceDecoderBuilder m_decoderBuilder; 76 TextResourceDecoderBuilder m_decoderBuilder;
77 77
78 RefPtrWillBeMember<DocumentParser> m_parser; 78 RefPtrWillBeMember<DocumentParser> m_parser;
79 }; 79 };
80 80
81 } // namespace blink 81 } // namespace blink
82 82
83 #endif // DocumentWriter_h 83 #endif // DocumentWriter_h
OLDNEW
« no previous file with comments | « Source/core/loader/DocumentLoader.cpp ('k') | Source/core/loader/FrameLoader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698