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

Side by Side Diff: third_party/WebKit/Source/core/dom/ExecutionContext.cpp

Issue 1863793003: Make CSSValuePool thread local to ensure correct parsing in colors on workers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase with master 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) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3 * Copyright (C) 2012 Google Inc. All Rights Reserved. 3 * Copyright (C) 2012 Google Inc. All Rights Reserved.
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 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 UseCounter::count(this, UseCounter::ResetReferrerPolicy); 266 UseCounter::count(this, UseCounter::ResetReferrerPolicy);
267 267
268 m_referrerPolicy = referrerPolicy; 268 m_referrerPolicy = referrerPolicy;
269 } 269 }
270 270
271 void ExecutionContext::removeURLFromMemoryCache(const KURL& url) 271 void ExecutionContext::removeURLFromMemoryCache(const KURL& url)
272 { 272 {
273 memoryCache()->removeURLFromCache(url); 273 memoryCache()->removeURLFromCache(url);
274 } 274 }
275 275
276 CSSValuePool* ExecutionContext::localCssValuePool()
277 {
278 // Local CSS caches are only for worker threads.
279 if (!this->isWorkerGlobalScope())
280 return nullptr;
281
282 // Lazily initialization to avoid unnecessary CSS caches.
283 if (!m_localCssValuePool)
284 m_localCssValuePool = new CSSValuePool();
285 return m_localCssValuePool;
286 }
287
276 DEFINE_TRACE(ExecutionContext) 288 DEFINE_TRACE(ExecutionContext)
277 { 289 {
278 visitor->trace(m_publicURLManager); 290 visitor->trace(m_publicURLManager);
291 visitor->trace(m_localCssValuePool);
279 ContextLifecycleNotifier::trace(visitor); 292 ContextLifecycleNotifier::trace(visitor);
280 Supplementable<ExecutionContext>::trace(visitor); 293 Supplementable<ExecutionContext>::trace(visitor);
281 } 294 }
282 295
283 } // namespace blink 296 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/ExecutionContext.h ('k') | third_party/WebKit/Source/core/editing/EditingStyle.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698