Changeset 149646 in webkit
- Timestamp:
- May 6, 2013 3:49:17 PM (11 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r149644 r149646 1 2013-05-06 Alexey Proskuryakov <ap@apple.com> 2 3 <rdar://problem/13479806> [Mac] Pass information about open pages to LaunchServices 4 https://bugs.webkit.org/show_bug.cgi?id=115665 5 6 Reviewed by Darin Adler. 7 8 * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::didCommitLoad): Moved repeated 9 check for frame->isMainFrame() to the top, matching oter similar functions. 10 Call updateActivePages(). 11 12 * WebProcess/WebProcess.cpp: 13 (WebKit::WebProcess::networkProcessConnectionClosed): Removed an obsolete FIXME. 14 (WebKit::WebProcess::updateActivePages): Empty implementation for platforms 15 that don't need to do anything here. 16 17 * WebProcess/WebProcess.h: Added updateActivePages(). 18 19 * WebProcess/mac/WebProcessMac.mm: (WebKit::WebProcess::updateActivePages): 20 Collect user visible origins of pages in the process and pass them to LS. 21 1 22 2013-05-06 Mark Rowe <mrowe@apple.com> 2 23 -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r149561 r149646 3953 3953 void WebPage::didCommitLoad(WebFrame* frame) 3954 3954 { 3955 if (!frame->isMainFrame()) 3956 return; 3957 3955 3958 // If previous URL is invalid, then it's not a real page that's being navigated away from. 3956 3959 // Most likely, this is actually the first load to be committed in this page. 3957 if (frame-> isMainFrame() && frame->coreFrame()->loader()->previousURL().isValid())3960 if (frame->coreFrame()->loader()->previousURL().isValid()) 3958 3961 reportUsedFeatures(); 3959 3962 3960 3963 // Only restore the scale factor for standard frame loads (of the main frame). 3961 if (frame-> isMainFrame() && frame->coreFrame()->loader()->loadType() == FrameLoadTypeStandard) {3964 if (frame->coreFrame()->loader()->loadType() == FrameLoadTypeStandard) { 3962 3965 Page* page = frame->coreFrame()->page(); 3963 3966 if (page && page->pageScaleFactor() != 1) … … 3966 3969 3967 3970 #if ENABLE(PRIMARY_SNAPSHOTTED_PLUGIN_HEURISTIC) 3968 if (frame->isMainFrame()) 3969 resetPrimarySnapshottedPlugIn(); 3970 #endif 3971 resetPrimarySnapshottedPlugIn(); 3972 #endif 3973 3974 WebProcess::shared().updateActivePages(); 3971 3975 } 3972 3976 -
trunk/Source/WebKit2/WebProcess/WebProcess.cpp
r149332 r149646 1034 1034 void WebProcess::networkProcessConnectionClosed(NetworkProcessConnection* connection) 1035 1035 { 1036 // FIXME (NetworkProcess): How do we handle not having the connection when the WebProcess needs it?1037 // If the NetworkProcess crashed, for example. Do we respawn it?1038 1036 ASSERT(m_networkProcessConnection); 1039 1037 ASSERT(m_networkProcessConnection == connection); … … 1124 1122 { 1125 1123 } 1124 1125 void WebProcess::updateActivePages() 1126 { 1127 } 1128 1126 1129 #endif 1127 1130 -
trunk/Source/WebKit2/WebProcess/WebProcess.h
r148715 r149646 185 185 void pageDidEnterWindow(WebPage*); 186 186 void pageWillLeaveWindow(WebPage*); 187 187 188 188 void nonVisibleProcessCleanupTimerFired(WebCore::Timer<WebProcess>*); 189 190 void updateActivePages(); 189 191 190 192 private: -
trunk/Source/WebKit2/WebProcess/mac/WebProcessMac.mm
r149413 r149646 31 31 #import "SandboxInitializationParameters.h" 32 32 #import "WKFullKeyboardAccessWatcher.h" 33 #import "WebFrame.h" 33 34 #import "WebInspector.h" 34 35 #import "WebPage.h" … … 40 41 #import <WebCore/MemoryCache.h> 41 42 #import <WebCore/PageCache.h> 43 #import <WebCore/WebCoreNSURLExtras.h> 42 44 #import <WebKitSystemInterface.h> 43 45 #import <algorithm> … … 56 58 using namespace std; 57 59 60 const CFStringRef kLSActivePageUserVisibleOriginsKey = CFSTR("LSActivePageUserVisibleOriginsKey"); 61 58 62 namespace WebKit { 59 63 … … 221 225 } 222 226 227 void WebProcess::updateActivePages() 228 { 229 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090 230 RetainPtr<CFMutableArrayRef> activePageURLs = adoptCF(CFArrayCreateMutable(0, 0, &kCFTypeArrayCallBacks)); 231 for (const auto& iter: m_pageMap) { 232 WebPage* page = iter.value.get(); 233 WebFrame* mainFrame = page->mainWebFrame(); 234 if (!mainFrame) 235 continue; 236 String mainFrameOriginString; 237 RefPtr<SecurityOrigin> mainFrameOrigin = SecurityOrigin::createFromString(mainFrame->url()); 238 if (!mainFrameOrigin->isUnique()) 239 mainFrameOriginString = mainFrameOrigin->toRawString(); 240 else 241 mainFrameOriginString = KURL(KURL(), mainFrame->url()).protocol() + ':'; // toRawString() is not supposed to work with unique origins, and would just return "://". 242 CFArrayAppendValue(activePageURLs.get(), userVisibleString([NSURL URLWithString:mainFrameOriginString])); 243 } 244 WKSetApplicationInformationItem(kLSActivePageUserVisibleOriginsKey, activePageURLs.get()); 245 #endif 246 } 247 223 248 } // namespace WebKit
Note: See TracChangeset
for help on using the changeset viewer.