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

Unified 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.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « check_curl.py ('k') | libadblockplus.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/AdblockPlus/WebRequest.h
===================================================================
--- a/include/AdblockPlus/WebRequest.h
+++ b/include/AdblockPlus/WebRequest.h
@@ -1,26 +1,50 @@
#ifndef ADBLOCKPLUS_WEB_REQUEST_H
#define ADBLOCKPLUS_WEB_REQUEST_H
#include <string>
#include <vector>
+enum
+{
+ NS_OK = 0,
+ NS_ERROR_FAILURE = 0x80004005,
+ NS_ERROR_OUT_OF_MEMORY = 0x8007000e,
+ NS_ERROR_MALFORMED_URI = 0x804b000a,
+ NS_ERROR_CONNECTION_REFUSED = 0x804b000d,
+ NS_ERROR_NET_TIMEOUT = 0x804b000e,
+ NS_ERROR_NO_CONTENT = 0x804b0011,
+ NS_ERROR_UNKNOWN_PROTOCOL = 0x804b0012,
+ NS_ERROR_NET_RESET = 0x804b0014,
+ NS_ERROR_UNKNOWN_HOST = 0x804b001e,
+ NS_ERROR_REDIRECT_LOOP = 0x804b001f,
+ NS_ERROR_UNKNOWN_PROXY_HOST = 0x804b002a,
+ NS_ERROR_NOT_INITIALIZED = 0xc1f30001,
+ NS_CUSTOM_ERROR_BASE = 0x80850000
+};
+
namespace AdblockPlus
{
typedef std::vector< std::pair<std::string, std::string> > HeadersList;
struct ServerResponse
{
+ unsigned int status;
HeadersList responseHeaders;
int responseStatus;
std::string responseText;
};
class WebRequest
{
public:
virtual ~WebRequest();
virtual ServerResponse GET(const std::string& url, const HeadersList& requestHeaders) const = 0;
};
+
+ class DefaultWebRequest : public WebRequest
+ {
+ ServerResponse GET(const std::string& url, const HeadersList& requestHeaders) const;
+ };
}
#endif
« 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