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

Side by Side Diff: Source/core/inspector/InspectorResourceAgent.cpp

Issue 445023005: DevTools: reduce ResourceAgent dependency on PageAgent. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 4 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 | Source/core/inspector/InspectorStyleSheet.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) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 829 matching lines...) Expand 10 before | Expand all | Expand 10 after
840 m_frameNavigationInitiatorMap.remove(m_pageAgent->frameId(frame)); 840 m_frameNavigationInitiatorMap.remove(m_pageAgent->frameId(frame));
841 } 841 }
842 842
843 void InspectorResourceAgent::setHostId(const String& hostId) 843 void InspectorResourceAgent::setHostId(const String& hostId)
844 { 844 {
845 m_hostId = hostId; 845 m_hostId = hostId;
846 } 846 }
847 847
848 bool InspectorResourceAgent::fetchResourceContent(Document* document, const KURL & url, String* content, bool* base64Encoded) 848 bool InspectorResourceAgent::fetchResourceContent(Document* document, const KURL & url, String* content, bool* base64Encoded)
849 { 849 {
850 if (m_pageAgent->getEditedResourceContent(url, content)) {
851 *base64Encoded = false;
852 return true;
853 }
854
855 // First try to fetch content from the cached resource. 850 // First try to fetch content from the cached resource.
856 Resource* cachedResource = document->fetcher()->cachedResource(url); 851 Resource* cachedResource = document->fetcher()->cachedResource(url);
857 if (!cachedResource) 852 if (!cachedResource)
858 cachedResource = memoryCache()->resourceForURL(url); 853 cachedResource = memoryCache()->resourceForURL(url);
859 if (cachedResource && InspectorPageAgent::cachedResourceContent(cachedResour ce, content, base64Encoded)) 854 if (cachedResource && InspectorPageAgent::cachedResourceContent(cachedResour ce, content, base64Encoded))
860 return true; 855 return true;
861 856
862 // Then fall back to resource data. 857 // Then fall back to resource data.
863 Vector<NetworkResourcesData::ResourceData*> resources = m_resourcesData->res ources(); 858 Vector<NetworkResourcesData::ResourceData*> resources = m_resourcesData->res ources();
864 for (Vector<NetworkResourcesData::ResourceData*>::iterator it = resources.be gin(); it != resources.end(); ++it) { 859 for (Vector<NetworkResourcesData::ResourceData*>::iterator it = resources.be gin(); it != resources.end(); ++it) {
(...skipping 15 matching lines...) Expand all
880 : InspectorBaseAgent<InspectorResourceAgent>("Network") 875 : InspectorBaseAgent<InspectorResourceAgent>("Network")
881 , m_pageAgent(pageAgent) 876 , m_pageAgent(pageAgent)
882 , m_frontend(0) 877 , m_frontend(0)
883 , m_resourcesData(adoptPtr(new NetworkResourcesData())) 878 , m_resourcesData(adoptPtr(new NetworkResourcesData()))
884 , m_isRecalculatingStyle(false) 879 , m_isRecalculatingStyle(false)
885 , m_removeFinishedReplayXHRTimer(this, &InspectorResourceAgent::removeFinish edReplayXHRFired) 880 , m_removeFinishedReplayXHRTimer(this, &InspectorResourceAgent::removeFinish edReplayXHRFired)
886 { 881 {
887 } 882 }
888 883
889 } // namespace blink 884 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/core/inspector/InspectorStyleSheet.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698