Chromium Code Reviews
DescriptionABANDONED CL - REPLACED WITH crrev.com/1413103003
OOPIFs: Moving stitching of local paths from renderer to browser process.
Context
=======
Save-Page-As in complete-html mode replaces links to subframes and
savable resources (i.e. img elements) with paths to locally saved files.
This replacement used to be done in the renderer process, but has to be
moved to the browser process, because with OOP iframes renderer process
is not able to look into any data belonging to subframes living in
another process (and "any data" covers URLs of subframes or lists of
resources contained in subframes).
Before this CL, saving (as complete html) a page with cross-site iframes in
OOPIFs mode would crash the renderer process. After this CL there is no crash
(and the test in save_page_browsertest.cc should prevent regressions).
IPC Messages
============
This CL replaces the following 2 IPC messages:
IPC_MESSAGE_ROUTED3(FrameMsg_GetSerializedHtmlWithLocalLinks,
std::vector<GURL> /* urls that have local copy */,
std::vector<base::FilePath> /* paths of local copy */,
base::FilePath /* local directory path */)
IPC_MESSAGE_ROUTED3(FrameHostMsg_SerializedHtmlWithLocalLinksResponse,
GURL /* frame URL */,
std::string /* data buffer */,
int32 /* complete status */)
with the following 5 IPC messages:
IPC_MESSAGE_ROUTED0(FrameMsg_GetSerializedHtmlWithLocalLinks);
IPC_MESSAGE_ROUTED1(FrameHostMsg_SerializedHtmlFragment,
std::string /* data buffer */);
IPC_MESSAGE_ROUTED1(FrameHostMsg_SerializedLocalPathForChildFrame,
int /* RenderFrame's or RenderFrameProxy's routing id
for the child frame we need a local path for.*/);
IPC_MESSAGE_ROUTED1(FrameHostMsg_SerializedLocalPathForSavableResource,
GURL /* savable resource link */);
IPC_MESSAGE_ROUTED0(FrameHostMsg_SerializedEndOfFrame)
Notice that
- Urls and local paths are no longer passed from browser to renderer
processes.
- Renderer responses have been split into more granular responses (html
fragment, local path for subresource, local path for child frame, end
of data).
All the other changes in the CL are a consequence of the IPC change outlined above.
Other notes
===========
Mapping frames and subframes to SaveItems is done via frame_tree_node_id.
Note that the old WebPageSerializerImpl code [1] did *not* escape file paths
embedded in serializer output as html attribute values. The current CL
preserves this behavior (in SavePackage::SerializeLocalPathForSaveItem).
[1] https://chromium.googlesource.com/chromium/blink/+/9d8944796d0b1208175177cda807910385f09d0b/Source/web/WebPageSerializerImpl.cpp#332
BUG=526786
Patch Set 1 #Patch Set 2 : Self-review. #
Total comments: 5
Patch Set 3 : Rebasing... #
Total comments: 4
Patch Set 4 : Addressed Daniel's feedback + fixed issues uncovered by crrev.com/1362973003. #Patch Set 5 : Rebasing... #
Total comments: 8
Patch Set 6 : Addressed 2nd round of Daniel's feedback. #Patch Set 7 : Removed no longer needed WebKit dependency. #
Total comments: 46
Patch Set 8 : Addressed CR feedback from Nick (except escaping issue). #Patch Set 9 : Addressing one more CR comment (missed in previous snapshot). #Patch Set 10 : Rebasing... #
Total comments: 2
Patch Set 11 : Escaping of HTML attributes (+ some comment tweaks). #Patch Set 12 : Rebasing... #Messages
Total messages: 17 (4 generated)
|