Index: WebKit/chromium/src/WebDevToolsAgentImpl.cpp |
=================================================================== |
--- WebKit/chromium/src/WebDevToolsAgentImpl.cpp (revision 67697) |
+++ WebKit/chromium/src/WebDevToolsAgentImpl.cpp (working copy) |
@@ -223,9 +223,7 @@ |
void WebDevToolsAgentImpl::frontendLoaded() |
{ |
- inspectorController()->connectFrontend(); |
- // We know that by this time injected script has already been pushed to the backend. |
- m_client->runtimePropertyChanged(kFrontendConnectedFeatureName, inspectorController()->injectedScriptHost()->injectedScriptSource()); |
+ connectFrontend(false); |
} |
void WebDevToolsAgentImpl::didNavigate() |
@@ -268,7 +266,7 @@ |
ic->disableResourceTracking(false /* not sticky */); |
} else if (name == kFrontendConnectedFeatureName && !inspectorController()->hasFrontend()) { |
inspectorController()->injectedScriptHost()->setInjectedScriptSource(value); |
- frontendLoaded(); |
+ connectFrontend(true); |
} |
} |
@@ -278,7 +276,7 @@ |
InspectorController* ic = inspectorController(); |
if (enabled) { |
if (!ic->hasFrontend()) |
- frontendLoaded(); |
+ connectFrontend(true); |
m_resourceTrackingWasEnabled = ic->resourceTrackingEnabled(); |
ic->startTimelineProfiler(); |
if (!m_resourceTrackingWasEnabled) { |
@@ -298,6 +296,16 @@ |
enabled ? String("true") : String("false")); |
} |
+void WebDevToolsAgentImpl::connectFrontend(bool afterNavigation) |
+{ |
+ if (afterNavigation) |
+ inspectorController()->reuseFrontend(); |
+ else |
+ inspectorController()->connectFrontend(); |
+ // We know that by this time injected script has already been pushed to the backend. |
+ m_client->runtimePropertyChanged(kFrontendConnectedFeatureName, inspectorController()->injectedScriptHost()->injectedScriptSource()); |
+} |
+ |
WebCore::InspectorController* WebDevToolsAgentImpl::inspectorController() |
{ |
if (Page* page = m_webViewImpl->page()) |