diff options
author | kuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-15 18:03:40 +0000 |
---|---|---|
committer | kuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-15 18:03:40 +0000 |
commit | c11ffb461a13c6635173991788ff7a50fc6a77f3 (patch) | |
tree | 37f909824fbffeddc460dfea5c4045a35ddc9d92 /chrome | |
parent | 0820ac156d55a3532af12014177dd619cafe216f (diff) | |
download | chromium_src-c11ffb461a13c6635173991788ff7a50fc6a77f3.zip chromium_src-c11ffb461a13c6635173991788ff7a50fc6a77f3.tar.gz chromium_src-c11ffb461a13c6635173991788ff7a50fc6a77f3.tar.bz2 |
Do proper cleanup during shutdown to make Valgrind happy.
BUG=10738,10748
Review URL: http://codereview.chromium.org/115392
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16159 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/renderer_host/renderer_security_policy.cc | 12 | ||||
-rw-r--r-- | chrome/browser/renderer_host/renderer_security_policy.h | 4 |
2 files changed, 16 insertions, 0 deletions
diff --git a/chrome/browser/renderer_host/renderer_security_policy.cc b/chrome/browser/renderer_host/renderer_security_policy.cc index c455c7e..dd988ff 100644 --- a/chrome/browser/renderer_host/renderer_security_policy.cc +++ b/chrome/browser/renderer_host/renderer_security_policy.cc @@ -6,6 +6,7 @@ #include "base/file_path.h" #include "base/logging.h" +#include "base/stl_util-inl.h" #include "base/string_util.h" #include "chrome/common/url_constants.h" #include "googleurl/src/gurl.h" @@ -16,6 +17,9 @@ class RendererSecurityPolicy::SecurityState { public: SecurityState() : has_dom_ui_bindings_(false) { } + ~SecurityState() { + scheme_policy_.clear(); + } // Grant permission to request URLs with the specified scheme. void GrantScheme(const std::string& scheme) { @@ -89,6 +93,14 @@ RendererSecurityPolicy::RendererSecurityPolicy() { RegisterPseudoScheme(chrome::kViewSourceScheme); } +RendererSecurityPolicy::~RendererSecurityPolicy() { + web_safe_schemes_.clear(); + pseudo_schemes_.clear(); + STLDeleteContainerPairSecondPointers(security_state_.begin(), + security_state_.end()); + security_state_.clear(); +} + // static RendererSecurityPolicy* RendererSecurityPolicy::GetInstance() { return Singleton<RendererSecurityPolicy>::get(); diff --git a/chrome/browser/renderer_host/renderer_security_policy.h b/chrome/browser/renderer_host/renderer_security_policy.h index 84fd32c..41cf04e 100644 --- a/chrome/browser/renderer_host/renderer_security_policy.h +++ b/chrome/browser/renderer_host/renderer_security_policy.h @@ -26,6 +26,10 @@ class GURL; // class RendererSecurityPolicy { public: + // Object can only be created through GetInstance() so the constructor is + // private. + ~RendererSecurityPolicy(); + // There is one global RendererSecurityPolicy object for the entire browser // processes. The object returned by this method may be accessed on any // thread. |