| OLD | NEW |
| 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_process_sub_thread.h" | 5 #include "content/browser/browser_process_sub_thread.h" |
| 6 | 6 |
| 7 #include "base/debug/leak_tracker.h" | 7 #include "base/debug/leak_tracker.h" |
| 8 #include "base/threading/thread_restrictions.h" | 8 #include "base/threading/thread_restrictions.h" |
| 9 #include "base/trace_event/memory_dump_manager.h" | 9 #include "base/trace_event/memory_dump_manager.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| 11 #include "content/browser/browser_child_process_host_impl.h" | 11 #include "content/browser/browser_child_process_host_impl.h" |
| 12 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h" | 12 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h" |
| 13 #include "content/browser/notification_service_impl.h" | 13 #include "content/browser/notification_service_impl.h" |
| 14 #include "content/browser/shared_worker/shared_worker_service_impl.h" |
| 14 #include "net/url_request/url_fetcher.h" | 15 #include "net/url_request/url_fetcher.h" |
| 15 #include "net/url_request/url_request.h" | 16 #include "net/url_request/url_request.h" |
| 16 | 17 |
| 17 #if defined(OS_WIN) | 18 #if defined(OS_WIN) |
| 18 #include "base/win/scoped_com_initializer.h" | 19 #include "base/win/scoped_com_initializer.h" |
| 19 #endif | 20 #endif |
| 20 | 21 |
| 21 namespace content { | 22 namespace content { |
| 22 | 23 |
| 23 BrowserProcessSubThread::BrowserProcessSubThread(BrowserThread::ID identifier) | 24 BrowserProcessSubThread::BrowserProcessSubThread(BrowserThread::ID identifier) |
| (...skipping 29 matching lines...) Expand all Loading... |
| 53 BrowserThreadImpl::CleanUp(); | 54 BrowserThreadImpl::CleanUp(); |
| 54 | 55 |
| 55 notification_service_.reset(); | 56 notification_service_.reset(); |
| 56 | 57 |
| 57 #if defined(OS_WIN) | 58 #if defined(OS_WIN) |
| 58 com_initializer_.reset(); | 59 com_initializer_.reset(); |
| 59 #endif | 60 #endif |
| 60 } | 61 } |
| 61 | 62 |
| 62 void BrowserProcessSubThread::IOThreadPreCleanUp() { | 63 void BrowserProcessSubThread::IOThreadPreCleanUp() { |
| 64 // TODO(alokp): Remove after collecting crash data. |
| 65 // Temporary checks to verify that all shared workers are terminated. |
| 66 // It is suspected that shared workers prevent render process hosts |
| 67 // from shutting down: crbug.com/608049 |
| 68 SharedWorkerServiceImpl::GetInstance()->CheckAllWorkersTerminated(); |
| 69 |
| 63 // Kill all things that might be holding onto | 70 // Kill all things that might be holding onto |
| 64 // net::URLRequest/net::URLRequestContexts. | 71 // net::URLRequest/net::URLRequestContexts. |
| 65 | 72 |
| 66 // Destroy all URLRequests started by URLFetchers. | 73 // Destroy all URLRequests started by URLFetchers. |
| 67 net::URLFetcher::CancelAll(); | 74 net::URLFetcher::CancelAll(); |
| 68 | 75 |
| 69 // If any child processes are still running, terminate them and | 76 // If any child processes are still running, terminate them and |
| 70 // and delete the BrowserChildProcessHost instances to release whatever | 77 // and delete the BrowserChildProcessHost instances to release whatever |
| 71 // IO thread only resources they are referencing. | 78 // IO thread only resources they are referencing. |
| 72 BrowserChildProcessHostImpl::TerminateAll(); | 79 BrowserChildProcessHostImpl::TerminateAll(); |
| 73 | 80 |
| 74 // Unregister GpuMemoryBuffer dump provider before IO thread is shut down. | 81 // Unregister GpuMemoryBuffer dump provider before IO thread is shut down. |
| 75 base::trace_event::MemoryDumpManager::GetInstance()->UnregisterDumpProvider( | 82 base::trace_event::MemoryDumpManager::GetInstance()->UnregisterDumpProvider( |
| 76 BrowserGpuMemoryBufferManager::current()); | 83 BrowserGpuMemoryBufferManager::current()); |
| 77 } | 84 } |
| 78 | 85 |
| 79 } // namespace content | 86 } // namespace content |
| OLD | NEW |