Skip to content

Commit b3cd7a4

Browse files
yury-saslushnikov
authored andcommitted
browser(webkit): remove URL from TargetInfo (#676)
yury-s/WebKit@16cf942
1 parent 5a5016f commit b3cd7a4

File tree

2 files changed

+24
-83
lines changed

2 files changed

+24
-83
lines changed

browser_patches/webkit/BUILD_NUMBER

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1115
1+
1116

browser_patches/webkit/patches/bootstrap.diff

Lines changed: 23 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -228,21 +228,18 @@ index d408d364f1986983161f9d44efbc8bc6f6898676..1375ce9990f0c63d7e6f33ee62930051
228228
}
229229

230230
diff --git a/Source/JavaScriptCore/inspector/InspectorTarget.h b/Source/JavaScriptCore/inspector/InspectorTarget.h
231-
index 4b95964db4d902b4b7f4b0b4c40afea51654ff2f..78455c32fc5ddb0f1b9a828233a652d4f86b4d90 100644
231+
index 4b95964db4d902b4b7f4b0b4c40afea51654ff2f..db2fde501b30c8e4fafcac3b2b403713c768c34f 100644
232232
--- a/Source/JavaScriptCore/inspector/InspectorTarget.h
233233
+++ 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:
237235
virtual InspectorTargetType type() const = 0;
238-
+ virtual String url() const = 0;
239236

240237
virtual bool isProvisional() const { return false; }
241238
+ virtual String oldTargetID() const { return String(); }
242239
bool isPaused() const { return m_isPaused; }
243240
void pause();
244241
void resume();
245-
@@ -56,6 +58,8 @@ public:
242+
@@ -56,6 +57,8 @@ public:
246243
virtual void connect(FrontendChannel::ConnectionType) = 0;
247244
virtual void disconnect() = 0;
248245
virtual void sendMessageToTargetBackend(const String&) = 0;
@@ -252,7 +249,7 @@ index 4b95964db4d902b4b7f4b0b4c40afea51654ff2f..78455c32fc5ddb0f1b9a828233a652d4
252249
private:
253250
WTF::Function<void()> m_resumeCallback;
254251
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
256253
--- a/Source/JavaScriptCore/inspector/agents/InspectorTargetAgent.cpp
257254
+++ b/Source/JavaScriptCore/inspector/agents/InspectorTargetAgent.cpp
258255
@@ -87,6 +87,28 @@ void InspectorTargetAgent::sendMessageToTarget(ErrorString& errorString, const S
@@ -284,11 +281,9 @@ index 8fcb5a1e55750d325a84824d86c49cfe6fb04268..e3006f981fad81d98e09d2118443962c
284281
void InspectorTargetAgent::sendMessageFromTargetToFrontend(const String& targetId, const String& message)
285282
{
286283
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
289285
.setTargetId(target.identifier())
290286
.setType(targetTypeToProtocolType(target.type()))
291-
+ .setUrl(target.url())
292287
.release();
293288
- if (target.isProvisional())
294289
+ if (target.isProvisional()) {
@@ -298,7 +293,7 @@ index 8fcb5a1e55750d325a84824d86c49cfe6fb04268..e3006f981fad81d98e09d2118443962c
298293
if (target.isPaused())
299294
result->setIsPaused(true);
300295
return result;
301-
@@ -144,7 +169,17 @@ void InspectorTargetAgent::targetDestroyed(InspectorTarget& target)
296+
@@ -144,7 +168,17 @@ void InspectorTargetAgent::targetDestroyed(InspectorTarget& target)
302297
if (!m_isConnected)
303298
return;
304299

@@ -317,7 +312,7 @@ index 8fcb5a1e55750d325a84824d86c49cfe6fb04268..e3006f981fad81d98e09d2118443962c
317312
}
318313

319314
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,
321316
m_frontendDispatcher->didCommitProvisionalTarget(oldTargetID, committedTargetID);
322317
}
323318

@@ -1171,23 +1166,20 @@ index a8fc5332ac92424b00a3dec62152fd3c5f28544e..6dc8ac8e247631d2af6418155f088ea3
11711166
]
11721167
}
11731168
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
11751170
--- a/Source/JavaScriptCore/inspector/protocol/Target.json
11761171
+++ b/Source/JavaScriptCore/inspector/protocol/Target.json
1177-
@@ -10,8 +10,10 @@
1172+
@@ -10,7 +10,8 @@
11781173
"properties": [
11791174
{ "name": "targetId", "type": "string", "description": "Unique identifier for the target." },
11801175
{ "name": "type", "type": "string", "enum": ["page", "service-worker", "worker"] },
11811176
- { "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." }
11831177
+ { "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." },
11841178
+ { "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." }
11871180
]
11881181
}
1189-
],
1190-
@@ -37,6 +39,21 @@
1182+
@@ -37,6 +38,21 @@
11911183
{ "name": "targetId", "type": "string" },
11921184
{ "name": "message", "type": "string", "description": "JSON Inspector Protocol message (command) to be dispatched on the backend." }
11931185
]
@@ -1209,7 +1201,7 @@ index 52920cded24a9c6b0ef6fb4e518664955db4f9fa..55b783d9c429117f1e3d8a3234696f99
12091201
}
12101202
],
12111203
"events": [
1212-
@@ -49,7 +66,8 @@
1204+
@@ -49,7 +65,8 @@
12131205
{
12141206
"name": "targetDestroyed",
12151207
"parameters": [
@@ -7717,24 +7709,23 @@ index 0000000000000000000000000000000000000000..f356c613945fd263889bc74166bef2b2
77177709
+
77187710
+} // namespace WebKit
77197711
diff --git a/Source/WebKit/UIProcess/InspectorTargetProxy.cpp b/Source/WebKit/UIProcess/InspectorTargetProxy.cpp
7720-
index 6928ca2fbfb6939062e3cd14bb7ba6f2fdc87f5f..a54a1c99c1e255fd34a0c2fad13be32e7889cc8f 100644
7712+
index 6928ca2fbfb6939062e3cd14bb7ba6f2fdc87f5f..8259a01bb98789c07f88cafd4f3af553e65d0cf9 100644
77217713
--- a/Source/WebKit/UIProcess/InspectorTargetProxy.cpp
77227714
+++ b/Source/WebKit/UIProcess/InspectorTargetProxy.cpp
7723-
@@ -28,10 +28,13 @@
7715+
@@ -27,11 +27,10 @@
7716+
#include "InspectorTargetProxy.h"
77247717

77257718
#include "ProvisionalPageProxy.h"
7726-
#include "WebFrameProxy.h"
7719+
-#include "WebFrameProxy.h"
77277720
+#include "WebPageInspectorController.h"
77287721
#include "WebPageInspectorTarget.h"
77297722
#include "WebPageMessages.h"
77307723
#include "WebPageProxy.h"
7731-
#include "WebProcessProxy.h"
7732-
+#include "ProvisionalPageProxy.h"
7733-
+
7724+
-#include "WebProcessProxy.h"
77347725

77357726
namespace WebKit {
77367727

7737-
@@ -39,23 +42,29 @@ using namespace Inspector;
7728+
@@ -39,18 +38,17 @@ using namespace Inspector;
77387729

77397730
std::unique_ptr<InspectorTargetProxy> InspectorTargetProxy::create(WebPageProxy& page, const String& targetId, Inspector::InspectorTargetType type)
77407731
{
@@ -7758,19 +7749,7 @@ index 6928ca2fbfb6939062e3cd14bb7ba6f2fdc87f5f..a54a1c99c1e255fd34a0c2fad13be32e
77587749
, m_identifier(targetId)
77597750
, m_type(type)
77607751
{
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()
77747753

77757754
void InspectorTargetProxy::sendMessageToTargetBackend(const String& message)
77767755
{
@@ -7780,7 +7759,7 @@ index 6928ca2fbfb6939062e3cd14bb7ba6f2fdc87f5f..a54a1c99c1e255fd34a0c2fad13be32e
77807759
if (m_provisionalPage) {
77817760
m_provisionalPage->send(Messages::WebPage::SendMessageToTargetBackend(identifier(), message));
77827761
return;
7783-
@@ -97,9 +109,35 @@ void InspectorTargetProxy::didCommitProvisionalTarget()
7762+
@@ -97,9 +98,35 @@ void InspectorTargetProxy::didCommitProvisionalTarget()
77847763
m_provisionalPage = nullptr;
77857764
}
77867765

@@ -7817,10 +7796,10 @@ index 6928ca2fbfb6939062e3cd14bb7ba6f2fdc87f5f..a54a1c99c1e255fd34a0c2fad13be32e
78177796
+
78187797
} // namespace WebKit
78197798
diff --git a/Source/WebKit/UIProcess/InspectorTargetProxy.h b/Source/WebKit/UIProcess/InspectorTargetProxy.h
7820-
index a2239cec8e18850f35f7f88a9c4ebadc62bf4023..8c9960d59c7712b4f56d2c2f9bd862f0af7cf982 100644
7799+
index a2239cec8e18850f35f7f88a9c4ebadc62bf4023..f53bd7717be546157dfeb92b835a1df5513a716a 100644
78217800
--- a/Source/WebKit/UIProcess/InspectorTargetProxy.h
78227801
+++ b/Source/WebKit/UIProcess/InspectorTargetProxy.h
7823-
@@ -37,30 +37,36 @@ class WebPageProxy;
7802+
@@ -37,13 +37,13 @@ class WebPageProxy;
78247803
// NOTE: This UIProcess side InspectorTarget doesn't care about the frontend channel, since
78257804
// any target -> frontend messages will be routed to the WebPageProxy with a targetId.
78267805

@@ -7837,8 +7816,7 @@ index a2239cec8e18850f35f7f88a9c4ebadc62bf4023..8c9960d59c7712b4f56d2c2f9bd862f0
78377816
~InspectorTargetProxy() = default;
78387817

78397818
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:
78427820

78437821
void didCommitProvisionalTarget();
78447822
bool isProvisional() const override;
@@ -11359,43 +11337,6 @@ index d6dd3705763d94e2896c54eb8efd17d731b299dc..45546585228f047bb809bf3137b278b4
1135911337
LoadRequestWaitingForProcessLaunch(struct WebKit::LoadParameters loadParameters, URL resourceDirectoryURL, WebKit::WebPageProxyIdentifier pageID, bool checkAssumedReadAccessToResourceURL)
1136011338
LoadData(struct WebKit::LoadParameters loadParameters)
1136111339
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;
1139911340
diff --git a/Source/WebKit/WebProcess/WebProcess.cpp b/Source/WebKit/WebProcess/WebProcess.cpp
1140011341
index 65c9bc4ca76ac950dd9682e1224dcb8f6e0e48fe..1c0061063af2df56ad154206372a92a2333c3646 100644
1140111342
--- a/Source/WebKit/WebProcess/WebProcess.cpp

0 commit comments

Comments
 (0)