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

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

Issue 1700233003: [WIP][SVG 2/4] Make data URL handling in ResourceFetcher and WebURLLoaderImpl consistent Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: auto-Rebase 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
« no previous file with comments | « content/child/web_url_loader_impl.cc ('k') | third_party/WebKit/public/platform/Platform.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) 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 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 // TODO(japhet): We only send main resource data: urls through WebURLLoader for the benefit of 267 // TODO(japhet): We only send main resource data: urls through WebURLLoader for the benefit of
268 // a service worker test (RenderViewImplTest.ServiceWorkerNetworkProviderSet up), which is at a 268 // a service worker test (RenderViewImplTest.ServiceWorkerNetworkProviderSet up), which is at a
269 // layer where it isn't easy to mock out a network load. It uses data: urls to emulate the 269 // layer where it isn't easy to mock out a network load. It uses data: urls to emulate the
270 // behavior it wants to test, which would otherwise be reserved for network loads. 270 // behavior it wants to test, which would otherwise be reserved for network loads.
271 if (getType() == MainResource || getType() == Raw) 271 if (getType() == MainResource || getType() == Raw)
272 return false; 272 return false;
273 273
274 WrappedResourceRequest wrappedRequest(request); 274 WrappedResourceRequest wrappedRequest(request);
275 WebString mimetype; 275 WebString mimetype;
276 WebString charset; 276 WebString charset;
277 RefPtr<SharedBuffer> data = PassRefPtr<SharedBuffer>(Platform::current()->pa rseDataURL(request.url(), mimetype, charset)); 277 WebData webData;
278 if (!Platform::current()->parseDataURLIfCanBeHandledLocally(wrappedRequest, mimetype, charset, webData))
279 return false;
280 RefPtr<SharedBuffer> data = PassRefPtr<SharedBuffer>(webData);
278 if (!data) 281 if (!data)
279 return false; 282 return false;
280 283
281 loadLocallyStaticData(request, options, mimetype, charset, data.release()); 284 loadLocallyStaticData(request, options, mimetype, charset, data.release());
282 return true; 285 return true;
283 } 286 }
284 287
285 void Resource::load(ResourceFetcher* fetcher, const ResourceLoaderOptions& optio ns) 288 void Resource::load(ResourceFetcher* fetcher, const ResourceLoaderOptions& optio ns)
286 { 289 {
287 m_options = options; 290 m_options = options;
(...skipping 908 matching lines...) Expand 10 before | Expand all | Expand 10 after
1196 case Resource::Media: 1199 case Resource::Media:
1197 return "Media"; 1200 return "Media";
1198 case Resource::Manifest: 1201 case Resource::Manifest:
1199 return "Manifest"; 1202 return "Manifest";
1200 } 1203 }
1201 ASSERT_NOT_REACHED(); 1204 ASSERT_NOT_REACHED();
1202 return "Unknown"; 1205 return "Unknown";
1203 } 1206 }
1204 1207
1205 } // namespace blink 1208 } // namespace blink
OLDNEW
« no previous file with comments | « content/child/web_url_loader_impl.cc ('k') | third_party/WebKit/public/platform/Platform.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698