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

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: Rebase again 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 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 visitor->trace(m_cacheHandler); 254 visitor->trace(m_cacheHandler);
255 } 255 }
256 256
257 void Resource::load(ResourceFetcher* fetcher) 257 void Resource::load(ResourceFetcher* fetcher)
258 { 258 {
259 RELEASE_ASSERT(!m_loader); 259 RELEASE_ASSERT(!m_loader);
260 m_status = Pending; 260 m_status = Pending;
261 261
262 ResourceRequest& request(m_revalidatingRequest.isNull() ? m_resourceRequest : m_revalidatingRequest); 262 ResourceRequest& request(m_revalidatingRequest.isNull() ? m_resourceRequest : m_revalidatingRequest);
263 KURL url = request.url(); 263 KURL url = request.url();
264 if (!accept().isEmpty())
265 request.setHTTPAccept(accept());
266 request.setAllowStoredCredentials(m_options.allowCredentials == AllowStoredC redentials); 264 request.setAllowStoredCredentials(m_options.allowCredentials == AllowStoredC redentials);
267 265
268 m_loader = ResourceLoader::create(fetcher, this); 266 m_loader = ResourceLoader::create(fetcher, this);
269 m_loader->start(request); 267 m_loader->start(request);
270 // If the request reference is null (i.e., a synchronous revalidation will 268 // If the request reference is null (i.e., a synchronous revalidation will
271 // null the request), don't make the request non-null by setting the url. 269 // null the request), don't make the request non-null by setting the url.
272 if (!request.isNull()) 270 if (!request.isNull())
273 request.setURL(url); 271 request.setURL(url);
274 } 272 }
275 273
(...skipping 801 matching lines...) Expand 10 before | Expand all | Expand 10 after
1077 case Resource::Media: 1075 case Resource::Media:
1078 return "Media"; 1076 return "Media";
1079 case Resource::Manifest: 1077 case Resource::Manifest:
1080 return "Manifest"; 1078 return "Manifest";
1081 } 1079 }
1082 ASSERT_NOT_REACHED(); 1080 ASSERT_NOT_REACHED();
1083 return "Unknown"; 1081 return "Unknown";
1084 } 1082 }
1085 1083
1086 } // namespace blink 1084 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/fetch/Resource.h ('k') | third_party/WebKit/Source/core/fetch/ScriptResource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698