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

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

Issue 185993008: Moving DidFinishLoad from RenderView to RenderFrame. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix for failing SitePerProcessNavigation test. Created 6 years, 9 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 | Annotate | Revision Log
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 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 1538 matching lines...) Expand 10 before | Expand all | Expand 10 after
1549 &error_description); 1549 &error_description);
1550 Send(new FrameHostMsg_DidFailLoadWithError(routing_id_, 1550 Send(new FrameHostMsg_DidFailLoadWithError(routing_id_,
1551 failed_request.url(), 1551 failed_request.url(),
1552 !frame->parent(), 1552 !frame->parent(),
1553 error.reason, 1553 error.reason,
1554 error_description)); 1554 error_description));
1555 } 1555 }
1556 1556
1557 void RenderFrameImpl::didFinishLoad(blink::WebFrame* frame) { 1557 void RenderFrameImpl::didFinishLoad(blink::WebFrame* frame) {
1558 DCHECK(!frame_ || frame_ == frame); 1558 DCHECK(!frame_ || frame_ == frame);
1559 // TODO(nasko): Move implementation here. No state needed, just observers 1559 WebDataSource* ds = frame->dataSource();
1560 // notification before sending message to the browser process. 1560 DocumentState* document_state = DocumentState::FromDataSource(ds);
1561 if (document_state->finish_load_time().is_null()) {
1562 if (!frame->parent()) {
1563 TRACE_EVENT_INSTANT0("WebCore", "LoadFinished",
1564 TRACE_EVENT_SCOPE_PROCESS);
1565 }
1566 document_state->set_finish_load_time(Time::Now());
1567 }
1568
1561 render_view_->didFinishLoad(frame); 1569 render_view_->didFinishLoad(frame);
1562 FOR_EACH_OBSERVER(RenderFrameObserver, observers_, 1570 FOR_EACH_OBSERVER(RenderFrameObserver, observers_, DidFinishLoad());
1563 DidFinishLoad()); 1571
1572 // Don't send this message while the frame is swapped out.
1573 if (is_swapped_out())
1574 return;
1575
1576 Send(new FrameHostMsg_DidFinishLoad(routing_id_,
1577 ds->request().url(),
Charlie Reis 2014/03/05 18:50:26 nit: 1 more space indent.
nasko 2014/03/05 19:00:46 Done.
1578 !frame->parent()));
1564 } 1579 }
1565 1580
1566 void RenderFrameImpl::didNavigateWithinPage(blink::WebFrame* frame, 1581 void RenderFrameImpl::didNavigateWithinPage(blink::WebFrame* frame,
1567 bool is_new_navigation) { 1582 bool is_new_navigation) {
1568 DCHECK(!frame_ || frame_ == frame); 1583 DCHECK(!frame_ || frame_ == frame);
1569 // If this was a reference fragment navigation that we initiated, then we 1584 // If this was a reference fragment navigation that we initiated, then we
1570 // could end up having a non-null pending navigation params. We just need to 1585 // could end up having a non-null pending navigation params. We just need to
1571 // update the ExtraData on the datasource so that others who read the 1586 // update the ExtraData on the datasource so that others who read the
1572 // ExtraData will get the new NavigationState. Similarly, if we did not 1587 // ExtraData will get the new NavigationState. Similarly, if we did not
1573 // initiate this navigation, then we need to take care to reset any pre- 1588 // initiate this navigation, then we need to take care to reset any pre-
(...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after
2276 2291
2277 void RenderFrameImpl::didStartLoading() { 2292 void RenderFrameImpl::didStartLoading() {
2278 Send(new FrameHostMsg_DidStartLoading(routing_id_)); 2293 Send(new FrameHostMsg_DidStartLoading(routing_id_));
2279 } 2294 }
2280 2295
2281 void RenderFrameImpl::didStopLoading() { 2296 void RenderFrameImpl::didStopLoading() {
2282 Send(new FrameHostMsg_DidStopLoading(routing_id_)); 2297 Send(new FrameHostMsg_DidStopLoading(routing_id_));
2283 } 2298 }
2284 2299
2285 } // namespace content 2300 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698