Index: third_party/WebKit/Source/core/frame/Frame.cpp |
diff --git a/third_party/WebKit/Source/core/frame/Frame.cpp b/third_party/WebKit/Source/core/frame/Frame.cpp |
index 36729ad46393f405d1d0a128f320b3bc3125a1e4..8cd16c0f0eac6bcfe8d912d0b00c8dc90d85ee3e 100644 |
--- a/third_party/WebKit/Source/core/frame/Frame.cpp |
+++ b/third_party/WebKit/Source/core/frame/Frame.cpp |
@@ -124,7 +124,12 @@ HTMLFrameOwnerElement* Frame::deprecatedLocalOwner() const { |
} |
static ChromeClient& emptyChromeClient() { |
- DEFINE_STATIC_LOCAL(EmptyChromeClient, client, (EmptyChromeClient::create())); |
+ // |ChromeClient| contains a weak reference to a |Node| (which derives |
+ // from |ScriptWrappable|). That reference is only used for unit testing |
+ // purposes and will not accidentally leak between contexts. Consequently, |
haraken
2017/02/11 10:25:20
Nit: I don't think "leak between contexts" can hap
sof
2017/02/11 12:09:11
Hmm, doesn't the test from https://codereview.chro
dcheng
2017/02/12 09:33:45
The cross-context leak happens if:
- we have a sta
sof
2017/02/12 21:52:28
Yes, it could be made to work for the unit tests t
haraken
2017/02/12 23:56:47
I think the problem here is *just* (=not security
|
+ // disable the singleton verification check. |
+ DEFINE_STATIC_LOCAL(EmptyChromeClient, client, (EmptyChromeClient::create()), |
+ CheckScriptWrappable::No); |
return client; |
} |