summaryrefslogtreecommitdiffstats
path: root/content/common
diff options
context:
space:
mode:
authorcreis@google.com <creis@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-14 22:17:30 +0000
committercreis@google.com <creis@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-14 22:17:30 +0000
commit147a3441b46aa6734dc6dc861f36f0ff05ff3888 (patch)
tree7a3fe7acf1c76c4bc7810d93bbdfe868084cd49c /content/common
parent12c94fa222c254df55cd8e60c831fd805b0d9400 (diff)
downloadchromium_src-147a3441b46aa6734dc6dc861f36f0ff05ff3888.zip
chromium_src-147a3441b46aa6734dc6dc861f36f0ff05ff3888.tar.gz
chromium_src-147a3441b46aa6734dc6dc861f36f0ff05ff3888.tar.bz2
Prevent memory leak for ChromeContentBrowserClient.
BUG=none TEST=Memory tests / Heapcheck Review URL: http://codereview.chromium.org/6681040 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78101 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/common')
-rw-r--r--content/common/content_client.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/content/common/content_client.h b/content/common/content_client.h
index 4f93638..a208654 100644
--- a/content/common/content_client.h
+++ b/content/common/content_client.h
@@ -7,6 +7,7 @@
#pragma once
#include "base/basictypes.h"
+#include "base/scoped_ptr.h"
#include "content/browser/content_browser_client.h"
class GURL;
@@ -28,10 +29,10 @@ class ContentClient {
// Gets or sets the embedder API for participating in browser logic.
// The client must be set early, before any content code is called.
ContentBrowserClient* browser_client() {
- return browser_client_;
+ return browser_client_.get();
}
void set_browser_client(ContentBrowserClient* client) {
- browser_client_ = client;
+ browser_client_.reset(client);
}
// Sets the URL that is logged if the child process crashes. Use GURL() to
@@ -42,7 +43,7 @@ class ContentClient {
virtual void SetGpuInfo(const GPUInfo& gpu_info) {}
private:
- ContentBrowserClient* browser_client_;
+ scoped_ptr<ContentBrowserClient> browser_client_;
};
} // namespace content