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

Side by Side Diff: chrome/browser/chromeos/extensions/file_browser_event_router.h

Issue 10352004: gdata: Implement periodic file system update checks. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Add 2 more DCHECKs to make sure we're not starting/stopping timer when it is already started/stoppe… Created 8 years, 7 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 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_BROWSER_EVENT_ROUTER_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_BROWSER_EVENT_ROUTER_H_
6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_BROWSER_EVENT_ROUTER_H_ 6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_BROWSER_EVENT_ROUTER_H_
7 #pragma once 7 #pragma once
8 8
9 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 const chromeos::disks::DiskMountManager::MountPointInfo& mount_info); 149 const chromeos::disks::DiskMountManager::MountPointInfo& mount_info);
150 150
151 void RemoveBrowserFromVector(const std::string& path); 151 void RemoveBrowserFromVector(const std::string& path);
152 152
153 // Used to create a window of a standard size, and add it to a list 153 // Used to create a window of a standard size, and add it to a list
154 // of tracked browser windows in case that device goes away. 154 // of tracked browser windows in case that device goes away.
155 void OpenFileBrowse(const std::string& url, 155 void OpenFileBrowse(const std::string& url,
156 const std::string& device_path, 156 const std::string& device_path,
157 bool small); 157 bool small);
158 158
159 // Returns the GDataFileSystem for the current profile.
160 gdata::GDataFileSystem* GetRemoteFileSystem() const;
161
162 // Handles requests to start and stop periodic updates on remote file system.
163 // When |start| is set to true, this function starts periodic updates only if
164 // it is not yet started; when |start| is set to false, this function stops
165 // periodic updates only if the number of outstanding update requests reaches
166 // zero.
167 void HandleRemoteUpdateRequestOnUIThread(bool start);
168
159 scoped_refptr<FileWatcherDelegate> delegate_; 169 scoped_refptr<FileWatcherDelegate> delegate_;
160 WatcherMap file_watchers_; 170 WatcherMap file_watchers_;
161 scoped_ptr<FileBrowserNotifications> notifications_; 171 scoped_ptr<FileBrowserNotifications> notifications_;
162 Profile* profile_; 172 Profile* profile_;
163 base::Lock lock_; 173 base::Lock lock_;
164 174
165 bool current_gdata_operation_failed_; 175 bool current_gdata_operation_failed_;
166 int last_active_gdata_operation_count_; 176 int last_active_gdata_operation_count_;
167 177
178 // Number of active update requests on the remote file system.
179 int num_remote_update_requests_;
180
168 DISALLOW_COPY_AND_ASSIGN(FileBrowserEventRouter); 181 DISALLOW_COPY_AND_ASSIGN(FileBrowserEventRouter);
169 }; 182 };
170 183
171 // Singleton that owns all FileBrowserEventRouter and associates 184 // Singleton that owns all FileBrowserEventRouter and associates
172 // them with Profiles. 185 // them with Profiles.
173 class FileBrowserEventRouterFactory 186 class FileBrowserEventRouterFactory
174 : public RefcountedProfileKeyedServiceFactory { 187 : public RefcountedProfileKeyedServiceFactory {
175 public: 188 public:
176 // Returns the FileBrowserEventRouter for |profile|, creating it if 189 // Returns the FileBrowserEventRouter for |profile|, creating it if
177 // it is not yet created. 190 // it is not yet created.
(...skipping 11 matching lines...) Expand all
189 202
190 FileBrowserEventRouterFactory(); 203 FileBrowserEventRouterFactory();
191 virtual ~FileBrowserEventRouterFactory(); 204 virtual ~FileBrowserEventRouterFactory();
192 205
193 // ProfileKeyedServiceFactory: 206 // ProfileKeyedServiceFactory:
194 virtual scoped_refptr<RefcountedProfileKeyedService> BuildServiceInstanceFor( 207 virtual scoped_refptr<RefcountedProfileKeyedService> BuildServiceInstanceFor(
195 Profile* profile) const OVERRIDE; 208 Profile* profile) const OVERRIDE;
196 }; 209 };
197 210
198 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_BROWSER_EVENT_ROUTER_H_ 211 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_BROWSER_EVENT_ROUTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698