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_picasa_albums_indexer.h" | 5 #include "chrome/browser/media_galleries/fileapi/safe_picasa_albums_indexer.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "chrome/browser/media_galleries/fileapi/media_file_system_backend.h" | 8 #include "chrome/browser/media_galleries/fileapi/media_file_system_backend.h" |
9 #include "chrome/common/chrome_utility_messages.h" | 9 #include "chrome/common/chrome_utility_messages.h" |
10 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 base::Bind(&SafePicasaAlbumsIndexer::StartWorkOnIOThread, this)); | 89 base::Bind(&SafePicasaAlbumsIndexer::StartWorkOnIOThread, this)); |
90 } | 90 } |
91 } | 91 } |
92 | 92 |
93 void SafePicasaAlbumsIndexer::StartWorkOnIOThread() { | 93 void SafePicasaAlbumsIndexer::StartWorkOnIOThread() { |
94 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 94 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
95 DCHECK_EQ(INITIAL_STATE, parser_state_); | 95 DCHECK_EQ(INITIAL_STATE, parser_state_); |
96 | 96 |
97 UtilityProcessHost* host = | 97 UtilityProcessHost* host = |
98 UtilityProcessHost::Create(this, base::MessageLoopProxy::current()); | 98 UtilityProcessHost::Create(this, base::MessageLoopProxy::current()); |
99 host->EnableZygote(); | |
100 host->Send(new ChromeUtilityMsg_IndexPicasaAlbumsContents(album_uids_, | 99 host->Send(new ChromeUtilityMsg_IndexPicasaAlbumsContents(album_uids_, |
101 folders_inis_)); | 100 folders_inis_)); |
102 parser_state_ = STARTED_PARSING_STATE; | 101 parser_state_ = STARTED_PARSING_STATE; |
103 } | 102 } |
104 | 103 |
105 void SafePicasaAlbumsIndexer::OnIndexPicasaAlbumsContentsFinished( | 104 void SafePicasaAlbumsIndexer::OnIndexPicasaAlbumsContentsFinished( |
106 const AlbumImagesMap& albums_images) { | 105 const AlbumImagesMap& albums_images) { |
107 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 106 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
108 DCHECK(!callback_.is_null()); | 107 DCHECK(!callback_.is_null()); |
109 if (parser_state_ != STARTED_PARSING_STATE) | 108 if (parser_state_ != STARTED_PARSING_STATE) |
(...skipping 20 matching lines...) Expand all Loading... |
130 IPC_BEGIN_MESSAGE_MAP(SafePicasaAlbumsIndexer, message) | 129 IPC_BEGIN_MESSAGE_MAP(SafePicasaAlbumsIndexer, message) |
131 IPC_MESSAGE_HANDLER( | 130 IPC_MESSAGE_HANDLER( |
132 ChromeUtilityHostMsg_IndexPicasaAlbumsContents_Finished, | 131 ChromeUtilityHostMsg_IndexPicasaAlbumsContents_Finished, |
133 OnIndexPicasaAlbumsContentsFinished) | 132 OnIndexPicasaAlbumsContentsFinished) |
134 IPC_MESSAGE_UNHANDLED(handled = false) | 133 IPC_MESSAGE_UNHANDLED(handled = false) |
135 IPC_END_MESSAGE_MAP() | 134 IPC_END_MESSAGE_MAP() |
136 return handled; | 135 return handled; |
137 } | 136 } |
138 | 137 |
139 } // namespace picasa | 138 } // namespace picasa |
OLD | NEW |