| OLD | NEW |
| 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_iapps_library_parser.h" | 5 #include "chrome/browser/media_galleries/fileapi/safe_iapps_library_parser.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 #include "chrome/browser/media_galleries/fileapi/media_file_system_backend.h" | 10 #include "chrome/browser/media_galleries/fileapi/media_file_system_backend.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 | 26 |
| 27 void SafeIAppsLibraryParser::ParseITunesLibrary( | 27 void SafeIAppsLibraryParser::ParseITunesLibrary( |
| 28 const base::FilePath& library_file, | 28 const base::FilePath& library_file, |
| 29 const ITunesParserCallback& callback) { | 29 const ITunesParserCallback& callback) { |
| 30 library_file_path_ = library_file; | 30 library_file_path_ = library_file; |
| 31 itunes_callback_ = callback; | 31 itunes_callback_ = callback; |
| 32 Start(); | 32 Start(); |
| 33 } | 33 } |
| 34 | 34 |
| 35 void SafeIAppsLibraryParser::Start() { | 35 void SafeIAppsLibraryParser::Start() { |
| 36 DCHECK(MediaFileSystemBackend::CurrentlyOnMediaTaskRunnerThread()); | 36 MediaFileSystemBackend::AssertCurrentlyOnMediaSequence(); |
| 37 | 37 |
| 38 // |library_file_| will be closed on the IO thread once it has been handed | 38 // |library_file_| will be closed on the IO thread once it has been handed |
| 39 // off to the child process. | 39 // off to the child process. |
| 40 library_file_.Initialize(library_file_path_, | 40 library_file_.Initialize(library_file_path_, |
| 41 base::File::FLAG_OPEN | base::File::FLAG_READ); | 41 base::File::FLAG_OPEN | base::File::FLAG_READ); |
| 42 if (!library_file_.IsValid()) { | 42 if (!library_file_.IsValid()) { |
| 43 VLOG(1) << "Could not open iApps library XML file: " | 43 VLOG(1) << "Could not open iApps library XML file: " |
| 44 << library_file_path_.value(); | 44 << library_file_path_.value(); |
| 45 BrowserThread::PostTask( | 45 BrowserThread::PostTask( |
| 46 BrowserThread::IO, FROM_HERE, | 46 BrowserThread::IO, FROM_HERE, |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 bool handled = true; | 105 bool handled = true; |
| 106 IPC_BEGIN_MESSAGE_MAP(SafeIAppsLibraryParser, message) | 106 IPC_BEGIN_MESSAGE_MAP(SafeIAppsLibraryParser, message) |
| 107 IPC_MESSAGE_HANDLER(ChromeUtilityHostMsg_GotITunesLibrary, | 107 IPC_MESSAGE_HANDLER(ChromeUtilityHostMsg_GotITunesLibrary, |
| 108 OnGotITunesLibrary) | 108 OnGotITunesLibrary) |
| 109 IPC_MESSAGE_UNHANDLED(handled = false) | 109 IPC_MESSAGE_UNHANDLED(handled = false) |
| 110 IPC_END_MESSAGE_MAP() | 110 IPC_END_MESSAGE_MAP() |
| 111 return handled; | 111 return handled; |
| 112 } | 112 } |
| 113 | 113 |
| 114 } // namespace iapps | 114 } // namespace iapps |
| OLD | NEW |