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

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

Issue 2422923002: Reduce usage of FOR_EACH_OBSERVER macro in content/browser (Closed)
Patch Set: skip cases in 2418143004 and 2418373002 Created 4 years, 2 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
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_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
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
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
OLDNEW
« no previous file with comments | « content/browser/appcache/appcache_service_impl.cc ('k') | content/browser/compositor/gpu_process_transport_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698