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

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

Issue 892693006: Revert of DevTools: use per-LocalFrame instrumenting agents instead of per-Page ones. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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 | Annotate | Revision Log
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 892 matching lines...) Expand 10 before | Expand all | Expand 10 after
903 void InspectorResourceAgent::canClearBrowserCookies(ErrorString*, bool* result) 903 void InspectorResourceAgent::canClearBrowserCookies(ErrorString*, bool* result)
904 { 904 {
905 *result = true; 905 *result = true;
906 } 906 }
907 907
908 void InspectorResourceAgent::setCacheDisabled(ErrorString*, bool cacheDisabled) 908 void InspectorResourceAgent::setCacheDisabled(ErrorString*, bool cacheDisabled)
909 { 909 {
910 m_state->setBoolean(ResourceAgentState::cacheDisabled, cacheDisabled); 910 m_state->setBoolean(ResourceAgentState::cacheDisabled, cacheDisabled);
911 if (cacheDisabled) 911 if (cacheDisabled)
912 memoryCache()->evictResources(); 912 memoryCache()->evictResources();
913 for (Frame* frame = m_pageAgent->inspectedFrame(); frame; frame = frame->tre e().traverseNext()) { 913 for (Frame* frame = m_pageAgent->mainFrame(); frame; frame = frame->tree().t raverseNext()) {
914 if (frame->isLocalFrame()) 914 if (frame->isLocalFrame())
915 toLocalFrame(frame)->document()->fetcher()->garbageCollectDocumentRe sources(); 915 toLocalFrame(frame)->document()->fetcher()->garbageCollectDocumentRe sources();
916 } 916 }
917 } 917 }
918 918
919 void InspectorResourceAgent::emulateNetworkConditions(ErrorString*, bool, double , double, double) 919 void InspectorResourceAgent::emulateNetworkConditions(ErrorString*, bool, double , double, double)
920 { 920 {
921 } 921 }
922 922
923 void InspectorResourceAgent::loadResourceForFrontend(ErrorString* errorString, c onst String& url, const RefPtr<JSONObject>* requestHeaders, PassRefPtrWillBeRawP tr<LoadResourceForFrontendCallback> prpCallback) 923 void InspectorResourceAgent::loadResourceForFrontend(ErrorString* errorString, c onst String& url, const RefPtr<JSONObject>* requestHeaders, PassRefPtrWillBeRawP tr<LoadResourceForFrontendCallback> prpCallback)
924 { 924 {
925 RefPtrWillBeRawPtr<LoadResourceForFrontendCallback> callback = prpCallback; 925 RefPtrWillBeRawPtr<LoadResourceForFrontendCallback> callback = prpCallback;
926 Frame* frame = m_pageAgent->inspectedFrame(); 926 Frame* frame = m_pageAgent->page()->mainFrame();
927 if (!frame || !frame->isLocalFrame()) { 927 if (!frame || !frame->isLocalFrame()) {
928 *errorString = "No frame to use as a loader found"; 928 *errorString = "No frame to use as a loader found";
929 return; 929 return;
930 } 930 }
931 931
932 Document* document = static_cast<LocalFrame*>(frame)->document(); 932 Document* document = static_cast<LocalFrame*>(frame)->document();
933 if (!document) { 933 if (!document) {
934 *errorString = "No Document instance found"; 934 *errorString = "No Document instance found";
935 return; 935 return;
936 } 936 }
(...skipping 28 matching lines...) Expand all
965 return; 965 return;
966 } 966 }
967 loader->setDefersLoading(false); 967 loader->setDefersLoading(false);
968 if (!callback->isActive()) 968 if (!callback->isActive())
969 return; 969 return;
970 inspectorThreadableLoaderClient->setLoader(loader.release()); 970 inspectorThreadableLoaderClient->setLoader(loader.release());
971 } 971 }
972 972
973 void InspectorResourceAgent::didCommitLoad(LocalFrame* frame, DocumentLoader* lo ader) 973 void InspectorResourceAgent::didCommitLoad(LocalFrame* frame, DocumentLoader* lo ader)
974 { 974 {
975 if (loader->frame() != m_pageAgent->inspectedFrame()) 975 if (loader->frame() != frame->page()->mainFrame())
976 return; 976 return;
977 977
978 if (m_state->getBoolean(ResourceAgentState::cacheDisabled)) 978 if (m_state->getBoolean(ResourceAgentState::cacheDisabled))
979 memoryCache()->evictResources(); 979 memoryCache()->evictResources();
980 980
981 m_resourcesData->clear(m_pageAgent->loaderId(loader)); 981 m_resourcesData->clear(m_pageAgent->loaderId(loader));
982 } 982 }
983 983
984 void InspectorResourceAgent::frameScheduledNavigation(LocalFrame* frame, double) 984 void InspectorResourceAgent::frameScheduledNavigation(LocalFrame* frame, double)
985 { 985 {
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
1032 , m_removeFinishedReplayXHRTimer(this, &InspectorResourceAgent::removeFinish edReplayXHRFired) 1032 , m_removeFinishedReplayXHRTimer(this, &InspectorResourceAgent::removeFinish edReplayXHRFired)
1033 { 1033 {
1034 } 1034 }
1035 1035
1036 bool InspectorResourceAgent::shouldForceCORSPreflight() 1036 bool InspectorResourceAgent::shouldForceCORSPreflight()
1037 { 1037 {
1038 return m_state->getBoolean(ResourceAgentState::cacheDisabled); 1038 return m_state->getBoolean(ResourceAgentState::cacheDisabled);
1039 } 1039 }
1040 1040
1041 } // namespace blink 1041 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/inspector/InspectorPageAgent.cpp ('k') | Source/core/inspector/InspectorResourceContentLoader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698