@@ -228,21 +228,18 @@ index d408d364f1986983161f9d44efbc8bc6f6898676..1375ce9990f0c63d7e6f33ee62930051
228
228
}
229
229
230
230
diff --git a/Source/JavaScriptCore/inspector/InspectorTarget.h b/Source/JavaScriptCore/inspector/InspectorTarget.h
231
- index 4b95964db4d902b4b7f4b0b4c40afea51654ff2f..78455c32fc5ddb0f1b9a828233a652d4f86b4d90 100644
231
+ index 4b95964db4d902b4b7f4b0b4c40afea51654ff2f..db2fde501b30c8e4fafcac3b2b403713c768c34f 100644
232
232
--- a/Source/JavaScriptCore/inspector/InspectorTarget.h
233
233
+++ b/Source/JavaScriptCore/inspector/InspectorTarget.h
234
- @@ -45,8 +45,10 @@ public:
235
- // State.
236
- virtual String identifier() const = 0;
234
+ @@ -47,6 +47,7 @@ public:
237
235
virtual InspectorTargetType type() const = 0;
238
- + virtual String url() const = 0;
239
236
240
237
virtual bool isProvisional() const { return false; }
241
238
+ virtual String oldTargetID() const { return String(); }
242
239
bool isPaused() const { return m_isPaused; }
243
240
void pause();
244
241
void resume();
245
- @@ -56,6 +58 ,8 @@ public:
242
+ @@ -56,6 +57 ,8 @@ public:
246
243
virtual void connect(FrontendChannel::ConnectionType) = 0;
247
244
virtual void disconnect() = 0;
248
245
virtual void sendMessageToTargetBackend(const String&) = 0;
@@ -252,7 +249,7 @@ index 4b95964db4d902b4b7f4b0b4c40afea51654ff2f..78455c32fc5ddb0f1b9a828233a652d4
252
249
private:
253
250
WTF::Function<void()> m_resumeCallback;
254
251
diff --git a/Source/JavaScriptCore/inspector/agents/InspectorTargetAgent.cpp b/Source/JavaScriptCore/inspector/agents/InspectorTargetAgent.cpp
255
- index 8fcb5a1e55750d325a84824d86c49cfe6fb04268..e3006f981fad81d98e09d2118443962cc925f66f 100644
252
+ index 8fcb5a1e55750d325a84824d86c49cfe6fb04268..b56ffaa68a34aa3e7119962cd8404cafb9b420ec 100644
256
253
--- a/Source/JavaScriptCore/inspector/agents/InspectorTargetAgent.cpp
257
254
+++ b/Source/JavaScriptCore/inspector/agents/InspectorTargetAgent.cpp
258
255
@@ -87,6 +87,28 @@ void InspectorTargetAgent::sendMessageToTarget(ErrorString& errorString, const S
@@ -284,11 +281,9 @@ index 8fcb5a1e55750d325a84824d86c49cfe6fb04268..e3006f981fad81d98e09d2118443962c
284
281
void InspectorTargetAgent::sendMessageFromTargetToFrontend(const String& targetId, const String& message)
285
282
{
286
283
ASSERT_WITH_MESSAGE(m_targets.get(targetId), "Sending a message from an untracked target to the frontend.");
287
- @@ -114,9 +136,12 @@ static Ref<Protocol::Target::TargetInfo> buildTargetInfoObject(const InspectorTa
288
- auto result = Protocol::Target::TargetInfo::create()
284
+ @@ -115,8 +137,10 @@ static Ref<Protocol::Target::TargetInfo> buildTargetInfoObject(const InspectorTa
289
285
.setTargetId(target.identifier())
290
286
.setType(targetTypeToProtocolType(target.type()))
291
- + .setUrl(target.url())
292
287
.release();
293
288
- if (target.isProvisional())
294
289
+ if (target.isProvisional()) {
@@ -298,7 +293,7 @@ index 8fcb5a1e55750d325a84824d86c49cfe6fb04268..e3006f981fad81d98e09d2118443962c
298
293
if (target.isPaused())
299
294
result->setIsPaused(true);
300
295
return result;
301
- @@ -144,7 +169 ,17 @@ void InspectorTargetAgent::targetDestroyed(InspectorTarget& target)
296
+ @@ -144,7 +168 ,17 @@ void InspectorTargetAgent::targetDestroyed(InspectorTarget& target)
302
297
if (!m_isConnected)
303
298
return;
304
299
@@ -317,7 +312,7 @@ index 8fcb5a1e55750d325a84824d86c49cfe6fb04268..e3006f981fad81d98e09d2118443962c
317
312
}
318
313
319
314
void InspectorTargetAgent::didCommitProvisionalTarget(const String& oldTargetID, const String& committedTargetID)
320
- @@ -159,6 +194 ,18 @@ void InspectorTargetAgent::didCommitProvisionalTarget(const String& oldTargetID,
315
+ @@ -159,6 +193 ,18 @@ void InspectorTargetAgent::didCommitProvisionalTarget(const String& oldTargetID,
321
316
m_frontendDispatcher->didCommitProvisionalTarget(oldTargetID, committedTargetID);
322
317
}
323
318
@@ -1171,23 +1166,20 @@ index a8fc5332ac92424b00a3dec62152fd3c5f28544e..6dc8ac8e247631d2af6418155f088ea3
1171
1166
]
1172
1167
}
1173
1168
diff --git a/Source/JavaScriptCore/inspector/protocol/Target.json b/Source/JavaScriptCore/inspector/protocol/Target.json
1174
- index 52920cded24a9c6b0ef6fb4e518664955db4f9fa..55b783d9c429117f1e3d8a3234696f99e37c78d7 100644
1169
+ index 52920cded24a9c6b0ef6fb4e518664955db4f9fa..11d40820629d3104408e14a3f92d9f0265b78ce1 100644
1175
1170
--- a/Source/JavaScriptCore/inspector/protocol/Target.json
1176
1171
+++ b/Source/JavaScriptCore/inspector/protocol/Target.json
1177
- @@ -10,8 +10,10 @@
1172
+ @@ -10,7 +10,8 @@
1178
1173
"properties": [
1179
1174
{ "name": "targetId", "type": "string", "description": "Unique identifier for the target." },
1180
1175
{ "name": "type", "type": "string", "enum": ["page", "service-worker", "worker"] },
1181
1176
- { "name": "isProvisional", "type": "boolean", "optional": true, "description": "Whether this is a provisional page target." },
1182
- - { "name": "isPaused", "type": "boolean", "optional": true, "description": "Whether the target is paused on start and has to be explicitely resumed by inspector." }
1183
1177
+ { "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." },
1184
1178
+ { "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." },
1185
- + { "name": "isPaused", "type": "boolean", "optional": true, "description": "Whether the target is paused on start and has to be explicitely resumed by inspector." },
1186
- + { "name": "url", "type": "string" }
1179
+ { "name": "isPaused", "type": "boolean", "optional": true, "description": "Whether the target is paused on start and has to be explicitely resumed by inspector." }
1187
1180
]
1188
1181
}
1189
- ],
1190
- @@ -37,6 +39,21 @@
1182
+ @@ -37,6 +38,21 @@
1191
1183
{ "name": "targetId", "type": "string" },
1192
1184
{ "name": "message", "type": "string", "description": "JSON Inspector Protocol message (command) to be dispatched on the backend." }
1193
1185
]
@@ -1209,7 +1201,7 @@ index 52920cded24a9c6b0ef6fb4e518664955db4f9fa..55b783d9c429117f1e3d8a3234696f99
1209
1201
}
1210
1202
],
1211
1203
"events": [
1212
- @@ -49,7 +66 ,8 @@
1204
+ @@ -49,7 +65 ,8 @@
1213
1205
{
1214
1206
"name": "targetDestroyed",
1215
1207
"parameters": [
@@ -7717,24 +7709,23 @@ index 0000000000000000000000000000000000000000..f356c613945fd263889bc74166bef2b2
7717
7709
+
7718
7710
+} // namespace WebKit
7719
7711
diff --git a/Source/WebKit/UIProcess/InspectorTargetProxy.cpp b/Source/WebKit/UIProcess/InspectorTargetProxy.cpp
7720
- index 6928ca2fbfb6939062e3cd14bb7ba6f2fdc87f5f..a54a1c99c1e255fd34a0c2fad13be32e7889cc8f 100644
7712
+ index 6928ca2fbfb6939062e3cd14bb7ba6f2fdc87f5f..8259a01bb98789c07f88cafd4f3af553e65d0cf9 100644
7721
7713
--- a/Source/WebKit/UIProcess/InspectorTargetProxy.cpp
7722
7714
+++ b/Source/WebKit/UIProcess/InspectorTargetProxy.cpp
7723
- @@ -28,10 +28,13 @@
7715
+ @@ -27,11 +27,10 @@
7716
+ #include "InspectorTargetProxy.h"
7724
7717
7725
7718
#include "ProvisionalPageProxy.h"
7726
- #include "WebFrameProxy.h"
7719
+ - #include "WebFrameProxy.h"
7727
7720
+#include "WebPageInspectorController.h"
7728
7721
#include "WebPageInspectorTarget.h"
7729
7722
#include "WebPageMessages.h"
7730
7723
#include "WebPageProxy.h"
7731
- #include "WebProcessProxy.h"
7732
- +#include "ProvisionalPageProxy.h"
7733
- +
7724
+ -#include "WebProcessProxy.h"
7734
7725
7735
7726
namespace WebKit {
7736
7727
7737
- @@ -39,23 +42,29 @@ using namespace Inspector;
7728
+ @@ -39,18 +38,17 @@ using namespace Inspector;
7738
7729
7739
7730
std::unique_ptr<InspectorTargetProxy> InspectorTargetProxy::create(WebPageProxy& page, const String& targetId, Inspector::InspectorTargetType type)
7740
7731
{
@@ -7758,19 +7749,7 @@ index 6928ca2fbfb6939062e3cd14bb7ba6f2fdc87f5f..a54a1c99c1e255fd34a0c2fad13be32e
7758
7749
, m_identifier(targetId)
7759
7750
, m_type(type)
7760
7751
{
7761
- }
7762
-
7763
- +String InspectorTargetProxy::url() const
7764
- +{
7765
- + if (m_page.provisionalPageProxy())
7766
- + return m_page.provisionalPageProxy()->provisionalURL().string();
7767
- + return m_page.pageLoadState().activeURL();
7768
- +}
7769
- +
7770
- void InspectorTargetProxy::connect(Inspector::FrontendChannel::ConnectionType connectionType)
7771
- {
7772
- if (m_provisionalPage) {
7773
- @@ -83,6 +92,9 @@ void InspectorTargetProxy::disconnect()
7752
+ @@ -83,6 +81,9 @@ void InspectorTargetProxy::disconnect()
7774
7753
7775
7754
void InspectorTargetProxy::sendMessageToTargetBackend(const String& message)
7776
7755
{
@@ -7780,7 +7759,7 @@ index 6928ca2fbfb6939062e3cd14bb7ba6f2fdc87f5f..a54a1c99c1e255fd34a0c2fad13be32e
7780
7759
if (m_provisionalPage) {
7781
7760
m_provisionalPage->send(Messages::WebPage::SendMessageToTargetBackend(identifier(), message));
7782
7761
return;
7783
- @@ -97,9 +109 ,35 @@ void InspectorTargetProxy::didCommitProvisionalTarget()
7762
+ @@ -97,9 +98 ,35 @@ void InspectorTargetProxy::didCommitProvisionalTarget()
7784
7763
m_provisionalPage = nullptr;
7785
7764
}
7786
7765
@@ -7817,10 +7796,10 @@ index 6928ca2fbfb6939062e3cd14bb7ba6f2fdc87f5f..a54a1c99c1e255fd34a0c2fad13be32e
7817
7796
+
7818
7797
} // namespace WebKit
7819
7798
diff --git a/Source/WebKit/UIProcess/InspectorTargetProxy.h b/Source/WebKit/UIProcess/InspectorTargetProxy.h
7820
- index a2239cec8e18850f35f7f88a9c4ebadc62bf4023..8c9960d59c7712b4f56d2c2f9bd862f0af7cf982 100644
7799
+ index a2239cec8e18850f35f7f88a9c4ebadc62bf4023..f53bd7717be546157dfeb92b835a1df5513a716a 100644
7821
7800
--- a/Source/WebKit/UIProcess/InspectorTargetProxy.h
7822
7801
+++ b/Source/WebKit/UIProcess/InspectorTargetProxy.h
7823
- @@ -37,30 +37,36 @@ class WebPageProxy;
7802
+ @@ -37,13 +37,13 @@ class WebPageProxy;
7824
7803
// NOTE: This UIProcess side InspectorTarget doesn't care about the frontend channel, since
7825
7804
// any target -> frontend messages will be routed to the WebPageProxy with a targetId.
7826
7805
@@ -7837,8 +7816,7 @@ index a2239cec8e18850f35f7f88a9c4ebadc62bf4023..8c9960d59c7712b4f56d2c2f9bd862f0
7837
7816
~InspectorTargetProxy() = default;
7838
7817
7839
7818
Inspector::InspectorTargetType type() const final { return m_type; }
7840
- String identifier() const final { return m_identifier; }
7841
- + String url() const final;
7819
+ @@ -51,16 +51,21 @@ public:
7842
7820
7843
7821
void didCommitProvisionalTarget();
7844
7822
bool isProvisional() const override;
@@ -11359,43 +11337,6 @@ index d6dd3705763d94e2896c54eb8efd17d731b299dc..45546585228f047bb809bf3137b278b4
11359
11337
LoadRequestWaitingForProcessLaunch(struct WebKit::LoadParameters loadParameters, URL resourceDirectoryURL, WebKit::WebPageProxyIdentifier pageID, bool checkAssumedReadAccessToResourceURL)
11360
11338
LoadData(struct WebKit::LoadParameters loadParameters)
11361
11339
LoadAlternateHTML(struct WebKit::LoadParameters loadParameters)
11362
- diff --git a/Source/WebKit/WebProcess/WebPage/WebPageInspectorTarget.cpp b/Source/WebKit/WebProcess/WebPage/WebPageInspectorTarget.cpp
11363
- index a70f6fd52096a5dca901ea70a3755f14d6b4a0fd..f02e5c774a49d3e67860adb3b011531313eaf8d1 100644
11364
- --- a/Source/WebKit/WebProcess/WebPage/WebPageInspectorTarget.cpp
11365
- +++ b/Source/WebKit/WebProcess/WebPage/WebPageInspectorTarget.cpp
11366
- @@ -26,6 +26,8 @@
11367
- #include "config.h"
11368
- #include "WebPageInspectorTarget.h"
11369
-
11370
- +#include "FrameInfoData.h"
11371
- +#include "WebFrame.h"
11372
- #include "WebPage.h"
11373
- #include "WebPageInspectorTargetFrontendChannel.h"
11374
- #include <WebCore/InspectorController.h>
11375
- @@ -45,6 +47,11 @@ String WebPageInspectorTarget::identifier() const
11376
- return toTargetID(m_page.identifier());
11377
- }
11378
-
11379
- +String WebPageInspectorTarget::url() const
11380
- +{
11381
- + return m_page.mainWebFrame()->info().request.url().string();
11382
- +}
11383
- +
11384
- void WebPageInspectorTarget::connect(Inspector::FrontendChannel::ConnectionType connectionType)
11385
- {
11386
- if (m_channel)
11387
- diff --git a/Source/WebKit/WebProcess/WebPage/WebPageInspectorTarget.h b/Source/WebKit/WebProcess/WebPage/WebPageInspectorTarget.h
11388
- index 6cbd7fad5ff91afd858da346adbfeed6424b0b2b..176c46f186bc925fd28492d14d8d9e11bd8def26 100644
11389
- --- a/Source/WebKit/WebProcess/WebPage/WebPageInspectorTarget.h
11390
- +++ b/Source/WebKit/WebProcess/WebPage/WebPageInspectorTarget.h
11391
- @@ -44,6 +44,7 @@ public:
11392
- Inspector::InspectorTargetType type() const final { return Inspector::InspectorTargetType::Page; }
11393
-
11394
- String identifier() const final;
11395
- + String url() const final;
11396
-
11397
- void connect(Inspector::FrontendChannel::ConnectionType) override;
11398
- void disconnect() override;
11399
11340
diff --git a/Source/WebKit/WebProcess/WebProcess.cpp b/Source/WebKit/WebProcess/WebProcess.cpp
11400
11341
index 65c9bc4ca76ac950dd9682e1224dcb8f6e0e48fe..1c0061063af2df56ad154206372a92a2333c3646 100644
11401
11342
--- a/Source/WebKit/WebProcess/WebProcess.cpp
0 commit comments