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

Side by Side Diff: include/AdblockPlus/WebRequest.h

Issue 10252013: Implemented curl support for web requests (Closed)
Patch Set: Made abpshell use DefaultWebRequest Created April 11, 2013, 3:55 p.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 | « check_curl.py ('k') | libadblockplus.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #ifndef ADBLOCKPLUS_WEB_REQUEST_H 1 #ifndef ADBLOCKPLUS_WEB_REQUEST_H
2 #define ADBLOCKPLUS_WEB_REQUEST_H 2 #define ADBLOCKPLUS_WEB_REQUEST_H
3 3
4 #include <string> 4 #include <string>
5 #include <vector> 5 #include <vector>
6 6
7 enum
8 {
9 NS_OK = 0,
10 NS_ERROR_FAILURE = 0x80004005,
11 NS_ERROR_OUT_OF_MEMORY = 0x8007000e,
12 NS_ERROR_MALFORMED_URI = 0x804b000a,
13 NS_ERROR_CONNECTION_REFUSED = 0x804b000d,
14 NS_ERROR_NET_TIMEOUT = 0x804b000e,
15 NS_ERROR_NO_CONTENT = 0x804b0011,
16 NS_ERROR_UNKNOWN_PROTOCOL = 0x804b0012,
17 NS_ERROR_NET_RESET = 0x804b0014,
18 NS_ERROR_UNKNOWN_HOST = 0x804b001e,
19 NS_ERROR_REDIRECT_LOOP = 0x804b001f,
20 NS_ERROR_UNKNOWN_PROXY_HOST = 0x804b002a,
21 NS_ERROR_NOT_INITIALIZED = 0xc1f30001,
22 NS_CUSTOM_ERROR_BASE = 0x80850000
23 };
24
7 namespace AdblockPlus 25 namespace AdblockPlus
8 { 26 {
9 typedef std::vector< std::pair<std::string, std::string> > HeadersList; 27 typedef std::vector< std::pair<std::string, std::string> > HeadersList;
10 28
11 struct ServerResponse 29 struct ServerResponse
12 { 30 {
31 unsigned int status;
13 HeadersList responseHeaders; 32 HeadersList responseHeaders;
14 int responseStatus; 33 int responseStatus;
15 std::string responseText; 34 std::string responseText;
16 }; 35 };
17 36
18 class WebRequest 37 class WebRequest
19 { 38 {
20 public: 39 public:
21 virtual ~WebRequest(); 40 virtual ~WebRequest();
22 virtual ServerResponse GET(const std::string& url, const HeadersList& reques tHeaders) const = 0; 41 virtual ServerResponse GET(const std::string& url, const HeadersList& reques tHeaders) const = 0;
23 }; 42 };
43
44 class DefaultWebRequest : public WebRequest
45 {
46 ServerResponse GET(const std::string& url, const HeadersList& requestHeaders ) const;
47 };
24 } 48 }
25 49
26 #endif 50 #endif
OLDNEW
« no previous file with comments | « check_curl.py ('k') | libadblockplus.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld