| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 5 * Copyright (C) 2003, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights | 5 * Copyright (C) 2003, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights |
| 6 * reserved. | 6 * reserved. |
| 7 * Copyright (C) 2009 Rob Buis (rwlbuis@gmail.com) | 7 * Copyright (C) 2009 Rob Buis (rwlbuis@gmail.com) |
| 8 * Copyright (C) 2011 Google Inc. All rights reserved. | 8 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 9 * | 9 * |
| 10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 return linkStyle()->sheetLoaded(); | 273 return linkStyle()->sheetLoaded(); |
| 274 } | 274 } |
| 275 | 275 |
| 276 void HTMLLinkElement::notifyLoadedSheetAndAllCriticalSubresources( | 276 void HTMLLinkElement::notifyLoadedSheetAndAllCriticalSubresources( |
| 277 LoadedSheetErrorStatus errorStatus) { | 277 LoadedSheetErrorStatus errorStatus) { |
| 278 DCHECK(linkStyle()); | 278 DCHECK(linkStyle()); |
| 279 linkStyle()->notifyLoadedSheetAndAllCriticalSubresources(errorStatus); | 279 linkStyle()->notifyLoadedSheetAndAllCriticalSubresources(errorStatus); |
| 280 } | 280 } |
| 281 | 281 |
| 282 void HTMLLinkElement::dispatchPendingEvent( | 282 void HTMLLinkElement::dispatchPendingEvent( |
| 283 std::unique_ptr<IncrementLoadEventDelayCount>) { | 283 std::unique_ptr<IncrementLoadEventDelayCount> count) { |
| 284 DCHECK(m_link); | 284 DCHECK(m_link); |
| 285 if (m_link->hasLoaded()) | 285 if (m_link->hasLoaded()) |
| 286 linkLoaded(); | 286 linkLoaded(); |
| 287 else | 287 else |
| 288 linkLoadingErrored(); | 288 linkLoadingErrored(); |
| 289 |
| 290 // Checks Document's load event synchronously here for performance. |
| 291 // This is safe because dispatchPendingEvent() is called asynchronously. |
| 292 count->clearAndCheckLoadEvent(); |
| 289 } | 293 } |
| 290 | 294 |
| 291 void HTMLLinkElement::scheduleEvent() { | 295 void HTMLLinkElement::scheduleEvent() { |
| 292 TaskRunnerHelper::get(TaskType::DOMManipulation, &document()) | 296 TaskRunnerHelper::get(TaskType::DOMManipulation, &document()) |
| 293 ->postTask( | 297 ->postTask( |
| 294 BLINK_FROM_HERE, | 298 BLINK_FROM_HERE, |
| 295 WTF::bind( | 299 WTF::bind( |
| 296 &HTMLLinkElement::dispatchPendingEvent, wrapPersistent(this), | 300 &HTMLLinkElement::dispatchPendingEvent, wrapPersistent(this), |
| 297 WTF::passed(IncrementLoadEventDelayCount::create(document())))); | 301 WTF::passed(IncrementLoadEventDelayCount::create(document())))); |
| 298 } | 302 } |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 LinkLoaderClient::trace(visitor); | 365 LinkLoaderClient::trace(visitor); |
| 362 DOMTokenListObserver::trace(visitor); | 366 DOMTokenListObserver::trace(visitor); |
| 363 } | 367 } |
| 364 | 368 |
| 365 DEFINE_TRACE_WRAPPERS(HTMLLinkElement) { | 369 DEFINE_TRACE_WRAPPERS(HTMLLinkElement) { |
| 366 visitor->traceWrappers(m_relList); | 370 visitor->traceWrappers(m_relList); |
| 367 HTMLElement::traceWrappers(visitor); | 371 HTMLElement::traceWrappers(visitor); |
| 368 } | 372 } |
| 369 | 373 |
| 370 } // namespace blink | 374 } // namespace blink |
| OLD | NEW |