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

Side by Side Diff: chrome/browser/media_galleries/fileapi/safe_media_metadata_parser.cc

Issue 1062873003: Give names to all utility processes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix typos Created 5 years, 8 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 unified diff | Download patch
OLDNEW
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 "chrome/browser/extensions/blob_reader.h" 7 #include "chrome/browser/extensions/blob_reader.h"
8 #include "chrome/common/extensions/chrome_utility_extensions_messages.h" 8 #include "chrome/common/extensions/chrome_utility_extensions_messages.h"
9 #include "chrome/grit/generated_resources.h"
9 #include "content/public/browser/browser_thread.h" 10 #include "content/public/browser/browser_thread.h"
10 #include "content/public/browser/child_process_data.h" 11 #include "content/public/browser/child_process_data.h"
11 #include "content/public/browser/utility_process_host.h" 12 #include "content/public/browser/utility_process_host.h"
13 #include "ui/base/l10n/l10n_util.h"
12 14
13 using content::BrowserThread; 15 using content::BrowserThread;
14 16
15 namespace metadata { 17 namespace metadata {
16 18
17 SafeMediaMetadataParser::SafeMediaMetadataParser( 19 SafeMediaMetadataParser::SafeMediaMetadataParser(
18 Profile* profile, const std::string& blob_uuid, int64 blob_size, 20 Profile* profile, const std::string& blob_uuid, int64 blob_size,
19 const std::string& mime_type, bool get_attached_images) 21 const std::string& mime_type, bool get_attached_images)
20 : profile_(profile), 22 : profile_(profile),
21 blob_uuid_(blob_uuid), 23 blob_uuid_(blob_uuid),
(...skipping 20 matching lines...) Expand all
42 void SafeMediaMetadataParser::StartWorkOnIOThread( 44 void SafeMediaMetadataParser::StartWorkOnIOThread(
43 const DoneCallback& callback) { 45 const DoneCallback& callback) {
44 DCHECK_CURRENTLY_ON(BrowserThread::IO); 46 DCHECK_CURRENTLY_ON(BrowserThread::IO);
45 DCHECK_EQ(INITIAL_STATE, parser_state_); 47 DCHECK_EQ(INITIAL_STATE, parser_state_);
46 DCHECK(!callback.is_null()); 48 DCHECK(!callback.is_null());
47 49
48 callback_ = callback; 50 callback_ = callback;
49 51
50 utility_process_host_ = content::UtilityProcessHost::Create( 52 utility_process_host_ = content::UtilityProcessHost::Create(
51 this, base::MessageLoopProxy::current())->AsWeakPtr(); 53 this, base::MessageLoopProxy::current())->AsWeakPtr();
54 utility_process_host_->SetName(l10n_util::GetStringUTF16(
55 IDS_UTILITY_PROCESS_MEDIA_FILE_CHECKER_NAME));
52 56
53 utility_process_host_->Send( 57 utility_process_host_->Send(
54 new ChromeUtilityMsg_ParseMediaMetadata(mime_type_, blob_size_, 58 new ChromeUtilityMsg_ParseMediaMetadata(mime_type_, blob_size_,
55 get_attached_images_)); 59 get_attached_images_));
56 60
57 parser_state_ = STARTED_PARSING_STATE; 61 parser_state_ = STARTED_PARSING_STATE;
58 } 62 }
59 63
60 void SafeMediaMetadataParser::OnParseMediaMetadataFinished( 64 void SafeMediaMetadataParser::OnParseMediaMetadataFinished(
61 bool parse_success, const base::DictionaryValue& metadata_dictionary, 65 bool parse_success, const base::DictionaryValue& metadata_dictionary,
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 OnParseMediaMetadataFinished) 147 OnParseMediaMetadataFinished)
144 IPC_MESSAGE_HANDLER( 148 IPC_MESSAGE_HANDLER(
145 ChromeUtilityHostMsg_RequestBlobBytes, 149 ChromeUtilityHostMsg_RequestBlobBytes,
146 OnUtilityProcessRequestBlobBytes) 150 OnUtilityProcessRequestBlobBytes)
147 IPC_MESSAGE_UNHANDLED(handled = false) 151 IPC_MESSAGE_UNHANDLED(handled = false)
148 IPC_END_MESSAGE_MAP() 152 IPC_END_MESSAGE_MAP()
149 return handled; 153 return handled;
150 } 154 }
151 155
152 } // namespace metadata 156 } // namespace metadata
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698