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

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

Issue 1308113008: OOPIFs: Transitioning Get/Send...SavableResourceLinks away from RenderViewHost. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@page-serialization-test
Patch Set: Addressed most of CR feedback from Nasko. 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
Index: content/browser/download/save_package.h
diff --git a/content/browser/download/save_package.h b/content/browser/download/save_package.h
index 071a5b7adead60a4eebbad9f4208bd2b957dd38d..ca77da5bd2a26898afca710e0e421d8aeb5e881f 100644
--- a/content/browser/download/save_package.h
+++ b/content/browser/download/save_package.h
@@ -146,7 +146,8 @@ class CONTENT_EXPORT SavePackage
void DoSavingProcess();
// WebContentsObserver implementation.
- bool OnMessageReceived(const IPC::Message& message) override;
+ bool OnMessageReceived(const IPC::Message&) override;
nasko 2015/09/03 18:17:02 Why did these methods lose the parameter name? Chr
Łukasz Anforowicz 2015/09/03 19:41:24 Because I saw this practice in Blink and thought t
+ bool OnMessageReceived(const IPC::Message&, RenderFrameHost* source) override;
nasko 2015/09/03 18:17:02 nit: Let's keep the parameter name consistent, s/s
Łukasz Anforowicz 2015/09/03 19:41:24 I think that "source" is a better parameter name,
nasko 2015/09/04 16:03:21 In general, the Chrome codebase tries to be consis
Łukasz Anforowicz 2015/09/08 16:23:21 Ok, I've renamed to reuse the name picked by the b
// DownloadItem::Observer implementation.
void OnDownloadDestroyed(DownloadItem* download) override;
@@ -175,9 +176,17 @@ class CONTENT_EXPORT SavePackage
bool need_html_ext,
base::FilePath::StringType* generated_name);
- // Get all savable resource links from current web page, include main
- // frame and sub-frame.
- void GetAllSavableResourceLinksForCurrentPage();
+ // Set of methods to get all savable resource links from current web page,
+ // including main frame and sub-frames.
+ void GetSavableResourceLinksForCurrentPage();
+ void GetSavableResourceLinksForFrame(RenderFrameHost* target);
+ void OnSavableResourceLinksResponse(
+ RenderFrameHost* source,
+ const std::vector<GURL>& resources_list,
+ const std::vector<Referrer>& referrers_list);
+ void OnSavableResourceLinksError(RenderFrameHost* source);
+ 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();
@@ -202,10 +211,6 @@ class CONTENT_EXPORT SavePackage
const base::FilePath& final_name,
SavePageType type,
const SavePackageDownloadCreatedCallback& cb);
- void OnReceivedSavableResourceLinksForCurrentPage(
- const std::vector<GURL>& resources_list,
- const std::vector<Referrer>& referrers_list,
- const std::vector<GURL>& frames_list);
void OnReceivedSerializedHtmlData(const GURL& frame_url,
const std::string& data,
@@ -261,6 +266,12 @@ class CONTENT_EXPORT SavePackage
// A queue for items we are about to start saving.
SaveItemQueue waiting_item_queue_;
+ // Used to de-dupe urls that are being gathered into |waiting_item_queue_|.
+ std::set<GURL> unique_urls_to_save_;
+
+ // Number of pending FrameMsg_GetSavableResourceLinks without a response.
+ int number_of_frames_with_pending_get_savable_resource_links_;
nasko 2015/09/03 18:17:02 I wonder if we can name this a bit shorter. Do we
Łukasz Anforowicz 2015/09/03 19:41:24 We will probably need something equivalent for per
nasko 2015/09/04 16:03:21 The latter message will likely need it. The questi
Łukasz Anforowicz 2015/09/08 16:23:21 Ah, makes sense. Each instance of SavePackage onl
+
typedef base::hash_map<int32, SaveItem*> SavedItemMap;
// saved_success_items_ is map of all saving job which are successfully saved.
SavedItemMap saved_success_items_;

Powered by Google App Engine
This is Rietveld 408576698