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

Unified Diff: extensions/browser/updater/safe_manifest_parser.h

Issue 2699663003: Convert utility process extension ParseUpdate IPC to mojo (Closed)
Patch Set: Sync to ToT, see if git apply issue and try jobs are happy. 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: extensions/browser/updater/safe_manifest_parser.h
diff --git a/extensions/browser/updater/safe_manifest_parser.h b/extensions/browser/updater/safe_manifest_parser.h
index 3f852fe68a579ce08a240a5aa5a5ef934c1259c5..4f4315884263af460549772092dedc340c924ffb 100644
--- a/extensions/browser/updater/safe_manifest_parser.h
+++ b/extensions/browser/updater/safe_manifest_parser.h
@@ -5,49 +5,18 @@
#ifndef EXTENSIONS_BROWSER_UPDATER_SAFE_MANIFEST_PARSER_H_
#define EXTENSIONS_BROWSER_UPDATER_SAFE_MANIFEST_PARSER_H_
-#include <memory>
#include <string>
-#include "base/callback.h"
-#include "base/macros.h"
-#include "content/public/browser/utility_process_host_client.h"
-#include "extensions/browser/updater/manifest_fetch_data.h"
+#include "base/callback_forward.h"
#include "extensions/common/update_manifest.h"
namespace extensions {
-// Utility class to handle doing xml parsing in a sandboxed utility process.
-class SafeManifestParser : public content::UtilityProcessHostClient {
- public:
- // Callback that is invoked when the manifest results are ready.
- typedef base::Callback<void(const UpdateManifest::Results*)> ResultsCallback;
-
- SafeManifestParser(const std::string& xml,
- const ResultsCallback& results_callback);
-
- // Posts a task over to the IO loop to start the parsing of xml_ in a
- // utility process.
- void Start();
-
- private:
- ~SafeManifestParser() override;
-
- // Creates the sandboxed utility process and tells it to start parsing.
- void ParseInSandbox();
-
- // content::UtilityProcessHostClient implementation.
- bool OnMessageReceived(const IPC::Message& message) override;
-
- void OnParseUpdateManifestSucceeded(const UpdateManifest::Results& results);
- void OnParseUpdateManifestFailed(const std::string& error_message);
-
- const std::string xml_;
-
- // Should be accessed only on UI thread.
- ResultsCallback results_callback_;
-
- DISALLOW_COPY_AND_ASSIGN(SafeManifestParser);
-};
+// Parses an update manifest |xml| safely in a utility process and calls
+// |callback| with the results. Runs on the UI thread.
+void ParseUpdateManifest(
+ const std::string& xml,
+ const base::Callback<void(const UpdateManifest::Results*)>& callback);
} // namespace extensions
« no previous file with comments | « extensions/browser/updater/extension_downloader.cc ('k') | extensions/browser/updater/safe_manifest_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698