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

Unified Diff: content/shell/browser/layout_test/blink_test_controller.cc

Issue 2810873006: DevTools: fix memory issue with layout test (Closed)
Patch Set: fix Created 3 years, 8 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/shell/browser/layout_test/blink_test_controller.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/shell/browser/layout_test/blink_test_controller.cc
diff --git a/content/shell/browser/layout_test/blink_test_controller.cc b/content/shell/browser/layout_test/blink_test_controller.cc
index 2d27bdd91d6986e7ffbbac6078637d3188679cc7..5ccc498fdeb5540258217dcafbe2d59d3aeee1be 100644
--- a/content/shell/browser/layout_test/blink_test_controller.cc
+++ b/content/shell/browser/layout_test/blink_test_controller.cc
@@ -247,6 +247,7 @@ BlinkTestController* BlinkTestController::Get() {
BlinkTestController::BlinkTestController()
: main_window_(NULL),
+ devtools_window_(nullptr),
test_phase_(BETWEEN_TESTS),
is_leak_detection_enabled_(
base::CommandLine::ForCurrentProcess()->HasSwitch(
@@ -514,7 +515,9 @@ void BlinkTestController::DevToolsProcessCrashed() {
DCHECK(CalledOnValidThread());
printer_->AddErrorMessage("#CRASHED - devtools");
devtools_bindings_.reset();
- devtools_window_.reset();
+ if (devtools_window_)
+ devtools_window_->Close();
+ devtools_window_ = nullptr;
}
void BlinkTestController::WebContentsDestroyed() {
@@ -834,8 +837,8 @@ void BlinkTestController::OnShowDevTools(const std::string& settings,
if (!devtools_window_) {
ShellBrowserContext* browser_context =
ShellContentBrowserClient::Get()->browser_context();
- devtools_window_.reset(content::Shell::CreateNewWindow(
- browser_context, GURL(), nullptr, initial_size_));
+ devtools_window_ = content::Shell::CreateNewWindow(browser_context, GURL(),
+ nullptr, initial_size_);
}
devtools_bindings_.reset(LayoutTestDevToolsBindings::LoadDevTools(
@@ -914,8 +917,7 @@ void BlinkTestController::OnCloseRemainingWindows() {
DevToolsAgentHost::DetachAllClients();
std::vector<Shell*> open_windows(Shell::windows());
for (size_t i = 0; i < open_windows.size(); ++i) {
- if (open_windows[i] != main_window_ &&
- open_windows[i] != devtools_window_.get())
+ if (open_windows[i] != main_window_ && open_windows[i] != devtools_window_)
open_windows[i]->Close();
}
base::RunLoop().RunUntilIdle();
« no previous file with comments | « content/shell/browser/layout_test/blink_test_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698