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

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: Updated 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
« no previous file with comments | « Source/core/fetch/MemoryCache.cpp ('k') | Source/core/fetch/ResourceFetcher.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 501 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 // This object may be dead here. 512 // This object may be dead here.
513 } 513 }
514 514
515 void Resource::allClientsRemoved() 515 void Resource::allClientsRemoved()
516 { 516 {
517 if (!m_loader) 517 if (!m_loader)
518 return; 518 return;
519 if (m_type == MainResource || m_type == Raw) 519 if (m_type == MainResource || m_type == Raw)
520 cancelTimerFired(&m_cancelTimer); 520 cancelTimerFired(&m_cancelTimer);
521 else if (!m_cancelTimer.isActive()) 521 else if (!m_cancelTimer.isActive())
522 m_cancelTimer.startOneShot(0); 522 m_cancelTimer.startOneShot(0, FROM_HERE);
523 } 523 }
524 524
525 void Resource::cancelTimerFired(Timer<Resource>* timer) 525 void Resource::cancelTimerFired(Timer<Resource>* timer)
526 { 526 {
527 ASSERT_UNUSED(timer, timer == &m_cancelTimer); 527 ASSERT_UNUSED(timer, timer == &m_cancelTimer);
528 if (hasClients() || !m_loader) 528 if (hasClients() || !m_loader)
529 return; 529 return;
530 ResourcePtr<Resource> protect(this); 530 ResourcePtr<Resource> protect(this);
531 m_loader->cancelIfNotFinishing(); 531 m_loader->cancelIfNotFinishing();
532 if (m_status != Cached) 532 if (m_status != Cached)
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
869 } 869 }
870 870
871 Resource::ResourceCallback::ResourceCallback() 871 Resource::ResourceCallback::ResourceCallback()
872 : m_callbackTimer(this, &ResourceCallback::timerFired) 872 : m_callbackTimer(this, &ResourceCallback::timerFired)
873 { 873 {
874 } 874 }
875 875
876 void Resource::ResourceCallback::schedule(Resource* resource) 876 void Resource::ResourceCallback::schedule(Resource* resource)
877 { 877 {
878 if (!m_callbackTimer.isActive()) 878 if (!m_callbackTimer.isActive())
879 m_callbackTimer.startOneShot(0); 879 m_callbackTimer.startOneShot(0, FROM_HERE);
880 m_resourcesWithPendingClients.add(resource); 880 m_resourcesWithPendingClients.add(resource);
881 } 881 }
882 882
883 void Resource::ResourceCallback::cancel(Resource* resource) 883 void Resource::ResourceCallback::cancel(Resource* resource)
884 { 884 {
885 m_resourcesWithPendingClients.remove(resource); 885 m_resourcesWithPendingClients.remove(resource);
886 if (m_callbackTimer.isActive() && m_resourcesWithPendingClients.isEmpty()) 886 if (m_callbackTimer.isActive() && m_resourcesWithPendingClients.isEmpty())
887 m_callbackTimer.stop(); 887 m_callbackTimer.stop();
888 } 888 }
889 889
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
986 return "Shader"; 986 return "Shader";
987 case Resource::ImportResource: 987 case Resource::ImportResource:
988 return "ImportResource"; 988 return "ImportResource";
989 } 989 }
990 ASSERT_NOT_REACHED(); 990 ASSERT_NOT_REACHED();
991 return "Unknown"; 991 return "Unknown";
992 } 992 }
993 #endif // !LOG_DISABLED 993 #endif // !LOG_DISABLED
994 994
995 } 995 }
OLDNEW
« no previous file with comments | « Source/core/fetch/MemoryCache.cpp ('k') | Source/core/fetch/ResourceFetcher.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698