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

Unified Diff: chrome/browser/android/offline_pages/prerendering_offliner.h

Issue 2683493002: Get signals working in the EXTRA_DATA section of MHTML (Closed)
Patch Set: Approach for writing to the file afterwards instead. Created 3 years, 10 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: chrome/browser/android/offline_pages/prerendering_offliner.h
diff --git a/chrome/browser/android/offline_pages/prerendering_offliner.h b/chrome/browser/android/offline_pages/prerendering_offliner.h
index 9b1104cc57c095584df446246558d7c27dbe1107..fdfaa88a75e06c90be5c4aa6272e93b0c2b9bd30 100644
--- a/chrome/browser/android/offline_pages/prerendering_offliner.h
+++ b/chrome/browser/android/offline_pages/prerendering_offliner.h
@@ -8,6 +8,7 @@
#include <memory>
#include "base/android/application_status_listener.h"
+#include "base/files/file_path.h"
#include "base/memory/weak_ptr.h"
#include "chrome/browser/android/offline_pages/prerendering_loader.h"
#include "components/offline_pages/core/background/offliner.h"
@@ -69,7 +70,8 @@ class PrerenderingOffliner : public Offliner {
// Callback logic for OfflinePageModel::SavePage().
void OnSavePageDone(const SavePageRequest& request,
SavePageResult save_result,
- int64_t offline_id);
+ int64_t offline_id,
+ const base::FilePath& saved_filepath);
PrerenderingLoader* GetOrCreateLoader();
@@ -77,6 +79,21 @@ class PrerenderingOffliner : public Offliner {
void OnApplicationStateChange(
base::android::ApplicationState application_state);
+ // Transfer over to the FileThread, and call AppendSignalData from there.
+ void AppendSignalDataOnFileThread(const base::FilePath& file_path);
+
+ // Add signal data to the end of the MHTML file.
+ void AppendSignalData(const base::FilePath& filename);
+
+ // TODO: Find a standard function to replace this with.
fgorski 2017/03/08 18:56:43 std::isspace ?
+ static bool IsWhitespace(char next);
+
+ // Return the file position just before the two dashes.
+ static int64_t PositionBeforeTwoDashes(base::File& saved_file);
+
+ // Parse the boundary string from a MHTML file
+ static std::string GetBoundaryStringFromFile(base::File& saved_file);
+
// Not owned.
content::BrowserContext* browser_context_;
// Not owned.

Powered by Google App Engine
This is Rietveld 408576698