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

Side by Side Diff: Source/core/fetch/Resource.cpp

Issue 189833009: Trace where timers were scheduled in Blink (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de)
3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) 3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org)
4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org)
5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) 5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
6 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 6 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
7 7
8 This library is free software; you can redistribute it and/or 8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Library General Public 9 modify it under the terms of the GNU Library General Public
10 License as published by the Free Software Foundation; either 10 License as published by the Free Software Foundation; either
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 // This object may be dead here. 518 // This object may be dead here.
519 } 519 }
520 520
521 void Resource::allClientsRemoved() 521 void Resource::allClientsRemoved()
522 { 522 {
523 if (!m_loader) 523 if (!m_loader)
524 return; 524 return;
525 if (m_type == MainResource || m_type == Raw) 525 if (m_type == MainResource || m_type == Raw)
526 cancelTimerFired(&m_cancelTimer); 526 cancelTimerFired(&m_cancelTimer);
527 else if (!m_cancelTimer.isActive()) 527 else if (!m_cancelTimer.isActive())
528 m_cancelTimer.startOneShot(0); 528 m_cancelTimer.startOneShot(0, FROM_HERE);
529 } 529 }
530 530
531 void Resource::cancelTimerFired(Timer<Resource>* timer) 531 void Resource::cancelTimerFired(Timer<Resource>* timer)
532 { 532 {
533 ASSERT_UNUSED(timer, timer == &m_cancelTimer); 533 ASSERT_UNUSED(timer, timer == &m_cancelTimer);
534 if (hasClients() || !m_loader) 534 if (hasClients() || !m_loader)
535 return; 535 return;
536 ResourcePtr<Resource> protect(this); 536 ResourcePtr<Resource> protect(this);
537 m_loader->cancelIfNotFinishing(); 537 m_loader->cancelIfNotFinishing();
538 if (m_status != Cached) 538 if (m_status != Cached)
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
875 } 875 }
876 876
877 Resource::ResourceCallback::ResourceCallback() 877 Resource::ResourceCallback::ResourceCallback()
878 : m_callbackTimer(this, &ResourceCallback::timerFired) 878 : m_callbackTimer(this, &ResourceCallback::timerFired)
879 { 879 {
880 } 880 }
881 881
882 void Resource::ResourceCallback::schedule(Resource* resource) 882 void Resource::ResourceCallback::schedule(Resource* resource)
883 { 883 {
884 if (!m_callbackTimer.isActive()) 884 if (!m_callbackTimer.isActive())
885 m_callbackTimer.startOneShot(0); 885 m_callbackTimer.startOneShot(0, FROM_HERE);
886 m_resourcesWithPendingClients.add(resource); 886 m_resourcesWithPendingClients.add(resource);
887 } 887 }
888 888
889 void Resource::ResourceCallback::cancel(Resource* resource) 889 void Resource::ResourceCallback::cancel(Resource* resource)
890 { 890 {
891 m_resourcesWithPendingClients.remove(resource); 891 m_resourcesWithPendingClients.remove(resource);
892 if (m_callbackTimer.isActive() && m_resourcesWithPendingClients.isEmpty()) 892 if (m_callbackTimer.isActive() && m_resourcesWithPendingClients.isEmpty())
893 m_callbackTimer.stop(); 893 m_callbackTimer.stop();
894 } 894 }
895 895
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
992 return "Shader"; 992 return "Shader";
993 case Resource::ImportResource: 993 case Resource::ImportResource:
994 return "ImportResource"; 994 return "ImportResource";
995 } 995 }
996 ASSERT_NOT_REACHED(); 996 ASSERT_NOT_REACHED();
997 return "Unknown"; 997 return "Unknown";
998 } 998 }
999 #endif // !LOG_DISABLED 999 #endif // !LOG_DISABLED
1000 1000
1001 } 1001 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698