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

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

Issue 1697713002: [WIP] ImageResourceClient->ImageResourceObserver (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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) 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 896 matching lines...) Expand 10 before | Expand all | Expand 10 after
907 return sizeof(Resource) + m_response.memoryUsage() + kAverageClientsHashMapS ize + m_resourceRequest.url().string().length() * 2; 907 return sizeof(Resource) + m_response.memoryUsage() + kAverageClientsHashMapS ize + m_resourceRequest.url().string().length() * 2;
908 } 908 }
909 909
910 void Resource::didChangePriority(ResourceLoadPriority loadPriority, int intraPri orityValue) 910 void Resource::didChangePriority(ResourceLoadPriority loadPriority, int intraPri orityValue)
911 { 911 {
912 m_resourceRequest.setPriority(loadPriority, intraPriorityValue); 912 m_resourceRequest.setPriority(loadPriority, intraPriorityValue);
913 if (m_loader) 913 if (m_loader)
914 m_loader->didChangePriority(loadPriority, intraPriorityValue); 914 m_loader->didChangePriority(loadPriority, intraPriorityValue);
915 } 915 }
916 916
917 ResourcePriority Resource::priorityFromClients()
918 {
919 ResourcePriority priority;
920 ResourceClientWalker<ResourceClient> walker(m_clients);
921 while (ResourceClient* c = walker.next()) {
922 ResourcePriority nextPriority = c->computeResourcePriority();
923 if (nextPriority.visibility == ResourcePriority::NotVisible)
924 continue;
925 priority.visibility = ResourcePriority::Visible;
926 priority.intraPriorityValue += nextPriority.intraPriorityValue;
927 }
928 return priority;
929 }
930
931 Resource::ResourceCallback* Resource::ResourceCallback::callbackHandler() 917 Resource::ResourceCallback* Resource::ResourceCallback::callbackHandler()
932 { 918 {
933 // Oilpan + LSan: as the callbackHandler() singleton is used by Resource 919 // Oilpan + LSan: as the callbackHandler() singleton is used by Resource
934 // and ResourcePtr finalizers, it cannot be released upon shutdown in 920 // and ResourcePtr finalizers, it cannot be released upon shutdown in
935 // preparation for leak detection. 921 // preparation for leak detection.
936 // 922 //
937 // Keep it out of LSan's reach instead. 923 // Keep it out of LSan's reach instead.
938 LEAK_SANITIZER_DISABLED_SCOPE; 924 LEAK_SANITIZER_DISABLED_SCOPE;
939 DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<ResourceCallback>, callbackHandle r, (adoptPtrWillBeNoop(new ResourceCallback))); 925 DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<ResourceCallback>, callbackHandle r, (adoptPtrWillBeNoop(new ResourceCallback)));
940 return callbackHandler.get(); 926 return callbackHandler.get();
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
1111 case Resource::Media: 1097 case Resource::Media:
1112 return "Media"; 1098 return "Media";
1113 case Resource::Manifest: 1099 case Resource::Manifest:
1114 return "Manifest"; 1100 return "Manifest";
1115 } 1101 }
1116 ASSERT_NOT_REACHED(); 1102 ASSERT_NOT_REACHED();
1117 return "Unknown"; 1103 return "Unknown";
1118 } 1104 }
1119 1105
1120 } // namespace blink 1106 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/fetch/Resource.h ('k') | third_party/WebKit/Source/core/fetch/ResourceClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698