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

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

Issue 1418003006: Simplify starting a navigation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: enum-ify Created 5 years, 1 month 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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 { 127 {
128 ResourcePtr<RawResource> protect(this); 128 ResourcePtr<RawResource> protect(this);
129 if (!redirectResponse.isNull()) { 129 if (!redirectResponse.isNull()) {
130 ResourceClientWalker<RawResourceClient> w(m_clients); 130 ResourceClientWalker<RawResourceClient> w(m_clients);
131 while (RawResourceClient* c = w.next()) 131 while (RawResourceClient* c = w.next())
132 c->redirectReceived(this, newRequest, redirectResponse); 132 c->redirectReceived(this, newRequest, redirectResponse);
133 } 133 }
134 Resource::willFollowRedirect(newRequest, redirectResponse); 134 Resource::willFollowRedirect(newRequest, redirectResponse);
135 } 135 }
136 136
137 void RawResource::updateRequest(const ResourceRequest& request)
138 {
139 ResourcePtr<RawResource> protect(this);
140 ResourceClientWalker<RawResourceClient> w(m_clients);
141 while (RawResourceClient* c = w.next())
142 c->updateRequest(this, request);
143 }
144
145 void RawResource::responseReceived(const ResourceResponse& response, PassOwnPtr< WebDataConsumerHandle> handle) 137 void RawResource::responseReceived(const ResourceResponse& response, PassOwnPtr< WebDataConsumerHandle> handle)
146 { 138 {
147 InternalResourcePtr protect(this); 139 InternalResourcePtr protect(this);
148 140
149 bool isSuccessfulRevalidation = isCacheValidator() && response.httpStatusCod e() == 304; 141 bool isSuccessfulRevalidation = isCacheValidator() && response.httpStatusCod e() == 304;
150 Resource::responseReceived(response, nullptr); 142 Resource::responseReceived(response, nullptr);
151 143
152 ResourceClientWalker<RawResourceClient> w(m_clients); 144 ResourceClientWalker<RawResourceClient> w(m_clients);
153 ASSERT(count() <= 1 || !handle); 145 ASSERT(count() <= 1 || !handle);
154 while (RawResourceClient* c = w.next()) { 146 while (RawResourceClient* c = w.next()) {
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 for (const auto& header : oldHeaders) { 252 for (const auto& header : oldHeaders) {
261 AtomicString headerName = header.key; 253 AtomicString headerName = header.key;
262 if (!shouldIgnoreHeaderForCacheReuse(headerName) && header.value != newH eaders.get(headerName)) 254 if (!shouldIgnoreHeaderForCacheReuse(headerName) && header.value != newH eaders.get(headerName))
263 return false; 255 return false;
264 } 256 }
265 257
266 return true; 258 return true;
267 } 259 }
268 260
269 } // namespace blink 261 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/fetch/RawResource.h ('k') | third_party/WebKit/Source/core/fetch/Resource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698