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

Side by Side Diff: chrome/browser/chromeos/gdata/gdata_files.h

Issue 10538071: gdata: Convert FindEntryByResourceIdSync() to asynchronous. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix spelling error of 'completion' and a few unnecessary newlines. Created 8 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 | 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 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILES_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILES_H_
6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILES_H_ 6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILES_H_
7 #pragma once 7 #pragma once
8 8
9 #include <map> 9 #include <map>
10 #include <string> 10 #include <string>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/callback.h" 13 #include "base/callback.h"
14 #include "base/gtest_prod_util.h" 14 #include "base/gtest_prod_util.h"
15 #include "base/memory/scoped_ptr.h" 15 #include "base/memory/scoped_ptr.h"
16 #include "base/memory/singleton.h" 16 #include "base/memory/singleton.h"
17 #include "base/memory/weak_ptr.h" 17 #include "base/memory/weak_ptr.h"
18 #include "base/platform_file.h" 18 #include "base/platform_file.h"
19 #include "base/synchronization/lock.h" 19 #include "base/synchronization/lock.h"
20 #include "chrome/browser/chromeos/gdata/find_entry_callback.h"
21 #include "chrome/browser/chromeos/gdata/gdata_params.h" 20 #include "chrome/browser/chromeos/gdata/gdata_params.h"
22 #include "chrome/browser/chromeos/gdata/gdata_parser.h" 21 #include "chrome/browser/chromeos/gdata/gdata_parser.h"
23 #include "chrome/browser/chromeos/gdata/gdata_uploader.h" 22 #include "chrome/browser/chromeos/gdata/gdata_uploader.h"
24 #include "chrome/browser/profiles/profile_keyed_service.h" 23 #include "chrome/browser/profiles/profile_keyed_service.h"
25 #include "chrome/browser/profiles/profile_keyed_service_factory.h" 24 #include "chrome/browser/profiles/profile_keyed_service_factory.h"
26 25
27 namespace gdata { 26 namespace gdata {
28 27
28 class GDataEntry;
29 class GDataFile; 29 class GDataFile;
30 class GDataDirectory; 30 class GDataDirectory;
31 class GDataRootDirectory; 31 class GDataRootDirectory;
32 32
33 class GDataEntryProto; 33 class GDataEntryProto;
34 class GDataFileProto; 34 class GDataFileProto;
35 class GDataDirectoryProto; 35 class GDataDirectoryProto;
36 class GDataRootDirectoryProto; 36 class GDataRootDirectoryProto;
37 class PlatformFileInfoProto; 37 class PlatformFileInfoProto;
38 38
(...skipping 18 matching lines...) Expand all
57 }; 57 };
58 58
59 // The root directory name used for the Google Drive file system tree. The 59 // The root directory name used for the Google Drive file system tree. The
60 // name is used in URLs for the file manager, hence user-visible. 60 // name is used in URLs for the file manager, hence user-visible.
61 const FilePath::CharType kGDataRootDirectory[] = FILE_PATH_LITERAL("drive"); 61 const FilePath::CharType kGDataRootDirectory[] = FILE_PATH_LITERAL("drive");
62 62
63 // The resource ID for the root directory is defined in the spec: 63 // The resource ID for the root directory is defined in the spec:
64 // https://developers.google.com/google-apps/documents-list/ 64 // https://developers.google.com/google-apps/documents-list/
65 const char kGDataRootDirectoryResourceId[] = "folder:root"; 65 const char kGDataRootDirectoryResourceId[] = "folder:root";
66 66
67 // Used to get result of file search.
68 // If |error| is not PLATFORM_FILE_OK, |entry| is set to NULL.
69 typedef base::Callback<void(base::PlatformFileError error, GDataEntry* entry)>
70 FindEntryCallback;
71
67 // Base class for representing files and directories in gdata virtual file 72 // Base class for representing files and directories in gdata virtual file
68 // system. 73 // system.
69 class GDataEntry { 74 class GDataEntry {
70 public: 75 public:
71 explicit GDataEntry(GDataDirectory* parent, GDataRootDirectory* root); 76 explicit GDataEntry(GDataDirectory* parent, GDataRootDirectory* root);
72 virtual ~GDataEntry(); 77 virtual ~GDataEntry();
73 78
74 virtual GDataFile* AsGDataFile(); 79 virtual GDataFile* AsGDataFile();
75 virtual GDataDirectory* AsGDataDirectory(); 80 virtual GDataDirectory* AsGDataDirectory();
76 virtual GDataRootDirectory* AsGDataRootDirectory(); 81 virtual GDataRootDirectory* AsGDataRootDirectory();
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 base::Time last_serialized_; 429 base::Time last_serialized_;
425 int largest_changestamp_; 430 int largest_changestamp_;
426 size_t serialized_size_; 431 size_t serialized_size_;
427 432
428 DISALLOW_COPY_AND_ASSIGN(GDataRootDirectory); 433 DISALLOW_COPY_AND_ASSIGN(GDataRootDirectory);
429 }; 434 };
430 435
431 } // namespace gdata 436 } // namespace gdata
432 437
433 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILES_H_ 438 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILES_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698