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

Side by Side Diff: third_party/WebKit/Source/core/loader/resource/FontResource.cpp

Issue 2741753003: Remove mutableResourceRequest() by FetchRequest::setRequestContext() (Closed)
Patch Set: fix Created 3 years, 9 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) 2006, 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2009 Torch Mobile, Inc. 3 * Copyright (C) 2009 Torch Mobile, Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 DEFINE_THREAD_SAFE_STATIC_LOCAL( 70 DEFINE_THREAD_SAFE_STATIC_LOCAL(
71 EnumerationHistogram, packageFormatHistogram, 71 EnumerationHistogram, packageFormatHistogram,
72 new EnumerationHistogram("WebFont.PackageFormat", PackageFormatEnumMax)); 72 new EnumerationHistogram("WebFont.PackageFormat", PackageFormatEnumMax));
73 packageFormatHistogram.count(format); 73 packageFormatHistogram.count(format);
74 } 74 }
75 75
76 FontResource* FontResource::fetch(FetchRequest& request, 76 FontResource* FontResource::fetch(FetchRequest& request,
77 ResourceFetcher* fetcher) { 77 ResourceFetcher* fetcher) {
78 DCHECK_EQ(request.resourceRequest().frameType(), 78 DCHECK_EQ(request.resourceRequest().frameType(),
79 WebURLRequest::FrameTypeNone); 79 WebURLRequest::FrameTypeNone);
80 request.mutableResourceRequest().setRequestContext( 80 request.setRequestContext(WebURLRequest::RequestContextFont);
81 WebURLRequest::RequestContextFont);
82 return toFontResource( 81 return toFontResource(
83 fetcher->requestResource(request, FontResourceFactory())); 82 fetcher->requestResource(request, FontResourceFactory()));
84 } 83 }
85 84
86 FontResource::FontResource(const ResourceRequest& resourceRequest, 85 FontResource::FontResource(const ResourceRequest& resourceRequest,
87 const ResourceLoaderOptions& options) 86 const ResourceLoaderOptions& options)
88 : Resource(resourceRequest, Font, options), 87 : Resource(resourceRequest, Font, options),
89 m_loadLimitState(LoadNotStarted), 88 m_loadLimitState(LoadNotStarted),
90 m_corsFailed(false), 89 m_corsFailed(false),
91 m_fontLoadShortLimitTimer(this, 90 m_fontLoadShortLimitTimer(this,
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 Resource::onMemoryDump(level, memoryDump); 226 Resource::onMemoryDump(level, memoryDump);
228 if (!m_fontData) 227 if (!m_fontData)
229 return; 228 return;
230 const String name = getMemoryDumpName() + "/decoded_webfont"; 229 const String name = getMemoryDumpName() + "/decoded_webfont";
231 WebMemoryAllocatorDump* dump = memoryDump->createMemoryAllocatorDump(name); 230 WebMemoryAllocatorDump* dump = memoryDump->createMemoryAllocatorDump(name);
232 dump->addScalar("size", "bytes", m_fontData->dataSize()); 231 dump->addScalar("size", "bytes", m_fontData->dataSize());
233 memoryDump->addSuballocation(dump->guid(), "malloc"); 232 memoryDump->addSuballocation(dump->guid(), "malloc");
234 } 233 }
235 234
236 } // namespace blink 235 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698