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

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

Issue 2561453002: Remove null Document check from RenderFrameImpl::OnMessageReceived (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1459 matching lines...) Expand 10 before | Expand all | Expand 10 after
1470 return render_view()->OnMessageReceived(msg); 1470 return render_view()->OnMessageReceived(msg);
1471 1471
1472 return false; 1472 return false;
1473 } 1473 }
1474 1474
1475 // We may get here while detaching, when the WebFrame has been deleted. Do 1475 // We may get here while detaching, when the WebFrame has been deleted. Do
1476 // not process any messages in this state. 1476 // not process any messages in this state.
1477 if (!frame_) 1477 if (!frame_)
1478 return false; 1478 return false;
1479 1479
1480 // TODO(kenrb): document() should not be null, but as a transitional step 1480 DCHECK(!frame_->document().isNull());
1481 // we have RenderFrameProxy 'wrapping' a RenderFrameImpl, passing messages
1482 // to this method. This happens for a top-level remote frame, where a
1483 // document-less RenderFrame is replaced by a RenderFrameProxy but kept
1484 // around and is still able to receive messages.
1485 if (!frame_->document().isNull())
1486 GetContentClient()->SetActiveURL(frame_->document().url());
nasko 2016/12/07 00:25:13 We shouldn't be losing the call to SetActiveURL, r
kenrb 2016/12/07 00:33:59 Yes, sloppy error, fixed now.
1487 1481
1488 for (auto& observer : observers_) { 1482 for (auto& observer : observers_) {
1489 if (observer.OnMessageReceived(msg)) 1483 if (observer.OnMessageReceived(msg))
1490 return true; 1484 return true;
1491 } 1485 }
1492 1486
1493 bool handled = true; 1487 bool handled = true;
1494 IPC_BEGIN_MESSAGE_MAP(RenderFrameImpl, msg) 1488 IPC_BEGIN_MESSAGE_MAP(RenderFrameImpl, msg)
1495 IPC_MESSAGE_HANDLER(FrameMsg_Navigate, OnNavigate) 1489 IPC_MESSAGE_HANDLER(FrameMsg_Navigate, OnNavigate)
1496 IPC_MESSAGE_HANDLER(FrameMsg_BeforeUnload, OnBeforeUnload) 1490 IPC_MESSAGE_HANDLER(FrameMsg_BeforeUnload, OnBeforeUnload)
(...skipping 5174 matching lines...) Expand 10 before | Expand all | Expand 10 after
6671 // event target. Potentially a Pepper plugin will receive the event. 6665 // event target. Potentially a Pepper plugin will receive the event.
6672 // In order to tell whether a plugin gets the last mouse event and which it 6666 // In order to tell whether a plugin gets the last mouse event and which it
6673 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6667 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6674 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6668 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6675 // |pepper_last_mouse_event_target_|. 6669 // |pepper_last_mouse_event_target_|.
6676 pepper_last_mouse_event_target_ = nullptr; 6670 pepper_last_mouse_event_target_ = nullptr;
6677 #endif 6671 #endif
6678 } 6672 }
6679 6673
6680 } // namespace content 6674 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698