Chromium Code Reviews| 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..52544fb22389dc2c96003a30c0c10f6909aa0d97 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 callbcack if the utility process or metadata parse requests fail. |
|
Sam McNally
2017/01/10 06:55:14
callback
Noel Gordon
2017/01/10 22:52:36
Done.
|
| // Runs on the IO thread. |
| - void OnParseMediaMetadataFinished( |
| - bool parse_success, const base::DictionaryValue& metadata_dictionary, |
| + void ParseMediaMetadataFailed(); |
| + |
| + // Mojo callbcack from utility process when it finishes parsing metadata. |
|
Sam McNally
2017/01/10 06:55:14
callback
Noel Gordon
2017/01/10 22:52:36
Done.
|
| + // 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_; |
|
Sam McNally
2017/01/10 06:55:14
Maybe mention which thread this lives on.
Noel Gordon
2017/01/10 22:52:36
Hmmm, there's a comment introducing the member var
|
| + |
| // 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_; |