[Site Isolation] WebFrameProxy children manipulation and BFCache caching foundations
Component: WebKit Site Isolation | e16931a
Site Isolation 환경에서는 cross-site iframe이 웹 프로세스 내에서 RemoteFrame 객체로 표현되고, UI 프로세스가 RemotePageProxy와 BrowsingContextGroup을 통해 이들을 조율합니다. BFCache는 페이지의 suspend 상태 전체를, 즉 DOM과 JS 실행 상태, 프레임 트리까지 보존하기 때문에 뒤로/앞으로 navigation이 즉시 이루어질 수 있습니다. 다만 cross-site iframe이 포함된 페이지는 별도의 iframe 프로세스들을 suspend하고 resume하는 과정을 UI 프로세스가 직접 orchestration해야 하며, in-process BFCache 경로만으로는 이 작업을 처리할 수 없습니다. 이번 commit은 이를 위한 배관 작업에 해당합니다. WebFrameProxy에는 subframe subtree를 분리하고 재부착하는 takeChildFrames/adoptChildFrames가 추가되었고, WebBackForwardCacheEntry에는 setCachedChildren/takeCachedChildren/hasCachedChildren/referencesIframeProcess로 구성된 cached-children slot이 추가되었습니다. 또한 FrameTree::hasRemoteFrameDescendant()가 기존에 BackForwardCache.cpp에 국한되어 있던 static helper를 대체합니다. WebBackForwardCache::removeEntriesForProcess는 이제 referencesIframeProcess를 호출하여, 캐시된 subtree가 종료된 iframe 프로세스를 참조하는 항목을 무효화합니다.
Significance
현재로서는 foundation 단계에 그칩니다. 새로 추가된 removeEntriesForProcess 체크는 향후 patch가 m_cachedChildren을 채우기 전까지는 사실상 no-op이며, 아직 도달 가능한 동작 변화는 없습니다. hasRemoteFrameDescendant의 위치 이전은 동등한 semantics을 유지하는 단순한 리팩터링에 해당합니다.
Audit directions
아직 유의미한 공격 대상은 아닙니다. takeChildFrames/adoptChildFrames와 cached-children slot은 이를 채우는 호출 지점이 없어 도달 불가능한 상태입니다. Orchestration patch가 반영되면 다시 살펴볼 가치가 있습니다. BFCache suspend와 restore 과정에서 cross-process ownership을 넘기며 subtree를 분리하고 재부착하는 구조는, use-after-free나 double-reparenting 버그가 숨기 딱 좋은 형태이기 때문입니다. 그 전까지는, 새 API를 공유하게 될 기존 프레임 트리 변경 경로들을 점검하는 편이 현실적인 접근입니다. 프로세스 종료나 provisional-navigation rollback 상황에서 WebFrameProxy를 reparent하는 현재의 모든 호출 지점을 점검하고, transfer 도중 어느 쪽이 strong reference를 쥐고 있는지 확인할 필요가 있습니다. 매치 단서: take/adopt 쌍 사이의 간격이 프로세스 종료 콜백까지 걸쳐 있는 경우입니다.