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

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

Issue 1823863002: Simplify parsing/loading state, attempt #2 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes 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) 2011 Google Inc. All Rights Reserved. 2 * Copyright (C) 2011 Google 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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 return; 123 return;
124 if (m_data) 124 if (m_data)
125 client->dataReceived(this, m_data->data(), m_data->size()); 125 client->dataReceived(this, m_data->data(), m_data->size());
126 if (!hasClient(c)) 126 if (!hasClient(c))
127 return; 127 return;
128 Resource::didAddClient(client); 128 Resource::didAddClient(client);
129 } 129 }
130 130
131 void RawResource::willFollowRedirect(ResourceRequest& newRequest, const Resource Response& redirectResponse) 131 void RawResource::willFollowRedirect(ResourceRequest& newRequest, const Resource Response& redirectResponse)
132 { 132 {
133 Resource::willFollowRedirect(newRequest, redirectResponse);
134
133 RefPtrWillBeRawPtr<RawResource> protect(this); 135 RefPtrWillBeRawPtr<RawResource> protect(this);
134 ASSERT(!redirectResponse.isNull()); 136 ASSERT(!redirectResponse.isNull());
135 ResourceClientWalker<RawResourceClient> w(m_clients); 137 ResourceClientWalker<RawResourceClient> w(m_clients);
136 while (RawResourceClient* c = w.next()) 138 while (RawResourceClient* c = w.next())
137 c->redirectReceived(this, newRequest, redirectResponse); 139 c->redirectReceived(this, newRequest, redirectResponse);
138 Resource::willFollowRedirect(newRequest, redirectResponse);
139 } 140 }
140 141
141 void RawResource::responseReceived(const ResourceResponse& response, PassOwnPtr< WebDataConsumerHandle> handle) 142 void RawResource::responseReceived(const ResourceResponse& response, PassOwnPtr< WebDataConsumerHandle> handle)
142 { 143 {
143 RefPtrWillBeRawPtr<RawResource> protect(this); 144 RefPtrWillBeRawPtr<RawResource> protect(this);
144 145
145 bool isSuccessfulRevalidation = isCacheValidator() && response.httpStatusCod e() == 304; 146 bool isSuccessfulRevalidation = isCacheValidator() && response.httpStatusCod e() == 304;
146 Resource::responseReceived(response, nullptr); 147 Resource::responseReceived(response, nullptr);
147 148
148 ResourceClientWalker<RawResourceClient> w(m_clients); 149 ResourceClientWalker<RawResourceClient> w(m_clients);
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 for (const auto& header : oldHeaders) { 259 for (const auto& header : oldHeaders) {
259 AtomicString headerName = header.key; 260 AtomicString headerName = header.key;
260 if (!shouldIgnoreHeaderForCacheReuse(headerName) && header.value != newH eaders.get(headerName)) 261 if (!shouldIgnoreHeaderForCacheReuse(headerName) && header.value != newH eaders.get(headerName))
261 return false; 262 return false;
262 } 263 }
263 264
264 return true; 265 return true;
265 } 266 }
266 267
267 } // namespace blink 268 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698