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

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

Issue 2164553002: Refactoring: Hide or remove some methods of Resource (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: (rebase) Created 4 years, 5 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/fetch/Resource.h » ('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) 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 while (RawResourceClient* c = w.next()) 142 while (RawResourceClient* c = w.next())
143 c->redirectBlocked(); 143 c->redirectBlocked();
144 } 144 }
145 145
146 void RawResource::responseReceived(const ResourceResponse& response, std::unique _ptr<WebDataConsumerHandle> handle) 146 void RawResource::responseReceived(const ResourceResponse& response, std::unique _ptr<WebDataConsumerHandle> handle)
147 { 147 {
148 bool isSuccessfulRevalidation = isCacheValidator() && response.httpStatusCod e() == 304; 148 bool isSuccessfulRevalidation = isCacheValidator() && response.httpStatusCod e() == 304;
149 Resource::responseReceived(response, nullptr); 149 Resource::responseReceived(response, nullptr);
150 150
151 ResourceClientWalker<RawResourceClient> w(clients()); 151 ResourceClientWalker<RawResourceClient> w(clients());
152 ASSERT(count() <= 1 || !handle); 152 DCHECK(clients().size() <= 1 || !handle);
153 while (RawResourceClient* c = w.next()) { 153 while (RawResourceClient* c = w.next()) {
154 // |handle| is cleared when passed, but it's not a problem because 154 // |handle| is cleared when passed, but it's not a problem because
155 // |handle| is null when there are two or more clients, as asserted. 155 // |handle| is null when there are two or more clients, as asserted.
156 c->responseReceived(this, m_response, std::move(handle)); 156 c->responseReceived(this, m_response, std::move(handle));
157 } 157 }
158 158
159 // If we successfully revalidated, we won't get appendData() calls. 159 // If we successfully revalidated, we won't get appendData() calls.
160 // Forward the data to clients now instead. 160 // Forward the data to clients now instead.
161 // Note: |m_data| can be null when no data is appended to the original 161 // Note: |m_data| can be null when no data is appended to the original
162 // resource. 162 // resource.
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 for (const auto& header : oldHeaders) { 258 for (const auto& header : oldHeaders) {
259 AtomicString headerName = header.key; 259 AtomicString headerName = header.key;
260 if (!shouldIgnoreHeaderForCacheReuse(headerName) && header.value != newH eaders.get(headerName)) 260 if (!shouldIgnoreHeaderForCacheReuse(headerName) && header.value != newH eaders.get(headerName))
261 return false; 261 return false;
262 } 262 }
263 263
264 return true; 264 return true;
265 } 265 }
266 266
267 } // namespace blink 267 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/fetch/Resource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698