-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API Review: Frame process info #3675
base: main
Are you sure you want to change the base?
Conversation
Add Spec for FrameProcessInfo.md
specs/FrameProcesssInfo.md
Outdated
if (environment14) | ||
{ | ||
//! [GetProcessInfosWithDetails] | ||
CHECK_FAILURE(environment14->GetProcessInfosWithDetails( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need a new method at all? Is the problem that getting the AssociatedFrameInfos is expensive, so we don't want to do the work unless explicitly requested?
(Also, we're taking the name "WithDetails", which means that if we extend ProcessInfo more, we're stuck with a clunky name like "WithMoreDetails" or "NowEvenDetailier".)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it could be expensive. Considered we want to use the new method to acquire more process information detail.
Current design is to populate data in CoreWebView2Environment.GetProcessInfosWithDetails and extend CoreWebView2ProcessInfo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was my first question too - why is GetProcessInfosWithDetails even necessary, given you need to QI for ICoreWebView2ProcessInfo2? Either the QI or the call to get_AssociatedFrameInfos provide ample opportunity for lazy evaluation of the AssociatedFrameInfos.
specs/FrameProcesssInfo.md
Outdated
CHECK_FAILURE( | ||
processInfo->QueryInterface(IID_PPV_ARGS(&processInfo2))); | ||
wil::com_ptr<ICoreWebView2FrameInfoCollection> frameInfoCollection; | ||
CHECK_FAILURE(processInfo2->get_AssociatedFrameInfos( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this return the associated frame infos as of the point of call? Or does it return the frame infos for the frames that were associated at the time GetProcessInfosWithDetails was called?
In other words, is this a snapshot or a live object?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's when GetProcessInfosWithDetails gets called. It's a snapshot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New names discussed: GetProcessExtendedInfosAsync returns ProcessExtendedInfo.
{ | ||
wil::com_ptr<ICoreWebView2FrameInfo> mainFrameInfo; | ||
wil::com_ptr<ICoreWebView2FrameInfo2> frameInfo2; | ||
while (frameInfo) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just checking: A frame that is an immediate child of the top-level document reports no parent frame. In other words, the top-level document does not count as a "frame" for this purpose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We inherit internal definition and treat top-level document as the MainFrame. For an immediate child of the top-level document, we reports the corresponding MainFrame as its parent frame.
specs/FrameProcesssInfo.md
Outdated
COREWEBVIEW2_FRAME_KIND frameKind = COREWEBVIEW2_FRAME_KIND_OTHER; | ||
|
||
CHECK_FAILURE(frameInfo->get_Name(&nameRaw)); | ||
std::wstring name = ((std::wstring)(nameRaw.get())).empty() ? L"none" : nameRaw.get(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
std::wstring name = ((std::wstring)(nameRaw.get())).empty() ? L"none" : nameRaw.get(); | |
std::wstring name = nameRaw.get()[0] ? nameRaw.get() : L"none"; | |
No need to create a temporary std::wstring
for the sole purpose of checking if the string is empty.
specs/FrameProcesssInfo.md
Outdated
std::wstring ProcessComponent::FrameKindToString(const COREWEBVIEW2_FRAME_KIND kind) | ||
{ | ||
switch (kind) | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a macro definition is missing
#define KIND_ENTRY(kindValue) case kindValue: return L#kindValue;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix
specs/FrameProcesssInfo.md
Outdated
CHECK_FAILURE(frameInfo2->get_FrameId(&mainFrameId)); | ||
|
||
wil::com_ptr<ICoreWebView2FrameInfo> firstLevelFrameInfo = | ||
GetAncestorFirstLevelFrameInfo(frameInfo); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
C++ sample forgot to include the code for this function. (But I can infer it from the C# sample.)
Terminology is a little confusing. "First level frame" sounds like the main frame (since the main frame comes first), but I think here "first level frame" is "first level below the main frame." So it's the first subframe.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. Please update. Main frame's child or don't treat this specially and don't give it a term.
specs/FrameProcesssInfo.md
Outdated
CHECK_FAILURE(frameInfo2->get_FrameId(&firstLevelFrameId)); | ||
} | ||
|
||
result << L"{frame name:" << name << L" | frame Id:" << std::to_wstring(frameId) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
result << L"{frame name:" << name << L" | frame Id:" << std::to_wstring(frameId) | |
result << L"{frame name:" << name << L" | frame Id:" << frameId | |
Don't need to std::to_wstring
the uint32. <<
can accept uint32's already.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix
specs/FrameProcesssInfo.md
Outdated
CHECK_FAILURE( | ||
processInfo->QueryInterface(IID_PPV_ARGS(&processInfo2))); | ||
wil::com_ptr<ICoreWebView2FrameInfoCollection> frameInfoCollection; | ||
CHECK_FAILURE(processInfo2->get_AssociatedFrameInfos( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if you call the old GetProcessInfos (no WithDetails) and then ask for the AssociatedFrameInfos? Do you get an empty list? Do you get nullptr? Do you get an exception?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will return an empty list,
CoreWebView2ProcessInfo
objects obtained viaCoreWebView2Environment. GetProcessInfos
or for non-renderer processes will always have an emptyAssociatedFrameInfos
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a little confusing as there would be no way to guess that just from reading the api.
Would it instead be possible to do something like:
runtimeclass CoreWebView2
{
Windows.Foundation.IAsyncOperation<IVectorView<WebView2ProcessAndFrameInfo>> GetProcessAndFrameInfosAsync()
}
runtimeclass WebView2ProcessAndFrameInfo
{
CoreWebView2ProcessInfo ProcessInfo {get; }
IVectorView<CoreWebView2FrameInfo> FrameInfos { get; };
}
This way you would never end up with an object that included 'dummy' properties.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or CoreWebView2ProcessInfo.GetAssociatedFrameInfos()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is another reason not to introduce GetProcessInfosWithDetails - it fragments the behavior of GetProcessInfos. Just add ICoreWebView2ProcessInfo2 with lazy evaluation of get_AssociatedFrameInfos.
specs/FrameProcesssInfo.md
Outdated
CHECK_FAILURE( | ||
processInfo->QueryInterface(IID_PPV_ARGS(&processInfo2))); | ||
wil::com_ptr<ICoreWebView2FrameInfoCollection> frameInfoCollection; | ||
CHECK_FAILURE(processInfo2->get_AssociatedFrameInfos( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about top-level documents? This lets me find the process that is hosting a specific frame, but how do I find the process that is hosting my top-level document?
The documentation for ParentFrameInfo suggests that you can get a FrameInfo for the top-level document, since it talks about the value of the ParentFrameInfo property in that case:
This property is also
null
for the top most document in the WebView2 which has no parent frame.
But how do you get the FrameInfo for the top-level document?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The top-level documents also returning as part of GetProcessInfosWithDetails. CoreWebView2FrameKind.MainFrame
is the type for top-level documents.
specs/FrameProcesssInfo.md
Outdated
[v1_enum] | ||
typedef enum COREWEBVIEW2_FRAME_KIND { | ||
/// Indicates that the frame is type of frame we don't differentiate yet. | ||
COREWEBVIEW2_FRAME_KIND_OTHER, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we ever report this for any other kind of frames beyond terminated frames? Could just call this TERMINATED
and just use new values for future types of frames?
Calling it OTHER
makes it hard to add new types of frames later. Suppose we add "3DFrames" later. Do they show up as COREWEBVIEW2_FRAME_KIND_3DFRAME
and confuse old clients? Or do we report them as COREWEBVIEW2_FRAME_KIND_OTHER
and confuse new clients?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above
specs/FrameProcesssInfo.md
Outdated
|
||
We provide the `GetProcessInfos` API for host applications to understand which | ||
processes are part of their WebView2s. That API provides enough information for | ||
a host application to understand the overall performance impact(memory, CPU |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a host application to understand the overall performance impact(memory, CPU | |
a host application to understand the overall performance impact (memory, CPU | |
nit, missing space. This occurs all three times parentheticals are used in Background + Description.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noted!
specs/FrameProcesssInfo.md
Outdated
[v1_enum] | ||
typedef enum COREWEBVIEW2_FRAME_KIND { | ||
/// Indicates that the frame is type of frame we don't differentiate yet. | ||
COREWEBVIEW2_FRAME_KIND_OTHER, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need a reserved Other enum for future expansion here? (vs adding new concrete frame kinds when they becomes defined)
Are there real other types we know about but aren't including?
I'm wondering if including Other increases risk of non-extensible usage. Will developers' apps break if some Frames "change kind" from Other to a new/future enum value? When or why would a developer check for "Other" type today?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably yes - With the speed and experimentation-centric approach of web standards, it's reasonable to expect new kinds of frames that we'll add well after they first appear. For example, Fenced Frames have been a proposal and prototype/experiment for years but are just getting to being a "standard". It's possible for something like this to change names, get dropped entirely, etc. that we wouldn't want to set in stone for our enum until it's actually complete.
Realistically, most use-cases will probably treat "Other" just like "IFrame" and be fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Frame type "Other" helps to provide a more complete/accurate frame tree structure while frame kinds updating.
There're other defined frame types like embed frame, object frame that developers might want to differentiate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have we written down some kind of a philosophy/strategy on API compat for WebView?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change Other -> Unknown, and update documentation to explain compat situation.
the `FrameId` property. This property represents the unique identifier of | ||
the frame running in this `CoreWebView2` or `CoreWebView2Frame`. | ||
|
||
* We propose extending `CoreWebView2FrameInfo` to include `FrameId`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we're extending CoreWebView2ProcessInfo itself, results from existing GetProcessInfos() calls will start having an empty AssociatedFrameInfos property. GetProcessInfosWithDetails results may have empty results. Is it up the app developer to keep track of when the property is real vs inert?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Potential Option
GetProcessInfo: Light weight data
GetProcessInfoExtended(Async): Heavy data like AssociatedFrameInfos.
wil::com_ptr<ICoreWebView2FrameInfo> frameInfo); | ||
std::wstring FrameKindToString(COREWEBVIEW2_FRAME_KIND kind); | ||
|
||
// Display renderer process info with details which includes the list of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right now "Details" specifically means AssociatedFrameInfos. If we add more new optional details, will they also be populated by calls to GetProcessInfosWithDetails, or would there be a new method to opt into even more specific information?
(I infer they'd be populated in calls to GetProcessInfosWithDetails, otherwise we'd name this method GetProcessInfosWithFramesInfo to avoid boxing out future method names.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a tangible example for when this comment is discussed - We can theoretically have renderer processes for service workers that don't have an active frame.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Considered we may provide more information for the processInfo. We'd like to extend CoreWebView2ProcessInfo
to have more Associated...Info instead of adding more CoreWebView2Environment.GetProcessInfosWith...Info
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Returning the sparsely populated Infos is confusing. Could the associated info be a getter method? As in: CoreWebView2ProcessInfo.GetAssociatedFrameInfos()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above
/// Note that `FrameId` may not be valid if `CoreWebView` has not done | ||
/// any navigation. It's safe to get this value during or after the first | ||
/// `ContentLoading` event. Otherwise, it could return the invalid frame Id 0. | ||
[propget] HRESULT FrameId([out, retval] UINT32* id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will developers want the Frame instead of FrameId value? How often will developers want to use this id to lookup a CoreWebView2Frame, or is the common case to log this for diagnostics?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For memory monitoring cases, we expect developers not only want to acquire resource consumption for the frame tree, but also have chance to take further operations for the corresponding CoreWebView2/CoreWebView2Frame. Not sure how often it is, but it's a requirement for our existing customers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No change: We will want to do this in the future but its complicated and not required for this spec now.
specs/FrameProcesssInfo.md
Outdated
|
||
# Description | ||
* We propose extending `CoreWebView2Environment` to include the | ||
`GetProcessInfosWithDetails` API. This asynchronous call returns a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirming, getting these frame details needs to be async? Is it expensive on the level of network or large-file access because of the multi-process model behind WV2?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can be expensive on the level of network when navigating across pages with child frames.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In those cases, there could be a lot frame created/deleted message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussion: yes, it's async because it can be slow
specs/FrameProcesssInfo.md
Outdated
|
||
# Description | ||
* We propose extending `CoreWebView2Environment` to include the | ||
`GetProcessInfosWithDetails` API. This asynchronous call returns a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent naming GetProcessInfosWithDetails here and GetProcessInfosWithDetailsAsync further down.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussion: the IDL projection has the "Async" suffix, the COM doesn't, which is pattern
/// `CoreWebView2FrameInfo` objects obtained via `CoreWebView2.ProcessFailed` will | ||
/// always have a `null` `ParentFrameInfo`. This property is also `null` for the | ||
/// top most document in the WebView2 which has no parent frame. | ||
/// Note that this `ParentFrameInfo` could be out of date as it's a snapshot. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How are developers expected to check if this frame info is out of date? Track whether the ICoreWebView2Frame with same ID was destroyed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Developers can check if the frame info is up-to-date by ID, but it's only limited on CoreWebView2 and first sub layer Iframe CoreWebViewFrame. Developers will make their own strategies to call this API. For example, I've heard a customer will check it periodically.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please document: does the snapshot correspond to when the call is made or when the call completes? And note you can use frame created/destroyed to know if the snapshot will correspond to the live data on CoreWebView2(Frame)
specs/FrameProcesssInfo.md
Outdated
`GetProcessInfosWithDetails` API. This asynchronous call returns a | ||
snapshot collection of `ProcessInfo`s corresponding to all currently | ||
running processes associated with this `ICoreWebView2Environment` | ||
except for crashpad process. This provide the same list of `ProcessInfo`s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is "except for crashpad process" true for current GetProcessInfos
? Not mentioned in the doc page
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider: update public doc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JosephJin0815 Can you open a DevEco bug to update the GetProcessInfos docs to include this note?
return L#kindValue; | ||
|
||
KIND_ENTRY(COREWEBVIEW2_FRAME_KIND_MAIN_FRAME); | ||
KIND_ENTRY(COREWEBVIEW2_FRAME_KIND_IFRAME); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Naming: I thought we'd decided at some point to consistently use "frame" rather than "iframe" because no one remembers framesets anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No change. This is intentional. We have different kinds of frames one of which is an iframe.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussion: This is "iframe" to distinguish it from other kinds of frames like main frame (which isn't an iframe) and future such as fenced frame
wil::com_ptr<ICoreWebView2FrameInfo> frameInfo); | ||
std::wstring FrameKindToString(COREWEBVIEW2_FRAME_KIND kind); | ||
|
||
// Display renderer process info with details which includes the list of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Returning the sparsely populated Infos is confusing. Could the associated info be a getter method? As in: CoreWebView2ProcessInfo.GetAssociatedFrameInfos()
?
specs/FrameProcesssInfo.md
Outdated
CHECK_FAILURE( | ||
processInfo->QueryInterface(IID_PPV_ARGS(&processInfo2))); | ||
wil::com_ptr<ICoreWebView2FrameInfoCollection> frameInfoCollection; | ||
CHECK_FAILURE(processInfo2->get_AssociatedFrameInfos( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or CoreWebView2ProcessInfo.GetAssociatedFrameInfos()
?
specs/FrameProcesssInfo.md
Outdated
[v1_enum] | ||
typedef enum COREWEBVIEW2_FRAME_KIND { | ||
/// Indicates that the frame is type of frame we don't differentiate yet. | ||
COREWEBVIEW2_FRAME_KIND_OTHER, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have we written down some kind of a philosophy/strategy on API compat for WebView?
specs/FrameProcesssInfo.md
Outdated
/// A continuation of the ICoreWebView2FrameInfo interface. | ||
[uuid(a7a7e150-e2ca-11ed-b5ea-0242ac120002), object, pointer_default(unique)] | ||
interface ICoreWebView2FrameInfo2 : ICoreWebView2FrameInfo { | ||
/// This frame's parent frame's `FrameInfo`. `ParentFrameInfo` will only be |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// This frame's parent frame's `FrameInfo`. `ParentFrameInfo` will only be | |
/// This parent frame's `FrameInfo`. `ParentFrameInfo` will only be | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix
specs/FrameProcesssInfo.md
Outdated
[propget] HRESULT ParentFrameInfo([out, retval] ICoreWebView2FrameInfo** frameInfo); | ||
/// The unique identifier of the frame associated with the current `FrameInfo`. | ||
/// It's the same kind of ID as with the `FrameId` in `CoreWebView2` and via | ||
/// `CoreWebView2Frame`. `FrameId` will only be populated when obtained |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// `CoreWebView2Frame`. `FrameId` will only be populated when obtained | |
/// `CoreWebView2Frame`. `FrameId` will only be populated (non-zero) when obtained | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix.
specs/FrameProcesssInfo.md
Outdated
/// A continuation of the ICoreWebView2_17 interface. | ||
[uuid(ad712504-a66d-11ed-afa1-0242ac120002), object, pointer_default(unique)] | ||
interface ICoreWebView2_18 : ICoreWebView2_17 { | ||
/// The unique identifier of the current frame. It's the same kind of ID as with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does "current frame" mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix: say "main frame" instead.
also can be used to build the frame tree represented by `FrameInfo`s. | ||
|
||
# Examples | ||
C++ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason the sample isn't C++/WinRT?
specs/FrameProcesssInfo.md
Outdated
CHECK_FAILURE(frameInfo2->get_FrameId(&firstLevelFrameId)); | ||
} | ||
|
||
result << L"{frame name:" << name << L" | frame Id:" << std::to_wstring(frameId) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix
specs/FrameProcesssInfo.md
Outdated
std::wstring ProcessComponent::FrameKindToString(const COREWEBVIEW2_FRAME_KIND kind) | ||
{ | ||
switch (kind) | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix
return L#kindValue; | ||
|
||
KIND_ENTRY(COREWEBVIEW2_FRAME_KIND_MAIN_FRAME); | ||
KIND_ENTRY(COREWEBVIEW2_FRAME_KIND_IFRAME); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No change. This is intentional. We have different kinds of frames one of which is an iframe.
specs/FrameProcesssInfo.md
Outdated
[v1_enum] | ||
typedef enum COREWEBVIEW2_FRAME_KIND { | ||
/// Indicates that the frame is type of frame we don't differentiate yet. | ||
COREWEBVIEW2_FRAME_KIND_OTHER, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change Other -> Unknown, and update documentation to explain compat situation.
specs/FrameProcesssInfo.md
Outdated
[v1_enum] | ||
typedef enum COREWEBVIEW2_FRAME_KIND { | ||
/// Indicates that the frame is type of frame we don't differentiate yet. | ||
COREWEBVIEW2_FRAME_KIND_OTHER, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above
specs/FrameProcesssInfo.md
Outdated
/// A continuation of the ICoreWebView2FrameInfo interface. | ||
[uuid(a7a7e150-e2ca-11ed-b5ea-0242ac120002), object, pointer_default(unique)] | ||
interface ICoreWebView2FrameInfo2 : ICoreWebView2FrameInfo { | ||
/// This frame's parent frame's `FrameInfo`. `ParentFrameInfo` will only be |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix
/// `CoreWebView2FrameInfo` objects obtained via `CoreWebView2.ProcessFailed` will | ||
/// always have a `null` `ParentFrameInfo`. This property is also `null` for the | ||
/// top most document in the WebView2 which has no parent frame. | ||
/// Note that this `ParentFrameInfo` could be out of date as it's a snapshot. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please document: does the snapshot correspond to when the call is made or when the call completes? And note you can use frame created/destroyed to know if the snapshot will correspond to the live data on CoreWebView2(Frame)
specs/FrameProcesssInfo.md
Outdated
[propget] HRESULT ParentFrameInfo([out, retval] ICoreWebView2FrameInfo** frameInfo); | ||
/// The unique identifier of the frame associated with the current `FrameInfo`. | ||
/// It's the same kind of ID as with the `FrameId` in `CoreWebView2` and via | ||
/// `CoreWebView2Frame`. `FrameId` will only be populated when obtained |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix.
specs/FrameProcesssInfo.md
Outdated
/// A continuation of the ICoreWebView2_17 interface. | ||
[uuid(ad712504-a66d-11ed-afa1-0242ac120002), object, pointer_default(unique)] | ||
interface ICoreWebView2_18 : ICoreWebView2_17 { | ||
/// The unique identifier of the current frame. It's the same kind of ID as with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix: say "main frame" instead.
/// Note that `FrameId` may not be valid if `CoreWebView` has not done | ||
/// any navigation. It's safe to get this value during or after the first | ||
/// `ContentLoading` event. Otherwise, it could return the invalid frame Id 0. | ||
[propget] HRESULT FrameId([out, retval] UINT32* id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No change: We will want to do this in the future but its complicated and not required for this spec now.
This is a review for the new FrameProcessInfo API.