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

Unified Diff: content/browser/renderer_host/render_process_host_impl.cc

Issue 10993056: Just because we want to destroy a pointer somewhere other than a destructor doesn't mean we can't u… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 3 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 | « content/browser/browser_process_sub_thread.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_process_host_impl.cc
===================================================================
--- content/browser/renderer_host/render_process_host_impl.cc (revision 158860)
+++ content/browser/renderer_host/render_process_host_impl.cc (working copy)
@@ -138,8 +138,7 @@
public:
explicit RendererMainThread(const std::string& channel_id)
: base::Thread("Chrome_InProcRendererThread"),
- channel_id_(channel_id),
- render_process_(NULL) {
+ channel_id_(channel_id) {
}
~RendererMainThread() {
@@ -152,12 +151,12 @@
CoInitialize(NULL);
#endif
- render_process_ = new RenderProcessImpl();
+ render_process_.reset(new RenderProcessImpl());
new RenderThreadImpl(channel_id_);
}
virtual void CleanUp() {
- delete render_process_;
+ render_process_.reset();
#if defined(OS_WIN)
CoUninitialize();
@@ -176,8 +175,7 @@
private:
std::string channel_id_;
- // Deleted in CleanUp() on the renderer thread, so don't use a smart pointer.
- RenderProcess* render_process_;
+ scoped_ptr<RenderProcess> render_process_;
};
namespace {
« no previous file with comments | « content/browser/browser_process_sub_thread.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698