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

Side by Side Diff: content/browser/browser_main_loop.cc

Issue 1871253002: aura: Require explicit ownership of the Env instance. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tot.merge Created 4 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 unified diff | Download patch
« no previous file with comments | « content/browser/browser_main_loop.h ('k') | content/public/test/unittest_test_suite.h » ('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/browser/browser_main_loop.h" 5 #include "content/browser/browser_main_loop.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 964 matching lines...) Expand 10 before | Expand all | Expand 10 after
975 if (RenderProcessHost::run_renderer_in_process()) 975 if (RenderProcessHost::run_renderer_in_process())
976 RenderProcessHostImpl::ShutDownInProcessRenderer(); 976 RenderProcessHostImpl::ShutDownInProcessRenderer();
977 977
978 if (parts_) { 978 if (parts_) {
979 TRACE_EVENT0("shutdown", 979 TRACE_EVENT0("shutdown",
980 "BrowserMainLoop::Subsystem:PostMainMessageLoopRun"); 980 "BrowserMainLoop::Subsystem:PostMainMessageLoopRun");
981 parts_->PostMainMessageLoopRun(); 981 parts_->PostMainMessageLoopRun();
982 } 982 }
983 983
984 #if defined(USE_AURA) 984 #if defined(USE_AURA)
985 aura::Env::DeleteInstance(); 985 env_.reset();
986 #endif 986 #endif
987 987
988 system_stats_monitor_.reset(); 988 system_stats_monitor_.reset();
989 989
990 // Destroying the GpuProcessHostUIShims on the UI thread posts a task to 990 // Destroying the GpuProcessHostUIShims on the UI thread posts a task to
991 // delete related objects on the GPU thread. This must be done before 991 // delete related objects on the GPU thread. This must be done before
992 // stopping the GPU thread. The GPU thread will close IPC channels to renderer 992 // stopping the GPU thread. The GPU thread will close IPC channels to renderer
993 // processes so this has to happen before stopping the IO thread. 993 // processes so this has to happen before stopping the IO thread.
994 { 994 {
995 TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:GPUProcessHostShim"); 995 TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:GPUProcessHostShim");
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
1359 ui::ChooseVisualForWindow(NULL, &depth); 1359 ui::ChooseVisualForWindow(NULL, &depth);
1360 DCHECK(depth > 0); 1360 DCHECK(depth > 0);
1361 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( 1361 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
1362 switches::kWindowDepth, base::IntToString(depth)); 1362 switches::kWindowDepth, base::IntToString(depth));
1363 #endif 1363 #endif
1364 1364
1365 #endif 1365 #endif
1366 1366
1367 // Env creates the compositor. Aura widgets need the compositor to be created 1367 // Env creates the compositor. Aura widgets need the compositor to be created
1368 // before they can be initialized by the browser. 1368 // before they can be initialized by the browser.
1369 aura::Env::CreateInstance(true); 1369 env_ = aura::Env::CreateInstance();
1370 #endif // defined(USE_AURA) 1370 #endif // defined(USE_AURA)
1371 1371
1372 if (parts_) 1372 if (parts_)
1373 parts_->ToolkitInitialized(); 1373 parts_->ToolkitInitialized();
1374 1374
1375 return true; 1375 return true;
1376 } 1376 }
1377 1377
1378 void BrowserMainLoop::MainMessageLoopRun() { 1378 void BrowserMainLoop::MainMessageLoopRun() {
1379 #if defined(OS_ANDROID) 1379 #if defined(OS_ANDROID)
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
1451 DCHECK(is_tracing_startup_for_duration_); 1451 DCHECK(is_tracing_startup_for_duration_);
1452 1452
1453 is_tracing_startup_for_duration_ = false; 1453 is_tracing_startup_for_duration_ = false;
1454 TracingController::GetInstance()->StopTracing( 1454 TracingController::GetInstance()->StopTracing(
1455 TracingController::CreateFileSink( 1455 TracingController::CreateFileSink(
1456 startup_trace_file_, 1456 startup_trace_file_,
1457 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); 1457 base::Bind(OnStoppedStartupTracing, startup_trace_file_)));
1458 } 1458 }
1459 1459
1460 } // namespace content 1460 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/browser_main_loop.h ('k') | content/public/test/unittest_test_suite.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698