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

Side by Side Diff: chrome/browser/chromeos/gdata/drive_task_executor.cc

Issue 10815058: gdata: Check entry_proto.get() before calling has_file_specific_info() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 | Annotate | Revision Log
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/browser/chromeos/gdata/drive_task_executor.h" 5 #include "chrome/browser/chromeos/gdata/drive_task_executor.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/json/json_writer.h" 10 #include "base/json/json_writer.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 GDataFileError error, 84 GDataFileError error,
85 scoped_ptr<gdata::GDataEntryProto> entry_proto) { 85 scoped_ptr<gdata::GDataEntryProto> entry_proto) {
86 // If we aborted, then this will be zero. 86 // If we aborted, then this will be zero.
87 if (!current_index_) 87 if (!current_index_)
88 return; 88 return;
89 89
90 gdata::GDataSystemService* system_service = 90 gdata::GDataSystemService* system_service =
91 gdata::GDataSystemServiceFactory::GetForProfile(profile()); 91 gdata::GDataSystemServiceFactory::GetForProfile(profile());
92 92
93 // Here, we are only insterested in files. 93 // Here, we are only insterested in files.
94 if (!entry_proto->has_file_specific_info()) 94 if (entry_proto.get() && !entry_proto->has_file_specific_info())
95 error = gdata::GDATA_FILE_ERROR_NOT_FOUND; 95 error = gdata::GDATA_FILE_ERROR_NOT_FOUND;
96 96
97 if (!system_service || error != GDATA_FILE_OK) { 97 if (!system_service || error != GDATA_FILE_OK) {
98 Done(false); 98 Done(false);
99 return; 99 return;
100 } 100 }
101 101
102 gdata::DocumentsServiceInterface* docs_service = 102 gdata::DocumentsServiceInterface* docs_service =
103 system_service->docs_service(); 103 system_service->docs_service();
104 104
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 169
170 void DriveTaskExecutor::Done(bool success) { 170 void DriveTaskExecutor::Done(bool success) {
171 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); 171 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
172 current_index_ = 0; 172 current_index_ = 0;
173 if (!done_.is_null()) 173 if (!done_.is_null())
174 done_.Run(success); 174 done_.Run(success);
175 done_.Reset(); 175 done_.Reset();
176 } 176 }
177 177
178 } // namespace gdata 178 } // namespace gdata
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698