Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1198)

Unified Diff: content/browser/download/save_package.h

Issue 1320453004: OOPIFs: Moving GetSerializedHtmlData...WithLocalLinks away from RenderViewHost. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@page-serialization-link-gathering
Patch Set: Rebasing... Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/download/save_file_manager.cc ('k') | content/browser/download/save_package.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/download/save_package.h
diff --git a/content/browser/download/save_package.h b/content/browser/download/save_package.h
index b96d2ee5d5b44cec26336a5ddc3b4a427e50c7ba..818ad5bf524a7523393af4f2389dd1082cdfe424 100644
--- a/content/browser/download/save_package.h
+++ b/content/browser/download/save_package.h
@@ -146,7 +146,6 @@ class CONTENT_EXPORT SavePackage
void DoSavingProcess();
// WebContentsObserver implementation.
- bool OnMessageReceived(const IPC::Message& message) override;
bool OnMessageReceived(const IPC::Message& message,
RenderFrameHost* render_frame_host) override;
@@ -179,7 +178,7 @@ class CONTENT_EXPORT SavePackage
// Set of methods to get all savable resource links from current web page,
// including main frame and sub-frames.
- void GetSavableResourceLinksForCurrentPage();
+ void GetSavableResourceLinks();
void GetSavableResourceLinksForFrame(RenderFrameHost* target);
void OnSavableResourceLinksResponse(
RenderFrameHost* sender,
@@ -187,11 +186,35 @@ class CONTENT_EXPORT SavePackage
const std::vector<GURL>& resources_list,
const std::vector<Referrer>& referrers_list);
void OnSavableResourceLinksError(RenderFrameHost* sender);
- void CompleteSavableResourceLinksResponseFromFrame();
-
- // Get html data by serializing all frames of current page with lists
- // which contain all resource links that have local copy.
- void GetSerializedHtmlDataForCurrentPageWithLocalLinks();
+ void CompleteSavableResourceLinksResponse();
+
+ // For each frame in the current page, ask the renderer process associated
+ // with that frame to serialize that frame into html.
+ void GetSerializedHtmlWithLocalLinks();
+
+ // Ask renderer process to serialize |target| frame into html data
+ // with lists which contain all resource links that have a local copy.
+ // - The parameter |saved_links| contains original URLs of all saved links
+ // (which may include URLs referred to from the whole page (not just from
+ // the |target| frame).
+ // - The parameter |saved_file_paths| contains corresponding local file paths
+ // of all saved links, which is matched with |saved_links| vector one by
+ // one.
+ // - The parameter |relative_dir_name| is relative path of directory which
+ // contain all saved auxiliary files included all sub frames and resouces.
+ void GetSerializedHtmlWithLocalLinksForFrame(
+ const std::vector<GURL>& saved_links,
+ const std::vector<base::FilePath>& saved_file_paths,
+ const base::FilePath& relative_dir_name,
+ RenderFrameHost* target);
+
+ // Routes html data (sent by renderer process in response to
+ // GetSerializedHtmlWithLocalLinksForFrame above) to the associated local file
+ // (and also keeps track of when all frames have been completed).
+ void OnSerializedHtmlWithLocalLinksResponse(RenderFrameHost* sender,
+ const GURL& frame_url,
+ const std::string& data,
+ int32 status);
// Look up SaveItem by save id from in progress map.
SaveItem* LookupItemInProcessBySaveId(int32 save_id);
@@ -214,10 +237,6 @@ class CONTENT_EXPORT SavePackage
SavePageType type,
const SavePackageDownloadCreatedCallback& cb);
- void OnReceivedSerializedHtmlData(const GURL& frame_url,
- const std::string& data,
- int32 status);
-
typedef base::hash_map<std::string, SaveItem*> SaveUrlItemMap;
// in_progress_items_ is map of all saving job in in-progress state.
SaveUrlItemMap in_progress_items_;
« no previous file with comments | « content/browser/download/save_file_manager.cc ('k') | content/browser/download/save_package.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698