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

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

Issue 2649853003: Make Resource::setResponse() private
Patch Set: Rebase Created 3 years, 11 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
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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 if (!isDetached()) 161 if (!isDetached())
162 document()->imageUpdated(); 162 document()->imageUpdated();
163 } 163 }
164 164
165 void ImageDocumentParser::finish() { 165 void ImageDocumentParser::finish() {
166 if (!isStopped() && document()->imageElement() && 166 if (!isStopped() && document()->imageElement() &&
167 document()->cachedImageResourceDeprecated()) { 167 document()->cachedImageResourceDeprecated()) {
168 // TODO(hiroshige): Use ImageResourceContent instead of ImageResource. 168 // TODO(hiroshige): Use ImageResourceContent instead of ImageResource.
169 ImageResource* cachedImage = document()->cachedImageResourceDeprecated(); 169 ImageResource* cachedImage = document()->cachedImageResourceDeprecated();
170 DocumentLoader* loader = document()->loader(); 170 DocumentLoader* loader = document()->loader();
171 cachedImage->setResponse(loader->response()); 171 cachedImage->responseReceived(loader->response(), nullptr);
172 cachedImage->finish(loader->timing().responseEnd()); 172 cachedImage->finish(loader->timing().responseEnd());
173 173
174 // Report the natural image size in the page title, regardless of zoom 174 // Report the natural image size in the page title, regardless of zoom
175 // level. At a zoom level of 1 the image is guaranteed to have an integer 175 // level. At a zoom level of 1 the image is guaranteed to have an integer
176 // size. 176 // size.
177 IntSize size = flooredIntSize(cachedImageSize(document()->imageElement())); 177 IntSize size = flooredIntSize(cachedImageSize(document()->imageElement()));
178 if (size.width()) { 178 if (size.width()) {
179 // Compute the title, we use the decoded filename of the resource, falling 179 // Compute the title, we use the decoded filename of the resource, falling
180 // back on the (decoded) hostname if there is no path. 180 // back on the (decoded) hostname if there is no path.
181 String fileName = 181 String fileName =
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
625 } 625 }
626 626
627 bool ImageEventListener::operator==(const EventListener& listener) const { 627 bool ImageEventListener::operator==(const EventListener& listener) const {
628 if (const ImageEventListener* imageEventListener = 628 if (const ImageEventListener* imageEventListener =
629 ImageEventListener::cast(&listener)) 629 ImageEventListener::cast(&listener))
630 return m_doc == imageEventListener->m_doc; 630 return m_doc == imageEventListener->m_doc;
631 return false; 631 return false;
632 } 632 }
633 633
634 } // namespace blink 634 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698