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

Side by Side Diff: chrome/browser/media_galleries/fileapi/picasa/picasa_data_provider.cc

Issue 17101030: Media Galleries API - Picasa: Change PMP Parsing to deal with PlatformFile. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 6 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/picasa/picasa_data_provider.h" 5 #include "chrome/browser/media_galleries/fileapi/picasa/picasa_data_provider.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 if (total_counts[name] != 1) { 82 if (total_counts[name] != 1) {
83 name = base::StringPrintf("%s (%d)", name.c_str(), 83 name = base::StringPrintf("%s (%d)", name.c_str(),
84 ++current_counts[name]); 84 ++current_counts[name]);
85 } 85 }
86 86
87 result_map->insert(std::pair<std::string, AlbumInfo>(name, info_list[i])); 87 result_map->insert(std::pair<std::string, AlbumInfo>(name, info_list[i]));
88 } 88 }
89 } 89 }
90 90
91 bool PicasaDataProvider::ReadData() { 91 bool PicasaDataProvider::ReadData() {
92 PicasaAlbumTableReader album_table_reader(database_path_); 92 PicasaAlbumTableFiles album_table_files(database_path_);
93 PicasaAlbumTableReader album_table_reader((album_table_files));
93 94
94 if (!album_table_reader.Init()) 95 bool read_success = album_table_reader.Init();
95 return false;
96 96
97 InitializeWith(album_table_reader.albums(), 97 ClosePicasaAlbumTableFiles(&album_table_files);
98 album_table_reader.folders());
99 98
100 return true; 99 if (read_success)
100 InitializeWith(album_table_reader.albums(), album_table_reader.folders());
101
102 return read_success;
101 } 103 }
102 104
103 } // namespace picasa 105 } // namespace picasa
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698