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

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

Issue 1738553002: [ABANDONED] Move multipart/x-mixed-replace related code to ImageResource (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@multipart-cleanup-2
Patch Set: Created 4 years, 10 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, 2010, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2010, 2011 Apple Inc. All rights reserved.
3 * (C) 2007 Graham Dennis (graham.dennis@gmail.com) 3 * (C) 2007 Graham Dennis (graham.dennis@gmail.com)
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 return m_options.corsEnabled == IsCORSEnabled; 314 return m_options.corsEnabled == IsCORSEnabled;
315 } 315 }
316 316
317 void ResourceLoader::didReceiveResponse(WebURLLoader*, const WebURLResponse& res ponse, WebDataConsumerHandle* rawHandle) 317 void ResourceLoader::didReceiveResponse(WebURLLoader*, const WebURLResponse& res ponse, WebDataConsumerHandle* rawHandle)
318 { 318 {
319 ASSERT(!response.isNull()); 319 ASSERT(!response.isNull());
320 ASSERT(m_state == Initialized); 320 ASSERT(m_state == Initialized);
321 // |rawHandle|'s ownership is transferred to the callee. 321 // |rawHandle|'s ownership is transferred to the callee.
322 OwnPtr<WebDataConsumerHandle> handle = adoptPtr(rawHandle); 322 OwnPtr<WebDataConsumerHandle> handle = adoptPtr(rawHandle);
323 323
324 bool isMultipartPayload = response.isMultipartPayload();
325 bool isValidStateTransition = (m_connectionState == ConnectionStateStarted | | m_connectionState == ConnectionStateReceivedResponse); 324 bool isValidStateTransition = (m_connectionState == ConnectionStateStarted | | m_connectionState == ConnectionStateReceivedResponse);
326 // In the case of multipart loads, calls to didReceiveData & didReceiveRespo nse can be interleaved. 325 RELEASE_ASSERT(isValidStateTransition);
327 RELEASE_ASSERT(isMultipartPayload || isValidStateTransition);
328 m_connectionState = ConnectionStateReceivedResponse; 326 m_connectionState = ConnectionStateReceivedResponse;
329 327
330 const ResourceResponse& resourceResponse = response.toResourceResponse(); 328 const ResourceResponse& resourceResponse = response.toResourceResponse();
331 329
332 if (responseNeedsAccessControlCheck()) { 330 if (responseNeedsAccessControlCheck()) {
333 if (response.wasFetchedViaServiceWorker()) { 331 if (response.wasFetchedViaServiceWorker()) {
334 if (response.wasFallbackRequiredByServiceWorker()) { 332 if (response.wasFallbackRequiredByServiceWorker()) {
335 m_loader->cancel(); 333 m_loader->cancel();
336 m_loader.clear(); 334 m_loader.clear();
337 m_connectionState = ConnectionStateStarted; 335 m_connectionState = ConnectionStateStarted;
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 didFinishLoading(0, monotonicallyIncreasingTime(), encodedDataLength); 501 didFinishLoading(0, monotonicallyIncreasingTime(), encodedDataLength);
504 } 502 }
505 503
506 ResourceRequest& ResourceLoader::applyOptions(ResourceRequest& request) const 504 ResourceRequest& ResourceLoader::applyOptions(ResourceRequest& request) const
507 { 505 {
508 request.setAllowStoredCredentials(m_options.allowCredentials == AllowStoredC redentials); 506 request.setAllowStoredCredentials(m_options.allowCredentials == AllowStoredC redentials);
509 return request; 507 return request;
510 } 508 }
511 509
512 } // namespace blink 510 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698