OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/media_galleries/fileapi/safe_media_metadata_parser.h" | 5 #include "chrome/browser/media_galleries/fileapi/safe_media_metadata_parser.h" |
6 | 6 |
| 7 #include "base/single_thread_task_runner.h" |
| 8 #include "base/thread_task_runner_handle.h" |
7 #include "chrome/browser/extensions/blob_reader.h" | 9 #include "chrome/browser/extensions/blob_reader.h" |
8 #include "chrome/common/extensions/chrome_utility_extensions_messages.h" | 10 #include "chrome/common/extensions/chrome_utility_extensions_messages.h" |
9 #include "chrome/grit/generated_resources.h" | 11 #include "chrome/grit/generated_resources.h" |
10 #include "content/public/browser/browser_thread.h" | 12 #include "content/public/browser/browser_thread.h" |
11 #include "content/public/browser/child_process_data.h" | 13 #include "content/public/browser/child_process_data.h" |
12 #include "content/public/browser/utility_process_host.h" | 14 #include "content/public/browser/utility_process_host.h" |
13 #include "ui/base/l10n/l10n_util.h" | 15 #include "ui/base/l10n/l10n_util.h" |
14 | 16 |
15 using content::BrowserThread; | 17 using content::BrowserThread; |
16 | 18 |
(...skipping 26 matching lines...) Expand all Loading... |
43 | 45 |
44 void SafeMediaMetadataParser::StartWorkOnIOThread( | 46 void SafeMediaMetadataParser::StartWorkOnIOThread( |
45 const DoneCallback& callback) { | 47 const DoneCallback& callback) { |
46 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 48 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
47 DCHECK_EQ(INITIAL_STATE, parser_state_); | 49 DCHECK_EQ(INITIAL_STATE, parser_state_); |
48 DCHECK(!callback.is_null()); | 50 DCHECK(!callback.is_null()); |
49 | 51 |
50 callback_ = callback; | 52 callback_ = callback; |
51 | 53 |
52 utility_process_host_ = content::UtilityProcessHost::Create( | 54 utility_process_host_ = content::UtilityProcessHost::Create( |
53 this, base::MessageLoopProxy::current())->AsWeakPtr(); | 55 this, base::ThreadTaskRunnerHandle::Get())->AsWeakPtr(); |
54 utility_process_host_->SetName(l10n_util::GetStringUTF16( | 56 utility_process_host_->SetName(l10n_util::GetStringUTF16( |
55 IDS_UTILITY_PROCESS_MEDIA_FILE_CHECKER_NAME)); | 57 IDS_UTILITY_PROCESS_MEDIA_FILE_CHECKER_NAME)); |
56 | 58 |
57 utility_process_host_->Send( | 59 utility_process_host_->Send( |
58 new ChromeUtilityMsg_ParseMediaMetadata(mime_type_, blob_size_, | 60 new ChromeUtilityMsg_ParseMediaMetadata(mime_type_, blob_size_, |
59 get_attached_images_)); | 61 get_attached_images_)); |
60 | 62 |
61 parser_state_ = STARTED_PARSING_STATE; | 63 parser_state_ = STARTED_PARSING_STATE; |
62 } | 64 } |
63 | 65 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 OnParseMediaMetadataFinished) | 149 OnParseMediaMetadataFinished) |
148 IPC_MESSAGE_HANDLER( | 150 IPC_MESSAGE_HANDLER( |
149 ChromeUtilityHostMsg_RequestBlobBytes, | 151 ChromeUtilityHostMsg_RequestBlobBytes, |
150 OnUtilityProcessRequestBlobBytes) | 152 OnUtilityProcessRequestBlobBytes) |
151 IPC_MESSAGE_UNHANDLED(handled = false) | 153 IPC_MESSAGE_UNHANDLED(handled = false) |
152 IPC_END_MESSAGE_MAP() | 154 IPC_END_MESSAGE_MAP() |
153 return handled; | 155 return handled; |
154 } | 156 } |
155 | 157 |
156 } // namespace metadata | 158 } // namespace metadata |
OLD | NEW |