| 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_child_process_host_impl.h" | 5 #include "content/browser/browser_child_process_host_impl.h" |
| 6 | 6 |
| 7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/debug/dump_without_crashing.h" | 10 #include "base/debug/dump_without_crashing.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 namespace content { | 54 namespace content { |
| 55 namespace { | 55 namespace { |
| 56 | 56 |
| 57 static base::LazyInstance<BrowserChildProcessHostImpl::BrowserChildProcessList> | 57 static base::LazyInstance<BrowserChildProcessHostImpl::BrowserChildProcessList> |
| 58 g_child_process_list = LAZY_INSTANCE_INITIALIZER; | 58 g_child_process_list = LAZY_INSTANCE_INITIALIZER; |
| 59 | 59 |
| 60 base::LazyInstance<base::ObserverList<BrowserChildProcessObserver>> | 60 base::LazyInstance<base::ObserverList<BrowserChildProcessObserver>> |
| 61 g_observers = LAZY_INSTANCE_INITIALIZER; | 61 g_observers = LAZY_INSTANCE_INITIALIZER; |
| 62 | 62 |
| 63 void NotifyProcessLaunchedAndConnected(const ChildProcessData& data) { | 63 void NotifyProcessLaunchedAndConnected(const ChildProcessData& data) { |
| 64 FOR_EACH_OBSERVER(BrowserChildProcessObserver, g_observers.Get(), | 64 for (auto& observer : g_observers.Get()) |
| 65 BrowserChildProcessLaunchedAndConnected(data)); | 65 observer.BrowserChildProcessLaunchedAndConnected(data); |
| 66 } | 66 } |
| 67 | 67 |
| 68 void NotifyProcessHostConnected(const ChildProcessData& data) { | 68 void NotifyProcessHostConnected(const ChildProcessData& data) { |
| 69 FOR_EACH_OBSERVER(BrowserChildProcessObserver, g_observers.Get(), | 69 for (auto& observer : g_observers.Get()) |
| 70 BrowserChildProcessHostConnected(data)); | 70 observer.BrowserChildProcessHostConnected(data); |
| 71 } | 71 } |
| 72 | 72 |
| 73 void NotifyProcessHostDisconnected(const ChildProcessData& data) { | 73 void NotifyProcessHostDisconnected(const ChildProcessData& data) { |
| 74 FOR_EACH_OBSERVER(BrowserChildProcessObserver, g_observers.Get(), | 74 for (auto& observer : g_observers.Get()) |
| 75 BrowserChildProcessHostDisconnected(data)); | 75 observer.BrowserChildProcessHostDisconnected(data); |
| 76 } | 76 } |
| 77 | 77 |
| 78 void NotifyProcessCrashed(const ChildProcessData& data, int exit_code) { | 78 void NotifyProcessCrashed(const ChildProcessData& data, int exit_code) { |
| 79 FOR_EACH_OBSERVER(BrowserChildProcessObserver, g_observers.Get(), | 79 for (auto& observer : g_observers.Get()) |
| 80 BrowserChildProcessCrashed(data, exit_code)); | 80 observer.BrowserChildProcessCrashed(data, exit_code); |
| 81 } | 81 } |
| 82 | 82 |
| 83 void NotifyProcessKilled(const ChildProcessData& data, int exit_code) { | 83 void NotifyProcessKilled(const ChildProcessData& data, int exit_code) { |
| 84 FOR_EACH_OBSERVER(BrowserChildProcessObserver, g_observers.Get(), | 84 for (auto& observer : g_observers.Get()) |
| 85 BrowserChildProcessKilled(data, exit_code)); | 85 observer.BrowserChildProcessKilled(data, exit_code); |
| 86 } | 86 } |
| 87 | 87 |
| 88 } // namespace | 88 } // namespace |
| 89 | 89 |
| 90 BrowserChildProcessHost* BrowserChildProcessHost::Create( | 90 BrowserChildProcessHost* BrowserChildProcessHost::Create( |
| 91 content::ProcessType process_type, | 91 content::ProcessType process_type, |
| 92 BrowserChildProcessHostDelegate* delegate) { | 92 BrowserChildProcessHostDelegate* delegate) { |
| 93 return Create(process_type, delegate, std::string()); | 93 return Create(process_type, delegate, std::string()); |
| 94 } | 94 } |
| 95 | 95 |
| (...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 598 | 598 |
| 599 #if defined(OS_WIN) | 599 #if defined(OS_WIN) |
| 600 | 600 |
| 601 void BrowserChildProcessHostImpl::OnObjectSignaled(HANDLE object) { | 601 void BrowserChildProcessHostImpl::OnObjectSignaled(HANDLE object) { |
| 602 OnChildDisconnected(); | 602 OnChildDisconnected(); |
| 603 } | 603 } |
| 604 | 604 |
| 605 #endif | 605 #endif |
| 606 | 606 |
| 607 } // namespace content | 607 } // namespace content |
| OLD | NEW |