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

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

Issue 2260383002: Don't crash after calling frame_->stopLoading(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
« 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 4482 matching lines...) Expand 10 before | Expand all | Expand 10 after
4493 } 4493 }
4494 4494
4495 void RenderFrameImpl::RemoveObserver(RenderFrameObserver* observer) { 4495 void RenderFrameImpl::RemoveObserver(RenderFrameObserver* observer) {
4496 observer->RenderFrameGone(); 4496 observer->RenderFrameGone();
4497 observers_.RemoveObserver(observer); 4497 observers_.RemoveObserver(observer);
4498 } 4498 }
4499 4499
4500 void RenderFrameImpl::OnStop() { 4500 void RenderFrameImpl::OnStop() {
4501 DCHECK(frame_); 4501 DCHECK(frame_);
4502 frame_->stopLoading(); 4502 frame_->stopLoading();
4503 if (!frame_->parent()) 4503 if (frame_ && !frame_->parent())
4504 FOR_EACH_OBSERVER(RenderViewObserver, render_view_->observers_, OnStop()); 4504 FOR_EACH_OBSERVER(RenderViewObserver, render_view_->observers_, OnStop());
4505 4505
4506 FOR_EACH_OBSERVER(RenderFrameObserver, observers_, OnStop()); 4506 FOR_EACH_OBSERVER(RenderFrameObserver, observers_, OnStop());
4507 } 4507 }
4508 4508
4509 void RenderFrameImpl::WasHidden() { 4509 void RenderFrameImpl::WasHidden() {
4510 FOR_EACH_OBSERVER(RenderFrameObserver, observers_, WasHidden()); 4510 FOR_EACH_OBSERVER(RenderFrameObserver, observers_, WasHidden());
4511 4511
4512 #if defined(ENABLE_PLUGINS) 4512 #if defined(ENABLE_PLUGINS)
4513 for (auto* plugin : active_pepper_instances_) 4513 for (auto* plugin : active_pepper_instances_)
(...skipping 1132 matching lines...) Expand 10 before | Expand all | Expand 10 after
5646 return; 5646 return;
5647 } 5647 }
5648 } else { 5648 } else {
5649 // The browser expects the frame to be loading this navigation. Inform it 5649 // The browser expects the frame to be loading this navigation. Inform it
5650 // that the load stopped if needed. 5650 // that the load stopped if needed.
5651 // Note: in the case of history navigations, |should_load_request| will be 5651 // Note: in the case of history navigations, |should_load_request| will be
5652 // false, and the frame may not have been set in a loading state. Do not 5652 // false, and the frame may not have been set in a loading state. Do not
5653 // send a stop message if the HistoryController is loading in this frame 5653 // send a stop message if the HistoryController is loading in this frame
5654 // nonetheless. This behavior will go away with subframe navigation 5654 // nonetheless. This behavior will go away with subframe navigation
5655 // entries. 5655 // entries.
5656 if (!frame_->isLoading() && !has_history_navigation_in_frame) 5656 if (frame_ && !frame_->isLoading() && !has_history_navigation_in_frame)
5657 Send(new FrameHostMsg_DidStopLoading(routing_id_)); 5657 Send(new FrameHostMsg_DidStopLoading(routing_id_));
5658 } 5658 }
5659 5659
5660 // In case LoadRequest failed before didCreateDataSource was called. 5660 // In case LoadRequest failed before didCreateDataSource was called.
5661 pending_navigation_params_.reset(); 5661 pending_navigation_params_.reset();
5662 } 5662 }
5663 5663
5664 void RenderFrameImpl::UpdateEncoding(WebFrame* frame, 5664 void RenderFrameImpl::UpdateEncoding(WebFrame* frame,
5665 const std::string& encoding_name) { 5665 const std::string& encoding_name) {
5666 // Only update main frame's encoding_name. 5666 // Only update main frame's encoding_name.
(...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after
6350 // event target. Potentially a Pepper plugin will receive the event. 6350 // event target. Potentially a Pepper plugin will receive the event.
6351 // In order to tell whether a plugin gets the last mouse event and which it 6351 // In order to tell whether a plugin gets the last mouse event and which it
6352 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6352 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6353 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6353 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6354 // |pepper_last_mouse_event_target_|. 6354 // |pepper_last_mouse_event_target_|.
6355 pepper_last_mouse_event_target_ = nullptr; 6355 pepper_last_mouse_event_target_ = nullptr;
6356 #endif 6356 #endif
6357 } 6357 }
6358 6358
6359 } // namespace content 6359 } // 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