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 3360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3371 if (!webview()) | 3371 if (!webview()) |
3372 return; | 3372 return; |
3373 | 3373 |
3374 WebFrame* main_frame = webview()->mainFrame(); | 3374 WebFrame* main_frame = webview()->mainFrame(); |
3375 | 3375 |
3376 // If we have a provisional frame we are between the start and commit stages | 3376 // If we have a provisional frame we are between the start and commit stages |
3377 // of loading and we don't want to save stats. | 3377 // of loading and we don't want to save stats. |
3378 if (!main_frame->provisionalDataSource()) { | 3378 if (!main_frame->provisionalDataSource()) { |
3379 WebDataSource* ds = main_frame->dataSource(); | 3379 WebDataSource* ds = main_frame->dataSource(); |
3380 DocumentState* document_state = DocumentState::FromDataSource(ds); | 3380 DocumentState* document_state = DocumentState::FromDataSource(ds); |
3381 InternalDocumentStateData* data = | |
3382 InternalDocumentStateData::FromDocumentState(document_state); | |
3383 if (data->did_first_visually_non_empty_layout() && | |
3384 !data->did_first_visually_non_empty_paint()) { | |
3385 data->set_did_first_visually_non_empty_paint(true); | |
3386 Send(new ViewHostMsg_DidFirstVisuallyNonEmptyPaint(routing_id_, | |
3387 page_id_)); | |
3388 } | |
3389 | 3381 |
3390 // TODO(jar): The following code should all be inside a method, probably in | 3382 // TODO(jar): The following code should all be inside a method, probably in |
3391 // NavigatorState. | 3383 // NavigatorState. |
3392 Time now = Time::Now(); | 3384 Time now = Time::Now(); |
3393 if (document_state->first_paint_time().is_null()) { | 3385 if (document_state->first_paint_time().is_null()) { |
3394 document_state->set_first_paint_time(now); | 3386 document_state->set_first_paint_time(now); |
3395 } | 3387 } |
3396 if (document_state->first_paint_after_load_time().is_null() && | 3388 if (document_state->first_paint_after_load_time().is_null() && |
3397 !document_state->finish_load_time().is_null()) { | 3389 !document_state->finish_load_time().is_null()) { |
3398 document_state->set_first_paint_after_load_time(now); | 3390 document_state->set_first_paint_after_load_time(now); |
(...skipping 965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4364 std::vector<gfx::Size> sizes; | 4356 std::vector<gfx::Size> sizes; |
4365 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); | 4357 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); |
4366 if (!url.isEmpty()) | 4358 if (!url.isEmpty()) |
4367 urls.push_back( | 4359 urls.push_back( |
4368 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); | 4360 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); |
4369 } | 4361 } |
4370 SendUpdateFaviconURL(urls); | 4362 SendUpdateFaviconURL(urls); |
4371 } | 4363 } |
4372 | 4364 |
4373 } // namespace content | 4365 } // namespace content |
OLD | NEW |