Bug 155389 - When generating Objective-C protocol types, getters for objects need to synthesize a new object instance
Summary: When generating Objective-C protocol types, getters for objects need to synth...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: BJ Burg
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2016-03-11 23:32 PST by BJ Burg
Modified: 2016-03-12 19:48 PST (History)
12 users (show)

See Also:


Attachments
Proposed Fix (29.35 KB, patch)
2016-03-12 00:29 PST, BJ Burg
no flags Details | Formatted Diff | Diff
Proposed Fix (47.91 KB, patch)
2016-03-12 00:42 PST, BJ Burg
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description BJ Burg 2016-03-11 23:32:02 PST
The current code does this (for example):

- (AutomationPoint *)origin
{
    return (AutomationPoint *)[super objectForKey:@"origin"];
}

However, at runtime the class of self is going to be RWIProtocolJSONObject *, not AutomationPoint *, so any subsequent calls to AutomationPoint properties on the return value will fail as the selectors will not be recognized.

Instead of doing a C-style pointer cast, we need to create a new AutomationPoint object that's backed by the InspectorObject retrieved from the parent object by key. This requires a new initWithXXX initializer for each object protocol type.
Comment 1 Radar WebKit Bug Importer 2016-03-11 23:33:43 PST
<rdar://problem/25125821>
Comment 2 BJ Burg 2016-03-12 00:29:50 PST
Created attachment 273819 [details]
Proposed Fix
Comment 3 WebKit Commit Bot 2016-03-12 00:30:50 PST
This patch modifies the inspector protocol generator. Please ensure that you have rebaselined any generator test results (i.e., by running `Tools/Scripts/run-inspector-generator-tests --reset-results`)
Comment 4 BJ Burg 2016-03-12 00:42:37 PST
Created attachment 273821 [details]
Proposed Fix
Comment 5 BJ Burg 2016-03-12 00:43:05 PST
Comment on attachment 273821 [details]
Proposed Fix

Wrong bug#.
Comment 6 WebKit Commit Bot 2016-03-12 19:48:43 PST
Comment on attachment 273819 [details]
Proposed Fix

Clearing flags on attachment: 273819

Committed r198077: <http://trac.webkit.org/changeset/198077>
Comment 7 WebKit Commit Bot 2016-03-12 19:48:48 PST
All reviewed patches have been landed.  Closing bug.