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

Side by Side Diff: content/renderer/render_frame_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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_frame_impl.h" 5 #include "content/renderer/render_frame_impl.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 1488 matching lines...) Expand 10 before | Expand all | Expand 10 after
1499 return false; 1499 return false;
1500 1500
1501 // TODO(kenrb): document() should not be null, but as a transitional step 1501 // TODO(kenrb): document() should not be null, but as a transitional step
1502 // we have RenderFrameProxy 'wrapping' a RenderFrameImpl, passing messages 1502 // we have RenderFrameProxy 'wrapping' a RenderFrameImpl, passing messages
1503 // to this method. This happens for a top-level remote frame, where a 1503 // to this method. This happens for a top-level remote frame, where a
1504 // document-less RenderFrame is replaced by a RenderFrameProxy but kept 1504 // document-less RenderFrame is replaced by a RenderFrameProxy but kept
1505 // around and is still able to receive messages. 1505 // around and is still able to receive messages.
1506 if (!frame_->document().isNull()) 1506 if (!frame_->document().isNull())
1507 GetContentClient()->SetActiveURL(frame_->document().url()); 1507 GetContentClient()->SetActiveURL(frame_->document().url());
1508 1508
1509 base::ObserverListBase<RenderFrameObserver>::Iterator it(&observers_); 1509 for (auto& observer : observers_) {
1510 RenderFrameObserver* observer; 1510 if (observer.OnMessageReceived(msg))
1511 while ((observer = it.GetNext()) != NULL) {
1512 if (observer->OnMessageReceived(msg))
1513 return true; 1511 return true;
1514 } 1512 }
1515 1513
1516 bool handled = true; 1514 bool handled = true;
1517 IPC_BEGIN_MESSAGE_MAP(RenderFrameImpl, msg) 1515 IPC_BEGIN_MESSAGE_MAP(RenderFrameImpl, msg)
1518 IPC_MESSAGE_HANDLER(FrameMsg_Navigate, OnNavigate) 1516 IPC_MESSAGE_HANDLER(FrameMsg_Navigate, OnNavigate)
1519 IPC_MESSAGE_HANDLER(FrameMsg_BeforeUnload, OnBeforeUnload) 1517 IPC_MESSAGE_HANDLER(FrameMsg_BeforeUnload, OnBeforeUnload)
1520 IPC_MESSAGE_HANDLER(FrameMsg_SwapOut, OnSwapOut) 1518 IPC_MESSAGE_HANDLER(FrameMsg_SwapOut, OnSwapOut)
1521 IPC_MESSAGE_HANDLER(FrameMsg_Delete, OnDeleteFrame) 1519 IPC_MESSAGE_HANDLER(FrameMsg_Delete, OnDeleteFrame)
1522 IPC_MESSAGE_HANDLER(FrameMsg_Stop, OnStop) 1520 IPC_MESSAGE_HANDLER(FrameMsg_Stop, OnStop)
(...skipping 5017 matching lines...) Expand 10 before | Expand all | Expand 10 after
6540 // event target. Potentially a Pepper plugin will receive the event. 6538 // event target. Potentially a Pepper plugin will receive the event.
6541 // In order to tell whether a plugin gets the last mouse event and which it 6539 // In order to tell whether a plugin gets the last mouse event and which it
6542 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6540 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6543 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6541 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6544 // |pepper_last_mouse_event_target_|. 6542 // |pepper_last_mouse_event_target_|.
6545 pepper_last_mouse_event_target_ = nullptr; 6543 pepper_last_mouse_event_target_ = nullptr;
6546 #endif 6544 #endif
6547 } 6545 }
6548 6546
6549 } // namespace content 6547 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698