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

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

Issue 2306303003: Cancel RawResource asynchronously in allClientsAndObserversRemoved() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 2 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/testing/weburl_loader_mock_factory_impl.cc » ('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 6 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
7 rights reserved. 7 rights reserved.
8 8
9 This library is free software; you can redistribute it and/or 9 This library is free software; you can redistribute it and/or
10 modify it under the terms of the GNU Library General Public 10 modify it under the terms of the GNU Library General Public
(...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after
740 // We allow non-secure content to be reused in history, but we do not allow 740 // We allow non-secure content to be reused in history, but we do not allow
741 // secure content to be reused. 741 // secure content to be reused.
742 if (hasCacheControlNoStoreHeader() && url().protocolIs("https")) 742 if (hasCacheControlNoStoreHeader() && url().protocolIs("https"))
743 memoryCache()->remove(this); 743 memoryCache()->remove(this);
744 } 744 }
745 } 745 }
746 746
747 void Resource::allClientsAndObserversRemoved() { 747 void Resource::allClientsAndObserversRemoved() {
748 if (!m_loader) 748 if (!m_loader)
749 return; 749 return;
750 if (m_type == Raw) 750 if (!m_cancelTimer.isActive())
751 cancelTimerFired(&m_cancelTimer);
752 else if (!m_cancelTimer.isActive())
753 m_cancelTimer.startOneShot(0, BLINK_FROM_HERE); 751 m_cancelTimer.startOneShot(0, BLINK_FROM_HERE);
754 } 752 }
755 753
756 void Resource::cancelTimerFired(TimerBase* timer) { 754 void Resource::cancelTimerFired(TimerBase* timer) {
757 DCHECK_EQ(timer, &m_cancelTimer); 755 DCHECK_EQ(timer, &m_cancelTimer);
758 if (!hasClientsOrObservers() && m_loader) 756 if (!hasClientsOrObservers() && m_loader)
759 m_loader->cancel(); 757 m_loader->cancel();
760 } 758 }
761 759
762 void Resource::setDecodedSize(size_t decodedSize) { 760 void Resource::setDecodedSize(size_t decodedSize) {
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
1074 case Resource::TextTrack: 1072 case Resource::TextTrack:
1075 case Resource::Media: 1073 case Resource::Media:
1076 case Resource::Manifest: 1074 case Resource::Manifest:
1077 return false; 1075 return false;
1078 } 1076 }
1079 NOTREACHED(); 1077 NOTREACHED();
1080 return false; 1078 return false;
1081 } 1079 }
1082 1080
1083 } // namespace blink 1081 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/testing/weburl_loader_mock_factory_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698