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

Side by Side Diff: chrome/utility/chrome_content_utility_client.cc

Issue 18562007: Media Galleries API Picasa: Put INI indexing step into sandboxed utility process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@0035-picasa-import-sandbox-pmp-reading
Patch Set: Add success flag that's false when utility process crashes. Created 7 years, 5 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/utility/chrome_content_utility_client.h" 5 #include "chrome/utility/chrome_content_utility_client.h"
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/json/json_reader.h" 10 #include "base/json/json_reader.h"
(...skipping 24 matching lines...) Expand all
35 #include "base/path_service.h" 35 #include "base/path_service.h"
36 #include "base/win/iat_patch_function.h" 36 #include "base/win/iat_patch_function.h"
37 #include "base/win/scoped_handle.h" 37 #include "base/win/scoped_handle.h"
38 #include "chrome/common/chrome_paths.h" 38 #include "chrome/common/chrome_paths.h"
39 #include "chrome/utility/itunes_pref_parser_win.h" 39 #include "chrome/utility/itunes_pref_parser_win.h"
40 #include "printing/emf_win.h" 40 #include "printing/emf_win.h"
41 #include "ui/gfx/gdi_util.h" 41 #include "ui/gfx/gdi_util.h"
42 #endif // defined(OS_WIN) 42 #endif // defined(OS_WIN)
43 43
44 #if defined(OS_WIN) || defined(OS_MACOSX) 44 #if defined(OS_WIN) || defined(OS_MACOSX)
45 #include "chrome/common/media_galleries/picasa_types.h"
46 #include "chrome/utility/itunes_library_parser.h" 45 #include "chrome/utility/itunes_library_parser.h"
47 #include "chrome/utility/media_galleries/picasa_album_table_reader.h" 46 #include "chrome/utility/media_galleries/picasa_album_table_reader.h"
47 #include "chrome/utility/media_galleries/picasa_albums_indexer.h"
48 #endif // defined(OS_WIN) || defined(OS_MACOSX) 48 #endif // defined(OS_WIN) || defined(OS_MACOSX)
49 49
50 #if defined(ENABLE_PRINTING) 50 #if defined(ENABLE_PRINTING)
51 #include "chrome/common/child_process_logging.h" 51 #include "chrome/common/child_process_logging.h"
52 #include "printing/backend/print_backend.h" 52 #include "printing/backend/print_backend.h"
53 #endif 53 #endif
54 54
55 namespace chrome { 55 namespace chrome {
56 56
57 namespace { 57 namespace {
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after
540 album_table_files.uid_file); 540 album_table_files.uid_file);
541 541
542 picasa::PicasaAlbumTableReader reader(files); 542 picasa::PicasaAlbumTableReader reader(files);
543 bool parse_success = reader.Init(); 543 bool parse_success = reader.Init();
544 Send(new ChromeUtilityHostMsg_ParsePicasaPMPDatabase_Finished( 544 Send(new ChromeUtilityHostMsg_ParsePicasaPMPDatabase_Finished(
545 parse_success, 545 parse_success,
546 reader.albums(), 546 reader.albums(),
547 reader.folders())); 547 reader.folders()));
548 ReleaseProcessIfNeeded(); 548 ReleaseProcessIfNeeded();
549 } 549 }
550
551 void OnIndexPicasaAlbumsContents(
552 const picasa::AlbumUIDSet& album_uids,
553 const std::vector<picasa::FolderINIContents>& folders_inis) {
554 picasa::PicasaAlbumsIndexer indexer(album_uids);
555 for (std::vector<picasa::FolderINIContents>::const_iterator it =
556 folders_inis.begin();
557 it != folders_inis.end(); ++it) {
558 indexer.ParseFolderINI(it->folder_path, it->ini_contents);
559 }
560
561 Send(new ChromeUtilityHostMsg_IndexPicasaAlbumsContents_Finished(
562 indexer.albums_images()));
563 ReleaseProcessIfNeeded();
564 }
550 #endif // defined(OS_WIN) || defined(OS_MACOSX) 565 #endif // defined(OS_WIN) || defined(OS_MACOSX)
551 566
552 } // namespace chrome 567 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698