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

Side by Side Diff: content/renderer/render_thread_impl.cc

Issue 2410283004: Remove usage of base::ObserverList<T>::Iter::GetNext() in //content. (Closed)
Patch Set: 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/renderer/render_thread_impl.h" 5 #include "content/renderer/render_thread_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <map> 9 #include <map>
10 #include <utility> 10 #include <utility>
(...skipping 1704 matching lines...) Expand 10 before | Expand all | Expand 10 after
1715 // In single-process mode, the renderer can't be restarted after shutdown. 1715 // In single-process mode, the renderer can't be restarted after shutdown.
1716 // So, if we get a channel error, crash the whole process right now to get a 1716 // So, if we get a channel error, crash the whole process right now to get a
1717 // more informative stack, since we will otherwise just crash later when we 1717 // more informative stack, since we will otherwise just crash later when we
1718 // try to restart it. 1718 // try to restart it.
1719 CHECK(!base::CommandLine::ForCurrentProcess()->HasSwitch( 1719 CHECK(!base::CommandLine::ForCurrentProcess()->HasSwitch(
1720 switches::kSingleProcess)); 1720 switches::kSingleProcess));
1721 ChildThreadImpl::OnChannelError(); 1721 ChildThreadImpl::OnChannelError();
1722 } 1722 }
1723 1723
1724 bool RenderThreadImpl::OnControlMessageReceived(const IPC::Message& msg) { 1724 bool RenderThreadImpl::OnControlMessageReceived(const IPC::Message& msg) {
1725 base::ObserverListBase<RenderThreadObserver>::Iterator it(&observers_); 1725 for (auto& observer : observers_) {
1726 RenderThreadObserver* observer; 1726 if (observer.OnControlMessageReceived(msg))
1727 while ((observer = it.GetNext()) != nullptr) {
1728 if (observer->OnControlMessageReceived(msg))
1729 return true; 1727 return true;
1730 } 1728 }
1731 1729
1732 // Some messages are handled by delegates. 1730 // Some messages are handled by delegates.
1733 if (appcache_dispatcher_->OnMessageReceived(msg) || 1731 if (appcache_dispatcher_->OnMessageReceived(msg) ||
1734 dom_storage_dispatcher_->OnMessageReceived(msg) || 1732 dom_storage_dispatcher_->OnMessageReceived(msg) ||
1735 embedded_worker_dispatcher_->OnMessageReceived(msg)) { 1733 embedded_worker_dispatcher_->OnMessageReceived(msg)) {
1736 return true; 1734 return true;
1737 } 1735 }
1738 1736
(...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after
2362 } 2360 }
2363 } 2361 }
2364 2362
2365 void RenderThreadImpl::OnRendererInterfaceRequest( 2363 void RenderThreadImpl::OnRendererInterfaceRequest(
2366 mojom::RendererAssociatedRequest request) { 2364 mojom::RendererAssociatedRequest request) {
2367 DCHECK(!renderer_binding_.is_bound()); 2365 DCHECK(!renderer_binding_.is_bound());
2368 renderer_binding_.Bind(std::move(request)); 2366 renderer_binding_.Bind(std::move(request));
2369 } 2367 }
2370 2368
2371 } // namespace content 2369 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698