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

Side by Side Diff: third_party/WebKit/Source/core/fetch/Resource.cpp

Issue 1710733002: Move multipart resource handling to core/fetch (2/2) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@multipart-cleanup
Patch Set: rebase Created 4 years, 9 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) 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, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 6 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 297
298 setStatus(status); 298 setStatus(status);
299 ASSERT(errorOccurred()); 299 ASSERT(errorOccurred());
300 m_data.clear(); 300 m_data.clear();
301 301
302 setLoading(false); 302 setLoading(false);
303 checkNotify(); 303 checkNotify();
304 markClientsFinished(); 304 markClientsFinished();
305 } 305 }
306 306
307 void Resource::finishOnePart()
308 {
309 setLoading(false);
310 checkNotify();
311 }
312
313 void Resource::finish() 307 void Resource::finish()
314 { 308 {
315 ASSERT(m_revalidatingRequest.isNull()); 309 ASSERT(m_revalidatingRequest.isNull());
316 ASSERT(!errorOccurred()); 310 setLoading(false);
317 finishOnePart(); 311 checkNotify();
318 markClientsFinished(); 312 markClientsFinished();
319 if (!errorOccurred()) 313 if (!errorOccurred())
320 m_status = Cached; 314 m_status = Cached;
321 } 315 }
322 316
323 AtomicString Resource::httpContentType() const 317 AtomicString Resource::httpContentType() const
324 { 318 {
325 return extractMIMETypeFromMediaType(m_response.httpHeaderField(HTTPNames::Co ntent_Type).lower()); 319 return extractMIMETypeFromMediaType(m_response.httpHeaderField(HTTPNames::Co ntent_Type).lower());
326 } 320 }
327 321
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 { 450 {
457 m_responseTimestamp = currentTime(); 451 m_responseTimestamp = currentTime();
458 452
459 if (!m_revalidatingRequest.isNull()) { 453 if (!m_revalidatingRequest.isNull()) {
460 if (response.httpStatusCode() == 304) { 454 if (response.httpStatusCode() == 304) {
461 revalidationSucceeded(response); 455 revalidationSucceeded(response);
462 return; 456 return;
463 } 457 }
464 revalidationFailed(); 458 revalidationFailed();
465 } 459 }
466
467 setResponse(response); 460 setResponse(response);
468 String encoding = response.textEncodingName(); 461 String encoding = response.textEncodingName();
469 if (!encoding.isNull()) 462 if (!encoding.isNull())
470 setEncoding(encoding); 463 setEncoding(encoding);
471 } 464 }
472 465
473 void Resource::setSerializedCachedMetadata(const char* data, size_t size) 466 void Resource::setSerializedCachedMetadata(const char* data, size_t size)
474 { 467 {
475 // We only expect to receive cached metadata from the platform once. 468 // We only expect to receive cached metadata from the platform once.
476 // If this triggers, it indicates an efficiency problem which is most 469 // If this triggers, it indicates an efficiency problem which is most
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after
1118 case Resource::Media: 1111 case Resource::Media:
1119 return "Media"; 1112 return "Media";
1120 case Resource::Manifest: 1113 case Resource::Manifest:
1121 return "Manifest"; 1114 return "Manifest";
1122 } 1115 }
1123 ASSERT_NOT_REACHED(); 1116 ASSERT_NOT_REACHED();
1124 return "Unknown"; 1117 return "Unknown";
1125 } 1118 }
1126 1119
1127 } // namespace blink 1120 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698