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

Side by Side Diff: third_party/WebKit/Source/core/loader/resource/ImageResource.cpp

Issue 2610083002: Fix response header correspondence in multipart image
Patch Set: 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/loader/resource/ImageResourceTest.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) 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 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 DCHECK(m_isSchedulingReload); 446 DCHECK(m_isSchedulingReload);
447 m_isSchedulingReload = false; 447 m_isSchedulingReload = false;
448 448
449 fetcher->startLoad(this); 449 fetcher->startLoad(this);
450 } 450 }
451 451
452 void ImageResource::onePartInMultipartReceived( 452 void ImageResource::onePartInMultipartReceived(
453 const ResourceResponse& response) { 453 const ResourceResponse& response) {
454 DCHECK(m_multipartParser); 454 DCHECK(m_multipartParser);
455 455
456 setResponse(response);
457 if (m_multipartParsingState == MultipartParsingState::WaitingForFirstPart) { 456 if (m_multipartParsingState == MultipartParsingState::WaitingForFirstPart) {
458 // We have nothing to do because we don't have any data. 457 // We have nothing to do because we don't have any data.
458 setResponse(response);
459 m_multipartParsingState = MultipartParsingState::ParsingFirstPart; 459 m_multipartParsingState = MultipartParsingState::ParsingFirstPart;
460 return; 460 return;
461 } 461 }
462 updateImageAndClearBuffer(); 462 updateImageAndClearBuffer();
463 setResponse(response);
463 464
464 if (m_multipartParsingState == MultipartParsingState::ParsingFirstPart) { 465 if (m_multipartParsingState == MultipartParsingState::ParsingFirstPart) {
465 m_multipartParsingState = MultipartParsingState::FinishedParsingFirstPart; 466 m_multipartParsingState = MultipartParsingState::FinishedParsingFirstPart;
466 // Notify finished when the first part ends. 467 // Notify finished when the first part ends.
467 if (!errorOccurred()) 468 if (!errorOccurred())
468 setStatus(Cached); 469 setStatus(Cached);
469 // We notify clients and observers of finish in checkNotify() and 470 // We notify clients and observers of finish in checkNotify() and
470 // updateImageAndClearBuffer(), respectively, and they will not be 471 // updateImageAndClearBuffer(), respectively, and they will not be
471 // notified again in Resource::finish()/error(). 472 // notified again in Resource::finish()/error().
472 checkNotify(); 473 checkNotify();
(...skipping 29 matching lines...) Expand all
502 503
503 const ImageResourceContent* ImageResource::getContent() const { 504 const ImageResourceContent* ImageResource::getContent() const {
504 return m_content; 505 return m_content;
505 } 506 }
506 507
507 ResourcePriority ImageResource::priorityFromObservers() { 508 ResourcePriority ImageResource::priorityFromObservers() {
508 return getContent()->priorityFromObservers(); 509 return getContent()->priorityFromObservers();
509 } 510 }
510 511
511 } // namespace blink 512 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698