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

Side by Side Diff: third_party/WebKit/Source/core/html/ImageDocument.cpp

Issue 1380163006: setLoadFinishTime on ImageResource for ImageDocument. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Unit test Created 5 years, 2 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 // TODO(esprehn): These null checks on Document don't make sense, document() 149 // TODO(esprehn): These null checks on Document don't make sense, document()
150 // will ASSERT if it was null. Do these want to check isDetached() ? 150 // will ASSERT if it was null. Do these want to check isDetached() ?
151 if (document()) 151 if (document())
152 document()->imageUpdated(); 152 document()->imageUpdated();
153 } 153 }
154 154
155 void ImageDocumentParser::finish() 155 void ImageDocumentParser::finish()
156 { 156 {
157 if (!isStopped() && document()->imageElement() && document()->cachedImage()) { 157 if (!isStopped() && document()->imageElement() && document()->cachedImage()) {
158 ImageResource* cachedImage = document()->cachedImage(); 158 ImageResource* cachedImage = document()->cachedImage();
159 DocumentLoader* loader = document()->loader();
160 cachedImage->setResponse(loader->response());
rune 2015/10/04 18:02:57 Moved setResponse() before finish() because that's
161 cachedImage->setLoadFinishTime(loader->timing().responseEnd());
159 cachedImage->finish(); 162 cachedImage->finish();
160 cachedImage->setResponse(document()->frame()->loader().documentLoader()- >response());
161 163
162 // Report the natural image size in the page title, regardless of zoom l evel. 164 // Report the natural image size in the page title, regardless of zoom l evel.
163 // At a zoom level of 1 the image is guaranteed to have an integer size. 165 // At a zoom level of 1 the image is guaranteed to have an integer size.
164 IntSize size = flooredIntSize(cachedImage->imageSizeForLayoutObject(docu ment()->imageElement()->layoutObject(), 1.0f)); 166 IntSize size = flooredIntSize(cachedImage->imageSizeForLayoutObject(docu ment()->imageElement()->layoutObject(), 1.0f));
165 if (size.width()) { 167 if (size.width()) {
166 // Compute the title, we use the decoded filename of the resource, f alling 168 // Compute the title, we use the decoded filename of the resource, f alling
167 // back on the (decoded) hostname if there is no path. 169 // back on the (decoded) hostname if there is no path.
168 String fileName = decodeURLEscapeSequences(document()->url().lastPat hComponent()); 170 String fileName = decodeURLEscapeSequences(document()->url().lastPat hComponent());
169 if (fileName.isEmpty()) 171 if (fileName.isEmpty())
170 fileName = document()->url().host(); 172 fileName = document()->url().host();
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 } 454 }
453 455
454 bool ImageEventListener::operator==(const EventListener& listener) 456 bool ImageEventListener::operator==(const EventListener& listener)
455 { 457 {
456 if (const ImageEventListener* imageEventListener = ImageEventListener::cast( &listener)) 458 if (const ImageEventListener* imageEventListener = ImageEventListener::cast( &listener))
457 return m_doc == imageEventListener->m_doc; 459 return m_doc == imageEventListener->m_doc;
458 return false; 460 return false;
459 } 461 }
460 462
461 } 463 }
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698