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

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

Issue 2551803002: FontResource: introduce some CHECKs for setRevalidatingRequest (Closed)
Patch Set: Created 4 years 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 | no next file » | 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) 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 if (m_loadLimitState == ShortLimitExceeded || 98 if (m_loadLimitState == ShortLimitExceeded ||
99 m_loadLimitState == LongLimitExceeded) 99 m_loadLimitState == LongLimitExceeded)
100 static_cast<FontResourceClient*>(c)->fontLoadShortLimitExceeded(this); 100 static_cast<FontResourceClient*>(c)->fontLoadShortLimitExceeded(this);
101 if (m_loadLimitState == LongLimitExceeded) 101 if (m_loadLimitState == LongLimitExceeded)
102 static_cast<FontResourceClient*>(c)->fontLoadLongLimitExceeded(this); 102 static_cast<FontResourceClient*>(c)->fontLoadLongLimitExceeded(this);
103 } 103 }
104 104
105 void FontResource::setRevalidatingRequest(const ResourceRequest& request) { 105 void FontResource::setRevalidatingRequest(const ResourceRequest& request) {
106 // Reload will use the same object, and needs to reset |m_loadLimitState| 106 // Reload will use the same object, and needs to reset |m_loadLimitState|
107 // before any didAddClient() is called again. 107 // before any didAddClient() is called again.
108 // TODO(toyoshim): Change following CHECKs to DCHECKs once we confirm these do
109 // not fire.
110 CHECK(isLoaded());
111 CHECK(!m_fontLoadShortLimitTimer.isActive());
112 CHECK(!m_fontLoadLongLimitTimer.isActive());
108 m_loadLimitState = LoadNotStarted; 113 m_loadLimitState = LoadNotStarted;
109 Resource::setRevalidatingRequest(request); 114 Resource::setRevalidatingRequest(request);
110 } 115 }
111 116
112 void FontResource::startLoadLimitTimers() { 117 void FontResource::startLoadLimitTimers() {
113 DCHECK(isLoading()); 118 DCHECK(isLoading());
114 DCHECK_EQ(m_loadLimitState, LoadNotStarted); 119 DCHECK_EQ(m_loadLimitState, LoadNotStarted);
115 m_loadLimitState = UnderLimit; 120 m_loadLimitState = UnderLimit;
116 m_fontLoadShortLimitTimer.startOneShot(fontLoadWaitShortLimitSec, 121 m_fontLoadShortLimitTimer.startOneShot(fontLoadWaitShortLimitSec,
117 BLINK_FROM_HERE); 122 BLINK_FROM_HERE);
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 Resource::onMemoryDump(level, memoryDump); 197 Resource::onMemoryDump(level, memoryDump);
193 if (!m_fontData) 198 if (!m_fontData)
194 return; 199 return;
195 const String name = getMemoryDumpName() + "/decoded_webfont"; 200 const String name = getMemoryDumpName() + "/decoded_webfont";
196 WebMemoryAllocatorDump* dump = memoryDump->createMemoryAllocatorDump(name); 201 WebMemoryAllocatorDump* dump = memoryDump->createMemoryAllocatorDump(name);
197 dump->addScalar("size", "bytes", m_fontData->dataSize()); 202 dump->addScalar("size", "bytes", m_fontData->dataSize());
198 memoryDump->addSuballocation(dump->guid(), "malloc"); 203 memoryDump->addSuballocation(dump->guid(), "malloc");
199 } 204 }
200 205
201 } // namespace blink 206 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698