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

Side by Side Diff: third_party/WebKit/Source/platform/mhtml/MHTMLParser.h

Issue 1441553002: Generating CIDs in Blink during MHTML serialization. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mhtml-per-frame-page-serializer-only
Patch Set: Using references for out parameters in Blink. Created 5 years 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 15 matching lines...) Expand all
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #ifndef MHTMLParser_h 31 #ifndef MHTMLParser_h
32 #define MHTMLParser_h 32 #define MHTMLParser_h
33 33
34 #include "platform/SharedBufferChunkReader.h" 34 #include "platform/SharedBufferChunkReader.h"
35 #include "platform/heap/Handle.h" 35 #include "platform/heap/Handle.h"
36 #include "platform/weborigin/KURL.h"
36 #include "wtf/RefPtr.h" 37 #include "wtf/RefPtr.h"
37 #include "wtf/Vector.h" 38 #include "wtf/Vector.h"
38 39
39 namespace WTF { 40 namespace WTF {
40 class String; 41 class String;
41 } 42 }
42 43
43 namespace blink { 44 namespace blink {
44 45
45 class ArchiveResource; 46 class ArchiveResource;
46 class MHTMLArchive; 47 class MHTMLArchive;
47 class MIMEHeader; 48 class MIMEHeader;
48 class SharedBuffer; 49 class SharedBuffer;
49 50
50 class PLATFORM_EXPORT MHTMLParser final { 51 class PLATFORM_EXPORT MHTMLParser final {
51 STACK_ALLOCATED(); 52 STACK_ALLOCATED();
52 public: 53 public:
53 explicit MHTMLParser(SharedBuffer*); 54 explicit MHTMLParser(SharedBuffer*);
54 55
55 PassRefPtrWillBeRawPtr<MHTMLArchive> parseArchive(); 56 PassRefPtrWillBeRawPtr<MHTMLArchive> parseArchive();
56 57
57 size_t frameCount() const; 58 size_t frameCount() const;
58 MHTMLArchive* frameAt(size_t) const; 59 MHTMLArchive* frameAt(size_t) const;
59 60
60 size_t subResourceCount() const; 61 size_t subResourceCount() const;
61 ArchiveResource* subResourceAt(size_t) const; 62 ArchiveResource* subResourceAt(size_t) const;
62 63
64 // Translates |contentIDFromMimeHeader| (of the form "<foo@bar.com>")
65 // into a cid-scheme URI (of the form "cid:foo@bar.com").
66 //
67 // Returns KURL() - an invalid URL - if contentID is invalid.
68 //
69 // See rfc2557 - section 8.3 - "Use of the Content-ID header and CID URLs".
70 static KURL convertContentIDToURI(const String& contentID);
71
63 private: 72 private:
64 PassRefPtrWillBeRawPtr<MHTMLArchive> parseArchiveWithHeader(MIMEHeader*); 73 PassRefPtrWillBeRawPtr<MHTMLArchive> parseArchiveWithHeader(MIMEHeader*);
65 PassRefPtrWillBeRawPtr<ArchiveResource> parseNextPart(const MIMEHeader&, con st String& endOfPartBoundary, const String& endOfDocumentBoundary, bool& endOfAr chiveReached); 74 PassRefPtrWillBeRawPtr<ArchiveResource> parseNextPart(const MIMEHeader&, con st String& endOfPartBoundary, const String& endOfDocumentBoundary, bool& endOfAr chiveReached);
66 75
67 void addResourceToArchive(ArchiveResource*, MHTMLArchive*); 76 void addResourceToArchive(ArchiveResource*, MHTMLArchive*);
68 77
69 SharedBufferChunkReader m_lineReader; 78 SharedBufferChunkReader m_lineReader;
70 WillBeHeapVector<RefPtrWillBeMember<ArchiveResource>> m_resources; 79 WillBeHeapVector<RefPtrWillBeMember<ArchiveResource>> m_resources;
71 WillBeHeapVector<RefPtrWillBeMember<MHTMLArchive>> m_frames; 80 WillBeHeapVector<RefPtrWillBeMember<MHTMLArchive>> m_frames;
72 }; 81 };
73 82
74 } 83 }
75 84
76 #endif 85 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698