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

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

Issue 10310030: Convert references to FileSystem & Co. into shared pointers (avoid use after free) (Closed)
Patch Set: Created April 18, 2013, 11:59 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
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 #include "tr1_memory.h"
8
7 namespace AdblockPlus 9 namespace AdblockPlus
8 { 10 {
9 typedef std::vector<std::pair<std::string, std::string> > HeaderList; 11 typedef std::vector<std::pair<std::string, std::string> > HeaderList;
10 12
11 struct ServerResponse 13 struct ServerResponse
12 { 14 {
13 #ifdef _WIN32 15 #ifdef _WIN32
14 __int64 status; 16 __int64 status;
15 #else 17 #else
16 int64_t status; 18 int64_t status;
(...skipping 21 matching lines...) Expand all
38 NS_ERROR_REDIRECT_LOOP = 0x804b001f, 40 NS_ERROR_REDIRECT_LOOP = 0x804b001f,
39 NS_ERROR_UNKNOWN_PROXY_HOST = 0x804b002a, 41 NS_ERROR_UNKNOWN_PROXY_HOST = 0x804b002a,
40 NS_ERROR_NOT_INITIALIZED = 0xc1f30001, 42 NS_ERROR_NOT_INITIALIZED = 0xc1f30001,
41 NS_CUSTOM_ERROR_BASE = 0x80850000 43 NS_CUSTOM_ERROR_BASE = 0x80850000
42 }; 44 };
43 45
44 virtual inline ~WebRequest() {}; 46 virtual inline ~WebRequest() {};
45 virtual ServerResponse GET(const std::string& url, const HeaderList& request Headers) const = 0; 47 virtual ServerResponse GET(const std::string& url, const HeaderList& request Headers) const = 0;
46 }; 48 };
47 49
48 class DefaultWebRequest : public WebRequest 50 typedef std::tr1::shared_ptr<WebRequest> WebRequestPtr;
49 {
50 ServerResponse GET(const std::string& url, const HeaderList& requestHeaders) const;
51 };
52 } 51 }
53 52
54 #endif 53 #endif
OLDNEW
« no previous file with comments | « include/AdblockPlus/JsEngine.h ('k') | libadblockplus.gyp » ('j') | src/JsEngine.cpp » ('J')

Powered by Google App Engine
This is Rietveld