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

Side by Side Diff: content/shell/shell_browser_main_parts.cc

Issue 16360007: [content shell] don't leak the devtools delegate (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/shell/shell_browser_main_parts.h ('k') | tools/valgrind/memcheck/suppressions.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/shell/shell_browser_main_parts.h" 5 #include "content/shell/shell_browser_main_parts.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 #endif 115 #endif
116 } 116 }
117 117
118 void ShellBrowserMainParts::PreMainMessageLoopRun() { 118 void ShellBrowserMainParts::PreMainMessageLoopRun() {
119 browser_context_.reset(new ShellBrowserContext(false)); 119 browser_context_.reset(new ShellBrowserContext(false));
120 off_the_record_browser_context_.reset(new ShellBrowserContext(true)); 120 off_the_record_browser_context_.reset(new ShellBrowserContext(true));
121 121
122 Shell::Initialize(); 122 Shell::Initialize();
123 net::NetModule::SetResourceProvider(PlatformResourceProvider); 123 net::NetModule::SetResourceProvider(PlatformResourceProvider);
124 124
125 devtools_delegate_ = new ShellDevToolsDelegate(browser_context_.get()); 125 devtools_delegate_.reset(new ShellDevToolsDelegate(browser_context_.get()));
126 126
127 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) { 127 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) {
128 Shell::CreateNewWindow(browser_context_.get(), 128 Shell::CreateNewWindow(browser_context_.get(),
129 GetStartupURL(), 129 GetStartupURL(),
130 NULL, 130 NULL,
131 MSG_ROUTING_NONE, 131 MSG_ROUTING_NONE,
132 gfx::Size()); 132 gfx::Size());
133 } 133 }
134 134
135 #if defined(ENABLE_PLUGINS) 135 #if defined(ENABLE_PLUGINS)
(...skipping 19 matching lines...) Expand all
155 #if defined(USE_AURA) 155 #if defined(USE_AURA)
156 Shell::PlatformExit(); 156 Shell::PlatformExit();
157 #endif 157 #endif
158 if (devtools_delegate_) 158 if (devtools_delegate_)
159 devtools_delegate_->Stop(); 159 devtools_delegate_->Stop();
160 browser_context_.reset(); 160 browser_context_.reset();
161 off_the_record_browser_context_.reset(); 161 off_the_record_browser_context_.reset();
162 } 162 }
163 163
164 } // namespace 164 } // namespace
OLDNEW
« no previous file with comments | « content/shell/shell_browser_main_parts.h ('k') | tools/valgrind/memcheck/suppressions.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698