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

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

Issue 2648023002: Use TaskRunnerTimer in LinkLoader (Closed)
Patch Set: Created 3 years, 11 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) 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
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/loader/LinkLoader.h ('k') | third_party/WebKit/Source/core/loader/LinkLoaderClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698