| OLD | NEW |
| 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 3072 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3083 Send(new ViewHostMsg_DocumentOnLoadCompletedInMainFrame(routing_id_, | 3083 Send(new ViewHostMsg_DocumentOnLoadCompletedInMainFrame(routing_id_, |
| 3084 page_id_)); | 3084 page_id_)); |
| 3085 } | 3085 } |
| 3086 } | 3086 } |
| 3087 | 3087 |
| 3088 void RenderViewImpl::didFailLoad(WebFrame* frame, const WebURLError& error) { | 3088 void RenderViewImpl::didFailLoad(WebFrame* frame, const WebURLError& error) { |
| 3089 FOR_EACH_OBSERVER(RenderViewObserver, observers_, DidFailLoad(frame, error)); | 3089 FOR_EACH_OBSERVER(RenderViewObserver, observers_, DidFailLoad(frame, error)); |
| 3090 } | 3090 } |
| 3091 | 3091 |
| 3092 void RenderViewImpl::didFinishLoad(WebFrame* frame) { | 3092 void RenderViewImpl::didFinishLoad(WebFrame* frame) { |
| 3093 WebDataSource* ds = frame->dataSource(); | |
| 3094 DocumentState* document_state = DocumentState::FromDataSource(ds); | |
| 3095 if (document_state->finish_load_time().is_null()) { | |
| 3096 if (!frame->parent()) { | |
| 3097 TRACE_EVENT_INSTANT0("WebCore", "LoadFinished", | |
| 3098 TRACE_EVENT_SCOPE_PROCESS); | |
| 3099 } | |
| 3100 document_state->set_finish_load_time(Time::Now()); | |
| 3101 } | |
| 3102 | |
| 3103 FOR_EACH_OBSERVER(RenderViewObserver, observers_, DidFinishLoad(frame)); | 3093 FOR_EACH_OBSERVER(RenderViewObserver, observers_, DidFinishLoad(frame)); |
| 3104 | |
| 3105 // Don't send this message while the subframe is swapped out. | |
| 3106 // TODO(creis): This whole method should move to RenderFrame. | |
| 3107 RenderFrameImpl* rf = RenderFrameImpl::FromWebFrame(frame); | |
| 3108 if (rf && rf->is_swapped_out()) | |
| 3109 return; | |
| 3110 | |
| 3111 Send(new ViewHostMsg_DidFinishLoad(routing_id_, | |
| 3112 rf->GetRoutingID(), | |
| 3113 ds->request().url(), | |
| 3114 !frame->parent())); | |
| 3115 } | 3094 } |
| 3116 | 3095 |
| 3117 void RenderViewImpl::didNavigateWithinPage( | 3096 void RenderViewImpl::didNavigateWithinPage( |
| 3118 WebFrame* frame, | 3097 WebFrame* frame, |
| 3119 bool is_new_navigation) { | 3098 bool is_new_navigation) { |
| 3120 // TODO(nasko): Forward calls to the main RenderFrameImpl until all | 3099 // TODO(nasko): Forward calls to the main RenderFrameImpl until all |
| 3121 // callers of this method on RenderView are removed. | 3100 // callers of this method on RenderView are removed. |
| 3122 main_render_frame_->didNavigateWithinPage(frame, is_new_navigation); | 3101 main_render_frame_->didNavigateWithinPage(frame, is_new_navigation); |
| 3123 } | 3102 } |
| 3124 | 3103 |
| (...skipping 2387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5512 for (size_t i = 0; i < icon_urls.size(); i++) { | 5491 for (size_t i = 0; i < icon_urls.size(); i++) { |
| 5513 WebURL url = icon_urls[i].iconURL(); | 5492 WebURL url = icon_urls[i].iconURL(); |
| 5514 if (!url.isEmpty()) | 5493 if (!url.isEmpty()) |
| 5515 urls.push_back(FaviconURL(url, | 5494 urls.push_back(FaviconURL(url, |
| 5516 ToFaviconType(icon_urls[i].iconType()))); | 5495 ToFaviconType(icon_urls[i].iconType()))); |
| 5517 } | 5496 } |
| 5518 SendUpdateFaviconURL(urls); | 5497 SendUpdateFaviconURL(urls); |
| 5519 } | 5498 } |
| 5520 | 5499 |
| 5521 } // namespace content | 5500 } // namespace content |
| OLD | NEW |