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

Unified 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.
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
Index: include/AdblockPlus/WebRequest.h
===================================================================
--- a/include/AdblockPlus/WebRequest.h
+++ b/include/AdblockPlus/WebRequest.h
@@ -1,14 +1,16 @@
#ifndef ADBLOCKPLUS_WEB_REQUEST_H
#define ADBLOCKPLUS_WEB_REQUEST_H
#include <string>
#include <vector>
+#include "tr1_memory.h"
+
namespace AdblockPlus
{
typedef std::vector<std::pair<std::string, std::string> > HeaderList;
struct ServerResponse
{
#ifdef _WIN32
__int64 status;
@@ -40,15 +42,12 @@ namespace AdblockPlus
NS_ERROR_NOT_INITIALIZED = 0xc1f30001,
NS_CUSTOM_ERROR_BASE = 0x80850000
};
virtual inline ~WebRequest() {};
virtual ServerResponse GET(const std::string& url, const HeaderList& requestHeaders) const = 0;
};
- class DefaultWebRequest : public WebRequest
- {
- ServerResponse GET(const std::string& url, const HeaderList& requestHeaders) const;
- };
+ typedef std::tr1::shared_ptr<WebRequest> WebRequestPtr;
}
#endif
« 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