| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 UseCounter::count(document, UseCounter::LinkRelPrerender); | 65 UseCounter::count(document, UseCounter::LinkRelPrerender); |
| 66 } | 66 } |
| 67 if (relAttribute.isLinkNext()) { | 67 if (relAttribute.isLinkNext()) { |
| 68 result |= PrerenderRelTypeNext; | 68 result |= PrerenderRelTypeNext; |
| 69 UseCounter::count(document, UseCounter::LinkRelNext); | 69 UseCounter::count(document, UseCounter::LinkRelNext); |
| 70 } | 70 } |
| 71 | 71 |
| 72 return result; | 72 return result; |
| 73 } | 73 } |
| 74 | 74 |
| 75 LinkLoader::LinkLoader(LinkLoaderClient* client) | 75 LinkLoader::LinkLoader(LinkLoaderClient* client, |
| 76 RefPtr<WebTaskRunner> taskRunner) |
| 76 : m_client(client), | 77 : m_client(client), |
| 77 m_linkLoadTimer(this, &LinkLoader::linkLoadTimerFired), | 78 m_linkLoadTimer(taskRunner, this, &LinkLoader::linkLoadTimerFired), |
| 78 m_linkLoadingErrorTimer(this, &LinkLoader::linkLoadingErrorTimerFired) { | 79 m_linkLoadingErrorTimer(taskRunner, |
| 80 this, |
| 81 &LinkLoader::linkLoadingErrorTimerFired) { |
| 79 DCHECK(m_client); | 82 DCHECK(m_client); |
| 80 } | 83 } |
| 81 | 84 |
| 82 LinkLoader::~LinkLoader() {} | 85 LinkLoader::~LinkLoader() {} |
| 83 | 86 |
| 84 void LinkLoader::linkLoadTimerFired(TimerBase* timer) { | 87 void LinkLoader::linkLoadTimerFired(TimerBase* timer) { |
| 85 DCHECK_EQ(timer, &m_linkLoadTimer); | 88 DCHECK_EQ(timer, &m_linkLoadTimer); |
| 86 m_client->linkLoaded(); | 89 m_client->linkLoaded(); |
| 87 } | 90 } |
| 88 | 91 |
| (...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 486 | 489 |
| 487 DEFINE_TRACE(LinkLoader) { | 490 DEFINE_TRACE(LinkLoader) { |
| 488 visitor->trace(m_client); | 491 visitor->trace(m_client); |
| 489 visitor->trace(m_prerender); | 492 visitor->trace(m_prerender); |
| 490 visitor->trace(m_linkPreloadResourceClient); | 493 visitor->trace(m_linkPreloadResourceClient); |
| 491 ResourceOwner<Resource, ResourceClient>::trace(visitor); | 494 ResourceOwner<Resource, ResourceClient>::trace(visitor); |
| 492 PrerenderClient::trace(visitor); | 495 PrerenderClient::trace(visitor); |
| 493 } | 496 } |
| 494 | 497 |
| 495 } // namespace blink | 498 } // namespace blink |
| OLD | NEW |