| OLD | NEW |
| 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 Loading... |
| 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 | 1481 |
| 1482 // to this method. This happens for a top-level remote frame, where a | 1482 GetContentClient()->SetActiveURL(frame_->document().url()); |
| 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()); | |
| 1487 | 1483 |
| 1488 for (auto& observer : observers_) { | 1484 for (auto& observer : observers_) { |
| 1489 if (observer.OnMessageReceived(msg)) | 1485 if (observer.OnMessageReceived(msg)) |
| 1490 return true; | 1486 return true; |
| 1491 } | 1487 } |
| 1492 | 1488 |
| 1493 bool handled = true; | 1489 bool handled = true; |
| 1494 IPC_BEGIN_MESSAGE_MAP(RenderFrameImpl, msg) | 1490 IPC_BEGIN_MESSAGE_MAP(RenderFrameImpl, msg) |
| 1495 IPC_MESSAGE_HANDLER(FrameMsg_Navigate, OnNavigate) | 1491 IPC_MESSAGE_HANDLER(FrameMsg_Navigate, OnNavigate) |
| 1496 IPC_MESSAGE_HANDLER(FrameMsg_BeforeUnload, OnBeforeUnload) | 1492 IPC_MESSAGE_HANDLER(FrameMsg_BeforeUnload, OnBeforeUnload) |
| (...skipping 5174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6671 // event target. Potentially a Pepper plugin will receive the event. | 6667 // 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 | 6668 // 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 | 6669 // 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 | 6670 // the event, it will notify us via DidReceiveMouseEvent() and set itself as |
| 6675 // |pepper_last_mouse_event_target_|. | 6671 // |pepper_last_mouse_event_target_|. |
| 6676 pepper_last_mouse_event_target_ = nullptr; | 6672 pepper_last_mouse_event_target_ = nullptr; |
| 6677 #endif | 6673 #endif |
| 6678 } | 6674 } |
| 6679 | 6675 |
| 6680 } // namespace content | 6676 } // namespace content |
| OLD | NEW |