Changeset 164398 in webkit
- Timestamp:
- Feb 19, 2014 3:43:05 PM (10 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r164388 r164398 1 2014-02-19 Oliver Hunt <oliver@apple.com> 2 3 Add WK2 SPI to get bytecode profile from web process 4 https://bugs.webkit.org/show_bug.cgi?id=129069 5 6 Reviewed by Anders Carlsson. 7 8 Simple patch to allow asynchronous fetching of the 9 bytecode profiler output from the WebProcess. 10 11 * UIProcess/API/C/WKPage.cpp: 12 (WKPageGetBytecodeProfile): 13 * UIProcess/API/C/WKPagePrivate.h: 14 * UIProcess/WebPageProxy.cpp: 15 (WebKit::WebPageProxy::getBytecodeProfile): 16 * UIProcess/WebPageProxy.h: 17 * WebProcess/WebPage/WebPage.cpp: 18 (WebKit::WebPage::getBytecodeProfile): 19 * WebProcess/WebPage/WebPage.h: 20 * WebProcess/WebPage/WebPage.messages.in: 21 1 22 2014-02-19 Beth Dakin <bdakin@apple.com> 2 23 -
trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp
r164271 r164398 1505 1505 } 1506 1506 1507 void WKPageGetBytecodeProfile(WKPageRef pageRef, void* context, WKPageGetBytecodeProfileFunction callback) 1508 { 1509 toImpl(pageRef)->getBytecodeProfile(StringCallback::create(context, callback)); 1510 } 1511 1507 1512 void WKPageGetSelectionAsWebArchiveData(WKPageRef pageRef, void* context, WKPageGetSelectionAsWebArchiveDataFunction callback) 1508 1513 { -
trunk/Source/WebKit2/UIProcess/API/C/WKPagePrivate.h
r159059 r164398 91 91 WK_EXPORT void WKPageSetMayStartMediaWhenInWindow(WKPageRef page, bool mayStartMedia); 92 92 93 typedef void (*WKPageGetBytecodeProfileFunction)(WKStringRef, WKErrorRef, void*); 94 WK_EXPORT void WKPageGetBytecodeProfile(WKPageRef page, void* context, WKPageGetBytecodeProfileFunction function); 95 93 96 WK_EXPORT WKArrayRef WKPageCopyRelatedPages(WKPageRef page); 94 97 -
trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp
r164382 r164398 1975 1975 } 1976 1976 1977 void WebPageProxy::getBytecodeProfile(PassRefPtr<StringCallback> prpCallback) 1978 { 1979 RefPtr<StringCallback> callback = prpCallback; 1980 if (!isValid()) { 1981 callback->invalidate(); 1982 return; 1983 } 1984 1985 uint64_t callbackID = callback->callbackID(); 1986 m_loadDependentStringCallbackIDs.add(callbackID); 1987 m_stringCallbacks.set(callbackID, callback.get()); 1988 m_process->send(Messages::WebPage::GetBytecodeProfile(callbackID), m_pageID); 1989 } 1990 1977 1991 #if ENABLE(MHTML) 1978 1992 void WebPageProxy::getContentsAsMHTMLData(PassRefPtr<DataCallback> prpCallback, bool useBinaryEncoding) -
trunk/Source/WebKit2/UIProcess/WebPageProxy.h
r164382 r164398 666 666 667 667 void getContentsAsString(PassRefPtr<StringCallback>); 668 void getBytecodeProfile(PassRefPtr<StringCallback>); 669 668 670 #if ENABLE(MHTML) 669 671 void getContentsAsMHTMLData(PassRefPtr<DataCallback>, bool useBinaryEncoding); -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r164364 r164398 4242 4242 } 4243 4243 4244 void WebPage::getBytecodeProfile(uint64_t callbackID) 4245 { 4246 ASSERT(JSDOMWindow::commonVM()->m_perBytecodeProfiler); 4247 if (!JSDOMWindow::commonVM()->m_perBytecodeProfiler) 4248 send(Messages::WebPageProxy::StringCallback(String(), callbackID)); 4249 String result = JSDOMWindow::commonVM()->m_perBytecodeProfiler->toJSON(); 4250 ASSERT(result.length()); 4251 send(Messages::WebPageProxy::StringCallback(result, callbackID)); 4252 } 4253 4244 4254 } // namespace WebKit -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h
r164337 r164398 718 718 PassRefPtr<WebCore::DocumentLoader> createDocumentLoader(WebCore::Frame&, const WebCore::ResourceRequest&, const WebCore::SubstituteData&); 719 719 720 void getBytecodeProfile(uint64_t callbackID); 721 720 722 private: 721 723 WebPage(uint64_t pageID, const WebPageCreationParameters&); -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in
r164358 r164398 326 326 327 327 SetThumbnailScale(double scale) 328 329 GetBytecodeProfile(uint64_t callbackID) 330 328 331 }
Note: See TracChangeset
for help on using the changeset viewer.