chrome/browser/chromeos/drive/drive_api_service.cc
// Parses the JSON value to ResourceEntry runs |callback|.
Parses the JSON value to ResourceEntry runs |callback|.
Parses the JSON value to ResourceEntry runs |callback| .
void ParseResourceEntryAndRun(
    const google_apis::GetResourceEntryCallback& callback,
    google_apis::GDataErrorCode error,
    scoped_ptr<base::Value> value) {
  DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::UI));
  if (!value) {
    callback.Run(error, scoped_ptr<google_apis::ResourceEntry>());
    return;
  }
  scoped_ptr<google_apis::FileResource> file_resource =
      google_apis::FileResource::CreateFrom(*value);
  if (!file_resource) {
    callback.Run(google_apis::GDATA_PARSE_ERROR,
                 scoped_ptr<google_apis::ResourceEntry>());
    return;
  }
  scoped_ptr<google_apis::ResourceEntry> entry =
      google_apis::ResourceEntry::CreateFromFileResource(*file_resource);
  if (!entry) {
    callback.Run(google_apis::GDATA_PARSE_ERROR,
                 scoped_ptr<google_apis::ResourceEntry>());
    return;
  }
  callback.Run(error, entry.Pass());
}
void ParseResourceEntryAndRun ( const google_apis :: GetResourceEntryCallback & callback , google_apis :: GDataErrorCode error , scoped_ptr < base :: Value > value ) { DCHECK ( ! BrowserThread :: CurrentlyOn ( BrowserThread :: UI ) ) ; if ( ! value ) { callback . Run ( error , scoped_ptr < google_apis :: ResourceEntry > ( ) ) ; return ; } scoped_ptr < google_apis :: FileResource > file_resource = google_apis :: FileResource :: CreateFrom ( * value ) ; if ( ! file_resource ) { callback . Run ( google_apis :: GDATA_PARSE_ERROR , scoped_ptr < google_apis :: ResourceEntry > ( ) ) ; return ; } scoped_ptr < google_apis :: ResourceEntry > entry = google_apis :: ResourceEntry :: CreateFromFileResource ( * file_resource ) ; if ( ! entry ) { callback . Run ( google_apis :: GDATA_PARSE_ERROR , scoped_ptr < google_apis :: ResourceEntry > ( ) ) ; return ; } callback . Run ( error , entry . Pass ( ) ) ; }
Parses the JSON value to ResourceEntry runs |callback|.
Parses the JSON value to ResourceEntry runs |callback| .
// Parsing FileResource is cheap enough to do on UI thread. // Converting to ResourceEntry is cheap enough to do on UI thread.