Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: compiled/subscription/DownloadableSubscription.h

Issue 29630576: Issue 5146 - Part 2: Process http response in C++ (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Created Dec. 5, 2017, 9:19 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « compiled/bindings/main.cpp ('k') | compiled/subscription/DownloadableSubscription.cpp » ('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 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-present eyeo GmbH 3 * Copyright (C) 2006-present eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 static DownloadableSubscription_Parser* BINDINGS_EXPORTED ParseDownload(); 63 static DownloadableSubscription_Parser* BINDINGS_EXPORTED ParseDownload();
64 OwnedString BINDINGS_EXPORTED Serialize() const; 64 OwnedString BINDINGS_EXPORTED Serialize() const;
65 }; 65 };
66 66
67 typedef intrusive_ptr<DownloadableSubscription> DownloadableSubscriptionPtr; 67 typedef intrusive_ptr<DownloadableSubscription> DownloadableSubscriptionPtr;
68 68
69 class DownloadableSubscription_Parser : public ref_counted 69 class DownloadableSubscription_Parser : public ref_counted
70 { 70 {
71 std::vector<OwnedString> mFiltersText; 71 std::vector<OwnedString> mFiltersText;
72 OwnedStringMap<OwnedString> mParams; 72 OwnedStringMap<OwnedString> mParams;
73 bool mFirstLine;
74 public: 73 public:
75 DownloadableSubscription_Parser(); 74 DownloadableSubscription_Parser();
76 void BINDINGS_EXPORTED Process(const String& line); 75 bool BINDINGS_EXPORTED Process(const String& buffer);
77 bool BINDINGS_EXPORTED VerifyChecksum(); 76 bool BINDINGS_EXPORTED VerifyChecksum();
78 // return the expiration interval. 77 // return the expiration interval.
79 int64_t BINDINGS_EXPORTED Finalize(DownloadableSubscription&); 78 int64_t BINDINGS_EXPORTED Finalize(DownloadableSubscription&);
80 const String& BINDINGS_EXPORTED GetRedirect() const; 79 const String& BINDINGS_EXPORTED GetRedirect() const;
81 const String& BINDINGS_EXPORTED GetHomepage() const; 80 const String& BINDINGS_EXPORTED GetHomepage() const;
81 const String& BINDINGS_EXPORTED GetError() const
82 {
83 return mError;
84 }
82 private: 85 private:
83 MD5 mChecksum; 86 MD5 mChecksum;
87 DependentString mError;
88 OwnedString mRequiredVersion;
84 OwnedString mB64Checksum; 89 OwnedString mB64Checksum;
85 static int64_t ParseExpires(const String& expires); 90 static int64_t ParseExpires(const String& expires);
91 bool ProcessFirstLine(const String& line);
92 void ProcessLine(const String& line);
93 static bool GetNextLine(DependentString& buffer, DependentString& line);
86 }; 94 };
87 95
OLDNEW
« no previous file with comments | « compiled/bindings/main.cpp ('k') | compiled/subscription/DownloadableSubscription.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld