@@ -259,18 +259,10 @@ index 0cc2127c9c12c2d82dea9550bad73f4ffb99ba24..490238b408da6b6ce7fbcccf13884997
259
259
}
260
260
261
261
diff --git a/Source/JavaScriptCore/inspector/InspectorTarget.h b/Source/JavaScriptCore/inspector/InspectorTarget.h
262
- index 4b95964db4d902b4b7f4b0b4c40afea51654ff2f..db2fde501b30c8e4fafcac3b2b403713c768c34f 100644
262
+ index 4b95964db4d902b4b7f4b0b4c40afea51654ff2f..f08e769a7b5435d215cd69ca8cc61ea0e741e417 100644
263
263
--- a/Source/JavaScriptCore/inspector/InspectorTarget.h
264
264
+++ b/Source/JavaScriptCore/inspector/InspectorTarget.h
265
- @@ -47,6 +47,7 @@ public:
266
- virtual InspectorTargetType type() const = 0;
267
-
268
- virtual bool isProvisional() const { return false; }
269
- + virtual String oldTargetID() const { return String(); }
270
- bool isPaused() const { return m_isPaused; }
271
- void pause();
272
- void resume();
273
- @@ -56,6 +57,8 @@ public:
265
+ @@ -56,6 +56,8 @@ public:
274
266
virtual void connect(FrontendChannel::ConnectionType) = 0;
275
267
virtual void disconnect() = 0;
276
268
virtual void sendMessageToTargetBackend(const String&) = 0;
@@ -280,7 +272,7 @@ index 4b95964db4d902b4b7f4b0b4c40afea51654ff2f..db2fde501b30c8e4fafcac3b2b403713
280
272
private:
281
273
WTF::Function<void()> m_resumeCallback;
282
274
diff --git a/Source/JavaScriptCore/inspector/agents/InspectorTargetAgent.cpp b/Source/JavaScriptCore/inspector/agents/InspectorTargetAgent.cpp
283
- index 8fcb5a1e55750d325a84824d86c49cfe6fb04268..b56ffaa68a34aa3e7119962cd8404cafb9b420ec 100644
275
+ index 8fcb5a1e55750d325a84824d86c49cfe6fb04268..ed2525df326bfe649793701a112eefa30952e375 100644
284
276
--- a/Source/JavaScriptCore/inspector/agents/InspectorTargetAgent.cpp
285
277
+++ b/Source/JavaScriptCore/inspector/agents/InspectorTargetAgent.cpp
286
278
@@ -87,6 +87,28 @@ void InspectorTargetAgent::sendMessageToTarget(ErrorString& errorString, const S
@@ -312,19 +304,7 @@ index 8fcb5a1e55750d325a84824d86c49cfe6fb04268..b56ffaa68a34aa3e7119962cd8404caf
312
304
void InspectorTargetAgent::sendMessageFromTargetToFrontend(const String& targetId, const String& message)
313
305
{
314
306
ASSERT_WITH_MESSAGE(m_targets.get(targetId), "Sending a message from an untracked target to the frontend.");
315
- @@ -115,8 +137,10 @@ static Ref<Protocol::Target::TargetInfo> buildTargetInfoObject(const InspectorTa
316
- .setTargetId(target.identifier())
317
- .setType(targetTypeToProtocolType(target.type()))
318
- .release();
319
- - if (target.isProvisional())
320
- + if (target.isProvisional()) {
321
- result->setIsProvisional(true);
322
- + result->setOldTargetId(target.oldTargetID());
323
- + }
324
- if (target.isPaused())
325
- result->setIsPaused(true);
326
- return result;
327
- @@ -144,7 +168,17 @@ void InspectorTargetAgent::targetDestroyed(InspectorTarget& target)
307
+ @@ -144,7 +166,17 @@ void InspectorTargetAgent::targetDestroyed(InspectorTarget& target)
328
308
if (!m_isConnected)
329
309
return;
330
310
@@ -343,7 +323,7 @@ index 8fcb5a1e55750d325a84824d86c49cfe6fb04268..b56ffaa68a34aa3e7119962cd8404caf
343
323
}
344
324
345
325
void InspectorTargetAgent::didCommitProvisionalTarget(const String& oldTargetID, const String& committedTargetID)
346
- @@ -159,6 +193 ,18 @@ void InspectorTargetAgent::didCommitProvisionalTarget(const String& oldTargetID,
326
+ @@ -159,6 +191 ,18 @@ void InspectorTargetAgent::didCommitProvisionalTarget(const String& oldTargetID,
347
327
m_frontendDispatcher->didCommitProvisionalTarget(oldTargetID, committedTargetID);
348
328
}
349
329
@@ -1245,20 +1225,19 @@ index a8fc5332ac92424b00a3dec62152fd3c5f28544e..2fba82d5f991bcfc1315628728771ff1
1245
1225
]
1246
1226
}
1247
1227
diff --git a/Source/JavaScriptCore/inspector/protocol/Target.json b/Source/JavaScriptCore/inspector/protocol/Target.json
1248
- index 52920cded24a9c6b0ef6fb4e518664955db4f9fa..11d40820629d3104408e14a3f92d9f0265b78ce1 100644
1228
+ index 52920cded24a9c6b0ef6fb4e518664955db4f9fa..bbbabc4e7259088b9404e8cc07eecd6f45077da0 100644
1249
1229
--- a/Source/JavaScriptCore/inspector/protocol/Target.json
1250
1230
+++ b/Source/JavaScriptCore/inspector/protocol/Target.json
1251
- @@ -10,7 +10,8 @@
1231
+ @@ -10,7 +10,7 @@
1252
1232
"properties": [
1253
1233
{ "name": "targetId", "type": "string", "description": "Unique identifier for the target." },
1254
1234
{ "name": "type", "type": "string", "enum": ["page", "service-worker", "worker"] },
1255
1235
- { "name": "isProvisional", "type": "boolean", "optional": true, "description": "Whether this is a provisional page target." },
1256
1236
+ { "name": "isProvisional", "type": "boolean", "optional": true, "description": "True value indicates that this is a provisional page target i.e. Such target may be created when current page starts cross-origin navigation. Eventually each provisional target is either committed and swaps with the current target or gets destroyed, e.g. in case of load request failure." },
1257
- + { "name": "oldTargetId", "type": "string", "optional": true, "description": "Unique identifier of the target which is going to be replaced if this target is committed. Only set for provisional targets." },
1258
1237
{ "name": "isPaused", "type": "boolean", "optional": true, "description": "Whether the target is paused on start and has to be explicitely resumed by inspector." }
1259
1238
]
1260
1239
}
1261
- @@ -37,6 +38 ,21 @@
1240
+ @@ -37,6 +37 ,21 @@
1262
1241
{ "name": "targetId", "type": "string" },
1263
1242
{ "name": "message", "type": "string", "description": "JSON Inspector Protocol message (command) to be dispatched on the backend." }
1264
1243
]
@@ -1280,7 +1259,7 @@ index 52920cded24a9c6b0ef6fb4e518664955db4f9fa..11d40820629d3104408e14a3f92d9f02
1280
1259
}
1281
1260
],
1282
1261
"events": [
1283
- @@ -49,7 +65 ,8 @@
1262
+ @@ -49,7 +64 ,8 @@
1284
1263
{
1285
1264
"name": "targetDestroyed",
1286
1265
"parameters": [
@@ -7084,7 +7063,7 @@ index 4896c404bc8b25d69360de7d1c509383282b2317..14bdebf732e929ea367c961f9d0bec85
7084
7063
// The timeout we use when waiting for a DidUpdateGeometry message.
7085
7064
static constexpr Seconds didUpdateBackingStoreStateTimeout() { return Seconds::fromMilliseconds(500); }
7086
7065
diff --git a/Source/WebKit/UIProcess/Inspector/InspectorTargetProxy.cpp b/Source/WebKit/UIProcess/Inspector/InspectorTargetProxy.cpp
7087
- index 6928ca2fbfb6939062e3cd14bb7ba6f2fdc87f5f..8259a01bb98789c07f88cafd4f3af553e65d0cf9 100644
7066
+ index 6928ca2fbfb6939062e3cd14bb7ba6f2fdc87f5f..c002691e47a67b6eb89458b7a532087436505365 100644
7088
7067
--- a/Source/WebKit/UIProcess/Inspector/InspectorTargetProxy.cpp
7089
7068
+++ b/Source/WebKit/UIProcess/Inspector/InspectorTargetProxy.cpp
7090
7069
@@ -27,11 +27,10 @@
@@ -7134,7 +7113,7 @@ index 6928ca2fbfb6939062e3cd14bb7ba6f2fdc87f5f..8259a01bb98789c07f88cafd4f3af553
7134
7113
if (m_provisionalPage) {
7135
7114
m_provisionalPage->send(Messages::WebPage::SendMessageToTargetBackend(identifier(), message));
7136
7115
return;
7137
- @@ -97,9 +98,35 @@ void InspectorTargetProxy::didCommitProvisionalTarget()
7116
+ @@ -97,6 +98,25 @@ void InspectorTargetProxy::didCommitProvisionalTarget()
7138
7117
m_provisionalPage = nullptr;
7139
7118
}
7140
7119
@@ -7160,18 +7139,8 @@ index 6928ca2fbfb6939062e3cd14bb7ba6f2fdc87f5f..8259a01bb98789c07f88cafd4f3af553
7160
7139
bool InspectorTargetProxy::isProvisional() const
7161
7140
{
7162
7141
return !!m_provisionalPage;
7163
- }
7164
-
7165
- +String InspectorTargetProxy::oldTargetID() const
7166
- +{
7167
- + if (!m_provisionalPage)
7168
- + return String();
7169
- + return WebPageInspectorTarget::toTargetID(m_page.webPageID());
7170
- +}
7171
- +
7172
- } // namespace WebKit
7173
7142
diff --git a/Source/WebKit/UIProcess/Inspector/InspectorTargetProxy.h b/Source/WebKit/UIProcess/Inspector/InspectorTargetProxy.h
7174
- index a2239cec8e18850f35f7f88a9c4ebadc62bf4023..f53bd7717be546157dfeb92b835a1df5513a716a 100644
7143
+ index a2239cec8e18850f35f7f88a9c4ebadc62bf4023..0f424fbba140712b67de7b388d9ce074c0fe1444 100644
7175
7144
--- a/Source/WebKit/UIProcess/Inspector/InspectorTargetProxy.h
7176
7145
+++ b/Source/WebKit/UIProcess/Inspector/InspectorTargetProxy.h
7177
7146
@@ -37,13 +37,13 @@ class WebPageProxy;
@@ -7191,12 +7160,7 @@ index a2239cec8e18850f35f7f88a9c4ebadc62bf4023..f53bd7717be546157dfeb92b835a1df5
7191
7160
~InspectorTargetProxy() = default;
7192
7161
7193
7162
Inspector::InspectorTargetType type() const final { return m_type; }
7194
- @@ -51,16 +51,21 @@ public:
7195
-
7196
- void didCommitProvisionalTarget();
7197
- bool isProvisional() const override;
7198
- + String oldTargetID() const override;
7199
-
7163
+ @@ -55,12 +55,16 @@ public:
7200
7164
void connect(Inspector::FrontendChannel::ConnectionType) override;
7201
7165
void disconnect() override;
7202
7166
void sendMessageToTargetBackend(const String&) override;
0 commit comments