-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sharing: show high-quality preview images in share hub
This change: 1. Defines a new IPC, blink.mojom.LocalFrame.GetOpenGraphMetadata, which fetches the frame's OpenGraph metadata, and an associated type blink.mojom.OpenGraphMetadata[1]. 2. Implements that IPC on renderer and browser sides. 3. Defines a new network traffic annotation share_preview_image_fetch for the actual image fetching for the sharing hub preview. 4. Adds code to SharingHubBubbleController to fetch the OpenGraph metadata for the current main frame, extract the image URL from it, fetch and decode that image safely using the data decoding service, and plug it into the sharing hub. Open questions for review: * What is the best way to test the new IPC? Bug: 1314854 [1]: That type contains only the image URL, but can be easily extended to contain other OpenGraph metadata if other clients need it. Change-Id: Ib5f0695461416e5d80e10612926df55e1314d292 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3597083 Reviewed-by: Nicolas Ouellet-Payeur <nicolaso@chromium.org> Reviewed-by: Nasko Oskov <nasko@chromium.org> Reviewed-by: Robert Sesek <rsesek@chromium.org> Reviewed-by: Kristi Park <kristipark@chromium.org> Reviewed-by: Stephen Chenney <schenney@chromium.org> Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org> Reviewed-by: Kent Tamura <tkent@chromium.org> Cr-Commit-Position: refs/heads/main@{#1001536}
- Loading branch information
Elly Fong-Jones
authored and
Chromium LUCI CQ
committed
May 10, 2022
1 parent
d8430a7
commit dae8f5c
Showing
21 changed files
with
224 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
per-file *.mojom=set noparent | ||
per-file *.mojom=file://ipc/SECURITY_OWNERS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Copyright 2022 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
module blink.mojom; | ||
|
||
import "url/mojom/url.mojom"; | ||
|
||
// An instance of OpenGraphMetadata represents the OpenGraph metadata extracted | ||
// from a page's meta tags - see https://ogp.me for more details. At the moment, | ||
// this is only a partial implementation to meet the needs of one use case. | ||
// | ||
// Security note: all this metadata comes directly from the page and while it | ||
// has been syntactically validated (by Mojo) no semantic checking has been | ||
// done. In particular, there is no guarantee that the various URLs, if present, | ||
// actually refer to images and in general they may be assumed to point to | ||
// arbitrary, untrusted web content. | ||
struct OpenGraphMetadata { | ||
// The URL included in the og:image meta tag, or (as a compatibility behavior) | ||
// the URL included in the image itemprop meta tag if that was present and no | ||
// og:image is present. | ||
url.mojom.Url? image; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.