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

Unified Diff: third_party/WebKit/Source/platform/weborigin/OriginAccessEntry.cpp

Issue 2194973002: Fix linker warning in broadcast_channel.mojom-blink.obj. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tighten deps Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/weborigin/OriginAccessEntry.cpp
diff --git a/third_party/WebKit/Source/platform/weborigin/OriginAccessEntry.cpp b/third_party/WebKit/Source/platform/weborigin/OriginAccessEntry.cpp
index cdd2e6b828115467516339d3e7819e4f66d5c5f5..fc694fd1d178e2aab88ddaac16224ff444e5218c 100644
--- a/third_party/WebKit/Source/platform/weborigin/OriginAccessEntry.cpp
+++ b/third_party/WebKit/Source/platform/weborigin/OriginAccessEntry.cpp
@@ -30,10 +30,9 @@
#include "platform/weborigin/OriginAccessEntry.h"
+#include "net/base/registry_controlled_domains/registry_controlled_domain.h"
#include "platform/weborigin/KURL.h"
#include "platform/weborigin/SecurityOrigin.h"
-#include "public/platform/Platform.h"
-#include "public/platform/WebPublicSuffixList.h"
#include "url/third_party/mozilla/url_parse.h"
#include "url/url_canon.h"
@@ -88,11 +87,14 @@ OriginAccessEntry::OriginAccessEntry(const String& protocol, const String& host,
// Look for top-level domains, either with or without an additional dot.
if (!m_hostIsIPAddress) {
- WebPublicSuffixList* suffixList = Platform::current()->publicSuffixList();
- if (!suffixList)
- return;
+ std::string hostString(reinterpret_cast<const char*>(m_host.characters8()), m_host.length());
+ size_t publicSuffixLength = net::registry_controlled_domains::GetRegistryLength(
+ hostString,
+ net::registry_controlled_domains::INCLUDE_UNKNOWN_REGISTRIES,
+ net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES);
+ if (!publicSuffixLength)
+ publicSuffixLength = m_host.length();
- size_t publicSuffixLength = suffixList->getPublicSuffixLength(m_host);
if (m_host.length() <= publicSuffixLength + 1) {
m_hostIsPublicSuffix = true;
} else if (subdomainSetting == AllowRegisterableDomains && publicSuffixLength) {

Powered by Google App Engine
This is Rietveld 408576698