diff options
author | tommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-14 20:31:55 +0000 |
---|---|---|
committer | tommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-14 20:31:55 +0000 |
commit | 77d7aeebd314325c40d602bdaffe9342e3f4e29e (patch) | |
tree | 803526d79f6418adc12b6a9cf3fc66bf02bd9907 /chrome_frame/utils.h | |
parent | 29d6f5f2b19477cfef438f3e4a6ba762da6c7f25 (diff) | |
download | chromium_src-77d7aeebd314325c40d602bdaffe9342e3f4e29e.zip chromium_src-77d7aeebd314325c40d602bdaffe9342e3f4e29e.tar.gz chromium_src-77d7aeebd314325c40d602bdaffe9342e3f4e29e.tar.bz2 |
Candidate fix for bug 44108. The FromBindContext function was inherently racy as it returned a pointer to a non-addrefed pointer and the AddRef/Release implementation in the BindContextInfo was not thread safe.
Also fixed BSCBStorageBind object leak.
TEST=See bug description
BUG=44108
Review URL: http://codereview.chromium.org/2080005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47306 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/utils.h')
-rw-r--r-- | chrome_frame/utils.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/chrome_frame/utils.h b/chrome_frame/utils.h index ab4a3cb..d0f64d5 100644 --- a/chrome_frame/utils.h +++ b/chrome_frame/utils.h @@ -439,4 +439,16 @@ ProtocolPatchMethod GetPatchMethod(); // Returns true if the IMoniker patch is enabled. bool MonikerPatchEnabled(); +// STL helper class that implements a functor to delete objects. +// E.g: std::for_each(v.begin(), v.end(), utils::DeleteObject()); +namespace utils { +class DeleteObject { + public: + template <typename T> + void operator()(T* obj) { + delete obj; + } +}; +} + #endif // CHROME_FRAME_UTILS_H_ |