Make secure_origin_whitelist::GetWhitelist() drop inputs that are not a serialization of an Origin. Then, we can hold the origin data using url::Origin. There we already have conversion functions for WebSecurtyOrigin, too.
Back link to the review comment where I suggested this https://chromium-review.googlesource.com/c/chromium/src/+/787610#message-c33a01b0fce7eeb18ed400164a378adc21a32d8d
vogelheim@ created a patch for this! https://chromium-review.googlesource.com/c/chromium/src/+/788862
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/7e085497f0f97d034ad09b25c351482b6658e475 commit 7e085497f0f97d034ad09b25c351482b6658e475 Author: Daniel Vogelheim <vogelheim@chromium.org> Date: Wed Dec 06 11:48:18 2017 Store secure origin whitelist as url::Origin (instead of GURL). Bug: 788289 Change-Id: I20634f6dc7ad2ef0e7313c647da746e745c29f79 Reviewed-on: https://chromium-review.googlesource.com/788862 Reviewed-by: Jochen Eisinger <jochen@chromium.org> Reviewed-by: Takeshi Yoshino <tyoshino@chromium.org> Commit-Queue: Daniel Vogelheim <vogelheim@chromium.org> Cr-Commit-Position: refs/heads/master@{#522066} [modify] https://crrev.com/7e085497f0f97d034ad09b25c351482b6658e475/chrome/common/secure_origin_whitelist.cc [modify] https://crrev.com/7e085497f0f97d034ad09b25c351482b6658e475/chrome/common/secure_origin_whitelist.h [modify] https://crrev.com/7e085497f0f97d034ad09b25c351482b6658e475/chrome/renderer/chrome_content_renderer_client.cc [modify] https://crrev.com/7e085497f0f97d034ad09b25c351482b6658e475/content/common/origin_util.cc [modify] https://crrev.com/7e085497f0f97d034ad09b25c351482b6658e475/content/common/url_schemes.cc [modify] https://crrev.com/7e085497f0f97d034ad09b25c351482b6658e475/content/common/url_schemes.h [modify] https://crrev.com/7e085497f0f97d034ad09b25c351482b6658e475/content/public/common/content_client.h [modify] https://crrev.com/7e085497f0f97d034ad09b25c351482b6658e475/content/public/common/url_utils.cc
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/e0ec80392e7820f45ecaddd8068e8fe033cfa09f commit e0ec80392e7820f45ecaddd8068e8fe033cfa09f Author: Takeshi Yoshino <tyoshino@chromium.org> Date: Wed Dec 13 11:40:53 2017 Change the port argument of SecurityOrigin::Create() methods to be uint16_t The automatic fallback to a unique origin in SecurityOrigin::Create() is error prone. A unique origin should be created explicitly. In the first place, it never gets such invalid values. To clarify that, change the type of the port argument to uint16_t. In SchemeHostPort, add DCHECKs to clarify that the results of GURL::EffectiveIntPort() can never be outside of the uint16_t range. One of the users of the methods, the CreateFromTupleWithSuborigin() method is no longer used by anyone. So, just remove it. Bug: 788289 Change-Id: Ib0abd718d5553f6b3b06388c4f5c684033202500 Reviewed-on: https://chromium-review.googlesource.com/796172 Commit-Queue: Takeshi Yoshino <tyoshino@chromium.org> Reviewed-by: Mike West <mkwst@chromium.org> Cr-Commit-Position: refs/heads/master@{#523742} [modify] https://crrev.com/e0ec80392e7820f45ecaddd8068e8fe033cfa09f/third_party/WebKit/Source/platform/exported/WebSecurityOrigin.cpp [modify] https://crrev.com/e0ec80392e7820f45ecaddd8068e8fe033cfa09f/third_party/WebKit/Source/platform/weborigin/SecurityOrigin.cpp [modify] https://crrev.com/e0ec80392e7820f45ecaddd8068e8fe033cfa09f/third_party/WebKit/Source/platform/weborigin/SecurityOrigin.h [modify] https://crrev.com/e0ec80392e7820f45ecaddd8068e8fe033cfa09f/third_party/WebKit/Source/platform/weborigin/SecurityOriginTest.cpp [modify] https://crrev.com/e0ec80392e7820f45ecaddd8068e8fe033cfa09f/third_party/WebKit/public/platform/WebSecurityOrigin.h [modify] https://crrev.com/e0ec80392e7820f45ecaddd8068e8fe033cfa09f/url/scheme_host_port.cc
Comment 1 by tyoshino@chromium.org
, Nov 24 2017