Bug 45604

Summary: Add callback mechanism for the getting the source of a frame
Product: WebKit Reporter: Sam Weinig <sam>
Component: WebKit2Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: webkit.review.bot
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   
Attachments:
Description Flags
Patch mitz: review+

Sam Weinig
Reported 2010-09-11 17:55:51 PDT
Add callback mechanism for the getting the source of a frame
Attachments
Patch (21.60 KB, patch)
2010-09-11 18:02 PDT, Sam Weinig
mitz: review+
Sam Weinig
Comment 1 2010-09-11 17:56:43 PDT
Sam Weinig
Comment 2 2010-09-11 18:02:18 PDT
Created attachment 67321 [details] Patch In addition to this approach, we may want the ability to tell WebKit to open up a new WKView with the source thus avoiding two potential copies of the source over the wire.
WebKit Review Bot
Comment 3 2010-09-11 18:03:22 PDT
Attachment 67321 [details] did not pass style-queue: Failed to run "['WebKitTools/Scripts/check-webkit-style']" exit_code: 1 WebKit2/UIProcess/API/C/WKPage.cpp:260: WKPageGetSourceForFrame_b is incorrectly named. Don't use underscores in your identifier names. [readability/naming] [4] Total errors found: 1 in 15 files If any of these errors are false positives, please file a bug against check-webkit-style.
mitz
Comment 4 2010-09-11 18:13:16 PDT
Comment on attachment 67321 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=67321&action=prettypatch > WebKit2/UIProcess/WebPageProxy.cpp:1177 > + Vector<RefPtr<FrameSourceCallback> > frameSourceCallbacks; > + copyValuesToVector(m_frameSourceCallbacks, frameSourceCallbacks); > + m_frameSourceCallbacks.clear(); > + for (size_t i = 0, size = frameSourceCallbacks.size(); i < size; ++i) > + frameSourceCallbacks[i]->invalidate(); > + Consider factoring common code out of processDidExit() and close(). > WebKit2/UIProcess/WebPageProxy.h:82 > typedef GenericCallback<WKStringRef, WTF::StringImpl*> RenderTreeExternalRepresentationCallback; > typedef GenericCallback<WKStringRef, WTF::StringImpl*> ScriptReturnValueCallback; > +typedef GenericCallback<WKStringRef, WTF::StringImpl*> FrameSourceCallback; > Maybe keep these sorted? > WebKit2/UIProcess/WebPageProxy.h:243 > > void didReceiveEvent(WebEvent::Type); > + > void didRunJavaScriptInMainFrame(const WTF::String&, uint64_t); Why the new newline?
Sam Weinig
Comment 5 2010-09-11 18:16:15 PDT
(In reply to comment #4) > (From update of attachment 67321 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=67321&action=prettypatch > > > WebKit2/UIProcess/WebPageProxy.cpp:1177 > > + Vector<RefPtr<FrameSourceCallback> > frameSourceCallbacks; > > + copyValuesToVector(m_frameSourceCallbacks, frameSourceCallbacks); > > + m_frameSourceCallbacks.clear(); > > + for (size_t i = 0, size = frameSourceCallbacks.size(); i < size; ++i) > > + frameSourceCallbacks[i]->invalidate(); > > + > Consider factoring common code out of processDidExit() and close(). Considered, but not doing it in this patch. > > WebKit2/UIProcess/WebPageProxy.h:82 > > typedef GenericCallback<WKStringRef, WTF::StringImpl*> RenderTreeExternalRepresentationCallback; > > typedef GenericCallback<WKStringRef, WTF::StringImpl*> ScriptReturnValueCallback; > > +typedef GenericCallback<WKStringRef, WTF::StringImpl*> FrameSourceCallback; > > > Maybe keep these sorted? Ok. > > > WebKit2/UIProcess/WebPageProxy.h:243 > > > > void didReceiveEvent(WebEvent::Type); > > + > > void didRunJavaScriptInMainFrame(const WTF::String&, uint64_t); > Why the new newline? Paragraphing.
Sam Weinig
Comment 6 2010-09-11 18:18:08 PDT
Fixed in r67311.
Note You need to log in before you can comment on or make changes to this bug.