| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |