Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(132)

Unified Diff: content/common/content_client.h

Issue 6681040: Prevent memory leak for ChromeContentBrowserClient. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Let ContentClient own browser client. Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/browser_with_test_window_test.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/content_client.h
diff --git a/content/common/content_client.h b/content/common/content_client.h
index 4f936389647b27efe38af1f958bba1475a99a00e..a20865457bf81266c3e488975141c0781567c8b6 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
« no previous file with comments | « chrome/test/browser_with_test_window_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698