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

Side by Side Diff: third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.cpp

Issue 2620463002: Show service worker navigation preload requests in DevTools Network tab (Closed)
Patch Set: incorporated falken's comment Created 3 years, 11 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) 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 1182 matching lines...) Expand 10 before | Expand all | Expand 10 after
1193 std::move(frameObject)); 1193 std::move(frameObject));
1194 } 1194 }
1195 1195
1196 void InspectorNetworkAgent::didReceiveWebSocketFrameError( 1196 void InspectorNetworkAgent::didReceiveWebSocketFrameError(
1197 unsigned long identifier, 1197 unsigned long identifier,
1198 const String& errorMessage) { 1198 const String& errorMessage) {
1199 frontend()->webSocketFrameError(IdentifiersFactory::requestId(identifier), 1199 frontend()->webSocketFrameError(IdentifiersFactory::requestId(identifier),
1200 monotonicallyIncreasingTime(), errorMessage); 1200 monotonicallyIncreasingTime(), errorMessage);
1201 } 1201 }
1202 1202
1203 void InspectorNetworkAgent::didSendNavigationPreload(int identifier,
1204 const KURL& requestURL,
1205 double timestamp,
1206 double wallTime) {
1207 std::unique_ptr<protocol::Network::Initiator> initiatorObject =
1208 protocol::Network::Initiator::create()
1209 .setType(protocol::Network::Initiator::TypeEnum::Preload)
1210 .build();
1211 frontend()->navigationPreloadSent(IdentifiersFactory::requestId(identifier),
1212 urlWithoutFragment(requestURL).getString(),
1213 timestamp, wallTime,
1214 std::move(initiatorObject));
1215 }
1216
1217 void InspectorNetworkAgent::didReceiveNavigationPreloadResponse(
1218 int identifier,
1219 const ResourceResponse& response) {
1220 frontend()->navigationPreloadResponseReceived(
1221 IdentifiersFactory::requestId(identifier), monotonicallyIncreasingTime(),
1222 buildObjectForResourceResponse(response));
1223 }
1224
1225 void InspectorNetworkAgent::didReceiveNavigationPreloadError(
1226 int identifier,
1227 const String& errorMessage) {
1228 frontend()->navigationPreloadFailed(IdentifiersFactory::requestId(identifier),
1229 monotonicallyIncreasingTime(),
1230 errorMessage);
1231 }
1232
1233 void InspectorNetworkAgent::didCompleteNavigationPreload(int identifier) {
1234 frontend()->navigationPreloadFinished(
1235 IdentifiersFactory::requestId(identifier), monotonicallyIncreasingTime());
1236 }
1237
1203 Response InspectorNetworkAgent::enable(Maybe<int> totalBufferSize, 1238 Response InspectorNetworkAgent::enable(Maybe<int> totalBufferSize,
1204 Maybe<int> resourceBufferSize) { 1239 Maybe<int> resourceBufferSize) {
1205 enable(totalBufferSize.fromMaybe(maximumTotalBufferSize), 1240 enable(totalBufferSize.fromMaybe(maximumTotalBufferSize),
1206 resourceBufferSize.fromMaybe(maximumResourceBufferSize)); 1241 resourceBufferSize.fromMaybe(maximumResourceBufferSize));
1207 return Response::OK(); 1242 return Response::OK();
1208 } 1243 }
1209 1244
1210 void InspectorNetworkAgent::enable(int totalBufferSize, 1245 void InspectorNetworkAgent::enable(int totalBufferSize,
1211 int resourceBufferSize) { 1246 int resourceBufferSize) {
1212 if (!frontend()) 1247 if (!frontend())
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
1532 m_isRecalculatingStyle(false), 1567 m_isRecalculatingStyle(false),
1533 m_removeFinishedReplayXHRTimer( 1568 m_removeFinishedReplayXHRTimer(
1534 this, 1569 this,
1535 &InspectorNetworkAgent::removeFinishedReplayXHRFired) {} 1570 &InspectorNetworkAgent::removeFinishedReplayXHRFired) {}
1536 1571
1537 bool InspectorNetworkAgent::shouldForceCORSPreflight() { 1572 bool InspectorNetworkAgent::shouldForceCORSPreflight() {
1538 return m_state->booleanProperty(NetworkAgentState::cacheDisabled, false); 1573 return m_state->booleanProperty(NetworkAgentState::cacheDisabled, false);
1539 } 1574 }
1540 1575
1541 } // namespace blink 1576 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698