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 3140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3151 if (!webview()) | 3151 if (!webview()) |
3152 return; | 3152 return; |
3153 | 3153 |
3154 WebFrame* main_frame = webview()->mainFrame(); | 3154 WebFrame* main_frame = webview()->mainFrame(); |
3155 | 3155 |
3156 // If we have a provisional frame we are between the start and commit stages | 3156 // If we have a provisional frame we are between the start and commit stages |
3157 // of loading and we don't want to save stats. | 3157 // of loading and we don't want to save stats. |
3158 if (!main_frame->provisionalDataSource()) { | 3158 if (!main_frame->provisionalDataSource()) { |
3159 WebDataSource* ds = main_frame->dataSource(); | 3159 WebDataSource* ds = main_frame->dataSource(); |
3160 DocumentState* document_state = DocumentState::FromDataSource(ds); | 3160 DocumentState* document_state = DocumentState::FromDataSource(ds); |
3161 InternalDocumentStateData* data = | |
3162 InternalDocumentStateData::FromDocumentState(document_state); | |
3163 if (data->did_first_visually_non_empty_layout() && | |
3164 !data->did_first_visually_non_empty_paint()) { | |
3165 data->set_did_first_visually_non_empty_paint(true); | |
3166 Send(new ViewHostMsg_DidFirstVisuallyNonEmptyPaint(routing_id_)); | |
3167 } | |
3168 | 3161 |
3169 // TODO(jar): The following code should all be inside a method, probably in | 3162 // TODO(jar): The following code should all be inside a method, probably in |
3170 // NavigatorState. | 3163 // NavigatorState. |
3171 Time now = Time::Now(); | 3164 Time now = Time::Now(); |
3172 if (document_state->first_paint_time().is_null()) { | 3165 if (document_state->first_paint_time().is_null()) { |
3173 document_state->set_first_paint_time(now); | 3166 document_state->set_first_paint_time(now); |
3174 } | 3167 } |
3175 if (document_state->first_paint_after_load_time().is_null() && | 3168 if (document_state->first_paint_after_load_time().is_null() && |
3176 !document_state->finish_load_time().is_null()) { | 3169 !document_state->finish_load_time().is_null()) { |
3177 document_state->set_first_paint_after_load_time(now); | 3170 document_state->set_first_paint_after_load_time(now); |
(...skipping 885 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4063 std::vector<gfx::Size> sizes; | 4056 std::vector<gfx::Size> sizes; |
4064 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); | 4057 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); |
4065 if (!url.isEmpty()) | 4058 if (!url.isEmpty()) |
4066 urls.push_back( | 4059 urls.push_back( |
4067 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); | 4060 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); |
4068 } | 4061 } |
4069 SendUpdateFaviconURL(urls); | 4062 SendUpdateFaviconURL(urls); |
4070 } | 4063 } |
4071 | 4064 |
4072 } // namespace content | 4065 } // namespace content |
OLD | NEW |