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

Unified Diff: chrome/browser/media_galleries/fileapi/safe_media_metadata_parser.h

Issue 2615423002: Convert utility process ParseMediaMetadata IPC to mojo (Closed)
Patch Set: More review comments. Created 3 years, 11 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/media_galleries/fileapi/safe_media_metadata_parser.h
diff --git a/chrome/browser/media_galleries/fileapi/safe_media_metadata_parser.h b/chrome/browser/media_galleries/fileapi/safe_media_metadata_parser.h
index 237ba637ad0dd1dd801421cde97713e8c944a93e..dd33604372f6502320842c6aff4bd39a9bc57bc2 100644
--- a/chrome/browser/media_galleries/fileapi/safe_media_metadata_parser.h
+++ b/chrome/browser/media_galleries/fileapi/safe_media_metadata_parser.h
@@ -16,6 +16,7 @@
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "chrome/common/extensions/api/media_galleries.h"
+#include "chrome/common/extensions/media_parser.mojom.h"
#include "chrome/common/media_galleries/metadata_types.h"
#include "content/public/browser/utility_process_host.h"
#include "content/public/browser/utility_process_host_client.h"
@@ -63,10 +64,15 @@ class SafeMediaMetadataParser : public content::UtilityProcessHostClient {
// Launches the utility process. Must run on the IO thread.
void StartWorkOnIOThread(const DoneCallback& callback);
- // Notification from the utility process when it finishes parsing metadata.
+ // Mojo callback if the utility process or metadata parse requests fail.
// Runs on the IO thread.
- void OnParseMediaMetadataFinished(
- bool parse_success, const base::DictionaryValue& metadata_dictionary,
+ void ParseMediaMetadataFailed();
+
+ // Mojo callback from utility process when it finishes parsing metadata.
+ // Runs on the IO thread.
+ void ParseMediaMetadataDone(
+ bool parse_success,
+ std::unique_ptr<base::DictionaryValue> metadata_dictionary,
const std::vector<AttachedImage>& attached_images);
// Sequence of functions that bounces from the IO thread to the UI thread to
@@ -85,7 +91,6 @@ class SafeMediaMetadataParser : public content::UtilityProcessHostClient {
// UtilityProcessHostClient implementation.
// Runs on the IO thread.
- void OnProcessCrashed(int exit_code) override;
bool OnMessageReceived(const IPC::Message& message) override;
// All member variables are only accessed on the IO thread.
@@ -99,6 +104,8 @@ class SafeMediaMetadataParser : public content::UtilityProcessHostClient {
base::WeakPtr<content::UtilityProcessHost> utility_process_host_;
+ extensions::mojom::MediaParserPtr interface_;
+
// Verifies the messages from the utility process came at the right time.
// Initialized on the UI thread, but only accessed on the IO thread.
ParserState parser_state_;

Powered by Google App Engine
This is Rietveld 408576698