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

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

Issue 1839473002: Centralize the setting of Accept headers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Drop unused variables in test Created 4 years, 8 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 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 visitor->trace(m_cacheHandler); 265 visitor->trace(m_cacheHandler);
266 #endif 266 #endif
267 } 267 }
268 268
269 void Resource::load(ResourceFetcher* fetcher) 269 void Resource::load(ResourceFetcher* fetcher)
270 { 270 {
271 RELEASE_ASSERT(!m_loader); 271 RELEASE_ASSERT(!m_loader);
272 m_status = Pending; 272 m_status = Pending;
273 273
274 ResourceRequest& request(m_revalidatingRequest.isNull() ? m_resourceRequest : m_revalidatingRequest); 274 ResourceRequest& request(m_revalidatingRequest.isNull() ? m_resourceRequest : m_revalidatingRequest);
275 if (!accept().isEmpty())
276 request.setHTTPAccept(accept());
277 request.setAllowStoredCredentials(m_options.allowCredentials == AllowStoredC redentials); 275 request.setAllowStoredCredentials(m_options.allowCredentials == AllowStoredC redentials);
278 276
279 // FIXME: It's unfortunate that the cache layer and below get to know anythi ng about fragment identifiers. 277 // FIXME: It's unfortunate that the cache layer and below get to know anythi ng about fragment identifiers.
280 // We should look into removing the expectation of that knowledge from the p latform network stacks. 278 // We should look into removing the expectation of that knowledge from the p latform network stacks.
281 KURL urlWithoutFragment = request.url(); 279 KURL urlWithoutFragment = request.url();
282 if (!m_fragmentIdentifierForRequest.isNull()) { 280 if (!m_fragmentIdentifierForRequest.isNull()) {
283 KURL url = request.url(); 281 KURL url = request.url();
284 url.setFragmentIdentifier(m_fragmentIdentifierForRequest); 282 url.setFragmentIdentifier(m_fragmentIdentifierForRequest);
285 request.setURL(url); 283 request.setURL(url);
286 m_fragmentIdentifierForRequest = String(); 284 m_fragmentIdentifierForRequest = String();
(...skipping 813 matching lines...) Expand 10 before | Expand all | Expand 10 after
1100 case Resource::Media: 1098 case Resource::Media:
1101 return "Media"; 1099 return "Media";
1102 case Resource::Manifest: 1100 case Resource::Manifest:
1103 return "Manifest"; 1101 return "Manifest";
1104 } 1102 }
1105 ASSERT_NOT_REACHED(); 1103 ASSERT_NOT_REACHED();
1106 return "Unknown"; 1104 return "Unknown";
1107 } 1105 }
1108 1106
1109 } // namespace blink 1107 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698