| 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 3069 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3080 if (!webview()) | 3080 if (!webview()) |
| 3081 return; | 3081 return; |
| 3082 | 3082 |
| 3083 WebFrame* main_frame = webview()->mainFrame(); | 3083 WebFrame* main_frame = webview()->mainFrame(); |
| 3084 | 3084 |
| 3085 // If we have a provisional frame we are between the start and commit stages | 3085 // If we have a provisional frame we are between the start and commit stages |
| 3086 // of loading and we don't want to save stats. | 3086 // of loading and we don't want to save stats. |
| 3087 if (!main_frame->provisionalDataSource()) { | 3087 if (!main_frame->provisionalDataSource()) { |
| 3088 WebDataSource* ds = main_frame->dataSource(); | 3088 WebDataSource* ds = main_frame->dataSource(); |
| 3089 DocumentState* document_state = DocumentState::FromDataSource(ds); | 3089 DocumentState* document_state = DocumentState::FromDataSource(ds); |
| 3090 InternalDocumentStateData* data = | |
| 3091 InternalDocumentStateData::FromDocumentState(document_state); | |
| 3092 if (data->did_first_visually_non_empty_layout() && | |
| 3093 !data->did_first_visually_non_empty_paint()) { | |
| 3094 data->set_did_first_visually_non_empty_paint(true); | |
| 3095 Send(new ViewHostMsg_DidFirstVisuallyNonEmptyPaint(routing_id_)); | |
| 3096 } | |
| 3097 | 3090 |
| 3098 // TODO(jar): The following code should all be inside a method, probably in | 3091 // TODO(jar): The following code should all be inside a method, probably in |
| 3099 // NavigatorState. | 3092 // NavigatorState. |
| 3100 Time now = Time::Now(); | 3093 Time now = Time::Now(); |
| 3101 if (document_state->first_paint_time().is_null()) { | 3094 if (document_state->first_paint_time().is_null()) { |
| 3102 document_state->set_first_paint_time(now); | 3095 document_state->set_first_paint_time(now); |
| 3103 } | 3096 } |
| 3104 if (document_state->first_paint_after_load_time().is_null() && | 3097 if (document_state->first_paint_after_load_time().is_null() && |
| 3105 !document_state->finish_load_time().is_null()) { | 3098 !document_state->finish_load_time().is_null()) { |
| 3106 document_state->set_first_paint_after_load_time(now); | 3099 document_state->set_first_paint_after_load_time(now); |
| (...skipping 916 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4023 std::vector<gfx::Size> sizes; | 4016 std::vector<gfx::Size> sizes; |
| 4024 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); | 4017 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); |
| 4025 if (!url.isEmpty()) | 4018 if (!url.isEmpty()) |
| 4026 urls.push_back( | 4019 urls.push_back( |
| 4027 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); | 4020 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); |
| 4028 } | 4021 } |
| 4029 SendUpdateFaviconURL(urls); | 4022 SendUpdateFaviconURL(urls); |
| 4030 } | 4023 } |
| 4031 | 4024 |
| 4032 } // namespace content | 4025 } // namespace content |
| OLD | NEW |