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

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

Issue 356723003: Add 'XHR' to the Resource::Type enum, and use it for XHR requests. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Preflight. Created 6 years, 5 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/Resource.h ('k') | Source/core/fetch/ResourceFetcher.h » ('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 510 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 memoryCache()->prune(this); 521 memoryCache()->prune(this);
522 } 522 }
523 } 523 }
524 // This object may be dead here. 524 // This object may be dead here.
525 } 525 }
526 526
527 void Resource::allClientsRemoved() 527 void Resource::allClientsRemoved()
528 { 528 {
529 if (!m_loader) 529 if (!m_loader)
530 return; 530 return;
531 if (m_type == MainResource || m_type == Raw) 531 if (m_type == MainResource || m_type == Raw || m_type == XMLHttpRequest)
532 cancelTimerFired(&m_cancelTimer); 532 cancelTimerFired(&m_cancelTimer);
533 else if (!m_cancelTimer.isActive()) 533 else if (!m_cancelTimer.isActive())
534 m_cancelTimer.startOneShot(0, FROM_HERE); 534 m_cancelTimer.startOneShot(0, FROM_HERE);
535 535
536 unlock(); 536 unlock();
537 } 537 }
538 538
539 void Resource::cancelTimerFired(Timer<Resource>* timer) 539 void Resource::cancelTimerFired(Timer<Resource>* timer)
540 { 540 {
541 ASSERT_UNUSED(timer, timer == &m_cancelTimer); 541 ASSERT_UNUSED(timer, timer == &m_cancelTimer);
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
948 case Resource::LinkPrefetch: 948 case Resource::LinkPrefetch:
949 return "Link prefetch resource"; 949 return "Link prefetch resource";
950 case Resource::LinkSubresource: 950 case Resource::LinkSubresource:
951 return "Link subresource"; 951 return "Link subresource";
952 case Resource::TextTrack: 952 case Resource::TextTrack:
953 return "Text track"; 953 return "Text track";
954 case Resource::ImportResource: 954 case Resource::ImportResource:
955 return "Imported resource"; 955 return "Imported resource";
956 case Resource::Media: 956 case Resource::Media:
957 return "Media"; 957 return "Media";
958 case Resource::XMLHttpRequest:
959 return "XMLHttpRequest";
958 } 960 }
959 ASSERT_NOT_REACHED(); 961 ASSERT_NOT_REACHED();
960 return initatorTypeNameToString(initiatorInfo.name); 962 return initatorTypeNameToString(initiatorInfo.name);
961 } 963 }
962 964
963 #if !LOG_DISABLED 965 #if !LOG_DISABLED
964 const char* ResourceTypeName(Resource::Type type) 966 const char* ResourceTypeName(Resource::Type type)
965 { 967 {
966 switch (type) { 968 switch (type) {
967 case Resource::MainResource: 969 case Resource::MainResource:
(...skipping 15 matching lines...) Expand all
983 case Resource::LinkPrefetch: 985 case Resource::LinkPrefetch:
984 return "LinkPrefetch"; 986 return "LinkPrefetch";
985 case Resource::LinkSubresource: 987 case Resource::LinkSubresource:
986 return "LinkSubresource"; 988 return "LinkSubresource";
987 case Resource::TextTrack: 989 case Resource::TextTrack:
988 return "TextTrack"; 990 return "TextTrack";
989 case Resource::ImportResource: 991 case Resource::ImportResource:
990 return "ImportResource"; 992 return "ImportResource";
991 case Resource::Media: 993 case Resource::Media:
992 return "Media"; 994 return "Media";
995 case Resource::XMLHttpRequest:
996 return "XMLHttpRequest";
993 } 997 }
994 ASSERT_NOT_REACHED(); 998 ASSERT_NOT_REACHED();
995 return "Unknown"; 999 return "Unknown";
996 } 1000 }
997 #endif // !LOG_DISABLED 1001 #endif // !LOG_DISABLED
998 1002
999 } 1003 }
OLDNEW
« no previous file with comments | « Source/core/fetch/Resource.h ('k') | Source/core/fetch/ResourceFetcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698