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

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

Issue 1130993002: [chrome/browser/media_galleries/fileapi] Use ThreadTaskRunnerHandle instead of MessageLoopProxy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed Build Break Created 5 years, 7 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_itunes_pref_parser_win.h" 5 #include "chrome/browser/media_galleries/fileapi/safe_itunes_pref_parser_win.h"
6 6
7 #include "base/single_thread_task_runner.h"
8 #include "base/thread_task_runner_handle.h"
7 #include "chrome/common/extensions/chrome_utility_extensions_messages.h" 9 #include "chrome/common/extensions/chrome_utility_extensions_messages.h"
8 #include "chrome/grit/generated_resources.h" 10 #include "chrome/grit/generated_resources.h"
9 #include "content/public/browser/browser_thread.h" 11 #include "content/public/browser/browser_thread.h"
10 #include "content/public/browser/utility_process_host.h" 12 #include "content/public/browser/utility_process_host.h"
11 #include "ui/base/l10n/l10n_util.h" 13 #include "ui/base/l10n/l10n_util.h"
12 14
13 using content::BrowserThread; 15 using content::BrowserThread;
14 using content::UtilityProcessHost; 16 using content::UtilityProcessHost;
15 17
16 namespace itunes { 18 namespace itunes {
(...skipping 17 matching lines...) Expand all
34 } 36 }
35 37
36 SafeITunesPrefParserWin::~SafeITunesPrefParserWin() { 38 SafeITunesPrefParserWin::~SafeITunesPrefParserWin() {
37 } 39 }
38 40
39 void SafeITunesPrefParserWin::StartWorkOnIOThread() { 41 void SafeITunesPrefParserWin::StartWorkOnIOThread() {
40 DCHECK_CURRENTLY_ON(BrowserThread::IO); 42 DCHECK_CURRENTLY_ON(BrowserThread::IO);
41 DCHECK_EQ(INITIAL_STATE, parser_state_); 43 DCHECK_EQ(INITIAL_STATE, parser_state_);
42 44
43 UtilityProcessHost* host = 45 UtilityProcessHost* host =
44 UtilityProcessHost::Create(this, base::MessageLoopProxy::current()); 46 UtilityProcessHost::Create(this, base::ThreadTaskRunnerHandle::Get());
45 host->SetName(l10n_util::GetStringUTF16( 47 host->SetName(l10n_util::GetStringUTF16(
46 IDS_UTILITY_PROCESS_MEDIA_LIBRARY_FILE_CHECKER_NAME)); 48 IDS_UTILITY_PROCESS_MEDIA_LIBRARY_FILE_CHECKER_NAME));
47 host->Send(new ChromeUtilityMsg_ParseITunesPrefXml(unsafe_xml_)); 49 host->Send(new ChromeUtilityMsg_ParseITunesPrefXml(unsafe_xml_));
48 parser_state_ = STARTED_PARSING_STATE; 50 parser_state_ = STARTED_PARSING_STATE;
49 } 51 }
50 52
51 void SafeITunesPrefParserWin::OnGotITunesDirectory( 53 void SafeITunesPrefParserWin::OnGotITunesDirectory(
52 const base::FilePath& library_file) { 54 const base::FilePath& library_file) {
53 DCHECK_CURRENTLY_ON(BrowserThread::IO); 55 DCHECK_CURRENTLY_ON(BrowserThread::IO);
54 56
(...skipping 13 matching lines...) Expand all
68 bool handled = true; 70 bool handled = true;
69 IPC_BEGIN_MESSAGE_MAP(SafeITunesPrefParserWin, message) 71 IPC_BEGIN_MESSAGE_MAP(SafeITunesPrefParserWin, message)
70 IPC_MESSAGE_HANDLER(ChromeUtilityHostMsg_GotITunesDirectory, 72 IPC_MESSAGE_HANDLER(ChromeUtilityHostMsg_GotITunesDirectory,
71 OnGotITunesDirectory) 73 OnGotITunesDirectory)
72 IPC_MESSAGE_UNHANDLED(handled = false) 74 IPC_MESSAGE_UNHANDLED(handled = false)
73 IPC_END_MESSAGE_MAP() 75 IPC_END_MESSAGE_MAP()
74 return handled; 76 return handled;
75 } 77 }
76 78
77 } // namespace itunes 79 } // namespace itunes
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698