OLD | NEW |
1 /* | 1 /* |
2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) | 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) |
3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) | 3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) |
4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) | 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) |
5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) | 5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) |
6 Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. | 6 Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. |
7 | 7 |
8 This library is free software; you can redistribute it and/or | 8 This library is free software; you can redistribute it and/or |
9 modify it under the terms of the GNU Library General Public | 9 modify it under the terms of the GNU Library General Public |
10 License as published by the Free Software Foundation; either | 10 License as published by the Free Software Foundation; either |
(...skipping 29 matching lines...) Expand all Loading... |
40 #include "wtf/StdLibExtras.h" | 40 #include "wtf/StdLibExtras.h" |
41 | 41 |
42 namespace blink { | 42 namespace blink { |
43 | 43 |
44 PassRefPtrWillBeRawPtr<ImageResource> ImageResource::fetch(FetchRequest& request
, ResourceFetcher* fetcher) | 44 PassRefPtrWillBeRawPtr<ImageResource> ImageResource::fetch(FetchRequest& request
, ResourceFetcher* fetcher) |
45 { | 45 { |
46 if (request.resourceRequest().requestContext() == WebURLRequest::RequestCont
extUnspecified) | 46 if (request.resourceRequest().requestContext() == WebURLRequest::RequestCont
extUnspecified) |
47 request.mutableResourceRequest().setRequestContext(WebURLRequest::Reques
tContextImage); | 47 request.mutableResourceRequest().setRequestContext(WebURLRequest::Reques
tContextImage); |
48 if (fetcher->context().pageDismissalEventBeingDispatched()) { | 48 if (fetcher->context().pageDismissalEventBeingDispatched()) { |
49 KURL requestURL = request.resourceRequest().url(); | 49 KURL requestURL = request.resourceRequest().url(); |
50 if (requestURL.isValid() && fetcher->context().canRequest(Resource::Imag
e, request.resourceRequest(), requestURL, request.options(), request.forPreload(
), request.originRestriction())) | 50 if (requestURL.isValid() && fetcher->context().canRequest(Resource::Imag
e, request.resourceRequest(), requestURL, request.options(), request.forPreload(
), request.getOriginRestriction())) |
51 fetcher->context().sendImagePing(requestURL); | 51 fetcher->context().sendImagePing(requestURL); |
52 return nullptr; | 52 return nullptr; |
53 } | 53 } |
54 | 54 |
55 if (fetcher->clientDefersImage(request.resourceRequest().url())) | 55 if (fetcher->clientDefersImage(request.resourceRequest().url())) |
56 request.setDefer(FetchRequest::DeferredByClient); | 56 request.setDefer(FetchRequest::DeferredByClient); |
57 | 57 |
58 return toImageResource(fetcher->requestResource(request, ImageResourceFactor
y())); | 58 return toImageResource(fetcher->requestResource(request, ImageResourceFactor
y())); |
59 } | 59 } |
60 | 60 |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 // queried for info (like size or specific image frames). | 314 // queried for info (like size or specific image frames). |
315 if (m_image) | 315 if (m_image) |
316 sizeAvailable = m_image->setData(m_data, allDataReceived); | 316 sizeAvailable = m_image->setData(m_data, allDataReceived); |
317 | 317 |
318 // Go ahead and tell our observers to try to draw if we have either | 318 // Go ahead and tell our observers to try to draw if we have either |
319 // received all the data or the size is known. Each chunk from the | 319 // received all the data or the size is known. Each chunk from the |
320 // network causes observers to repaint, which will force that chunk | 320 // network causes observers to repaint, which will force that chunk |
321 // to decode. | 321 // to decode. |
322 if (sizeAvailable || allDataReceived) { | 322 if (sizeAvailable || allDataReceived) { |
323 if (!m_image || m_image->isNull()) { | 323 if (!m_image || m_image->isNull()) { |
324 error(errorOccurred() ? status() : DecodeError); | 324 error(errorOccurred() ? getStatus() : DecodeError); |
325 if (memoryCache()->contains(this)) | 325 if (memoryCache()->contains(this)) |
326 memoryCache()->remove(this); | 326 memoryCache()->remove(this); |
327 return; | 327 return; |
328 } | 328 } |
329 | 329 |
330 // It would be nice to only redraw the decoded band of the image, but wi
th the current design | 330 // It would be nice to only redraw the decoded band of the image, but wi
th the current design |
331 // (decoding delayed until painting) that seems hard. | 331 // (decoding delayed until painting) that seems hard. |
332 notifyObservers(); | 332 notifyObservers(); |
333 } | 333 } |
334 } | 334 } |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
464 return true; | 464 return true; |
465 return !securityOrigin->taintsCanvas(response().url()); | 465 return !securityOrigin->taintsCanvas(response().url()); |
466 } | 466 } |
467 | 467 |
468 bool ImageResource::loadingMultipartContent() const | 468 bool ImageResource::loadingMultipartContent() const |
469 { | 469 { |
470 return m_loader && m_loader->loadingMultipartContent(); | 470 return m_loader && m_loader->loadingMultipartContent(); |
471 } | 471 } |
472 | 472 |
473 } // namespace blink | 473 } // namespace blink |
OLD | NEW |