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

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

Issue 112203003: Fix renderer crashes when frame gets detached while injectng user scripts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added render view browser tests that perform synchronous frame removal on loading finished. Created 6 years, 11 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_view_impl.h" 5 #include "content/renderer/render_view_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 3768 matching lines...) Expand 10 before | Expand all | Expand 10 after
3779 WebDataSource* ds = frame->dataSource(); 3779 WebDataSource* ds = frame->dataSource();
3780 DocumentState* document_state = DocumentState::FromDataSource(ds); 3780 DocumentState* document_state = DocumentState::FromDataSource(ds);
3781 document_state->set_finish_document_load_time(Time::Now()); 3781 document_state->set_finish_document_load_time(Time::Now());
3782 3782
3783 Send(new ViewHostMsg_DocumentLoadedInFrame(routing_id_, frame->identifier())); 3783 Send(new ViewHostMsg_DocumentLoadedInFrame(routing_id_, frame->identifier()));
3784 3784
3785 FOR_EACH_OBSERVER(RenderViewObserver, observers_, 3785 FOR_EACH_OBSERVER(RenderViewObserver, observers_,
3786 DidFinishDocumentLoad(frame)); 3786 DidFinishDocumentLoad(frame));
3787 3787
3788 // Check whether we have new encoding name. 3788 // Check whether we have new encoding name.
3789 UpdateEncoding(frame, frame->view()->pageEncoding().utf8()); 3789 if (frame->view())
3790 UpdateEncoding(frame, frame->view()->pageEncoding().utf8());
3790 } 3791 }
3791 3792
3792 void RenderViewImpl::didHandleOnloadEvents(WebFrame* frame) { 3793 void RenderViewImpl::didHandleOnloadEvents(WebFrame* frame) {
3793 if (webview()->mainFrame() == frame) { 3794 if (webview()->mainFrame() == frame) {
3794 Send(new ViewHostMsg_DocumentOnLoadCompletedInMainFrame(routing_id_, 3795 Send(new ViewHostMsg_DocumentOnLoadCompletedInMainFrame(routing_id_,
3795 page_id_)); 3796 page_id_));
3796 } 3797 }
3797 } 3798 }
3798 3799
3799 void RenderViewImpl::didFailLoad(WebFrame* frame, const WebURLError& error) { 3800 void RenderViewImpl::didFailLoad(WebFrame* frame, const WebURLError& error) {
(...skipping 2637 matching lines...) Expand 10 before | Expand all | Expand 10 after
6437 for (size_t i = 0; i < icon_urls.size(); i++) { 6438 for (size_t i = 0; i < icon_urls.size(); i++) {
6438 WebURL url = icon_urls[i].iconURL(); 6439 WebURL url = icon_urls[i].iconURL();
6439 if (!url.isEmpty()) 6440 if (!url.isEmpty())
6440 urls.push_back(FaviconURL(url, 6441 urls.push_back(FaviconURL(url,
6441 ToFaviconType(icon_urls[i].iconType()))); 6442 ToFaviconType(icon_urls[i].iconType())));
6442 } 6443 }
6443 SendUpdateFaviconURL(urls); 6444 SendUpdateFaviconURL(urls);
6444 } 6445 }
6445 6446
6446 } // namespace content 6447 } // namespace content
OLDNEW
« content/renderer/render_view_browsertest.cc ('K') | « content/renderer/render_view_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698