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

Side by Side Diff: components/sync_sessions/sessions_sync_manager.h

Issue 2750163003: Prevent tabs sync during browser shutdown.
Patch Set: Created 3 years, 9 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 COMPONENTS_SYNC_SESSIONS_SESSIONS_SYNC_MANAGER_H_ 5 #ifndef COMPONENTS_SYNC_SESSIONS_SESSIONS_SYNC_MANAGER_H_
6 #define COMPONENTS_SYNC_SESSIONS_SESSIONS_SYNC_MANAGER_H_ 6 #define COMPONENTS_SYNC_SESSIONS_SESSIONS_SYNC_MANAGER_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 bool GetForeignSessionTabs( 94 bool GetForeignSessionTabs(
95 const std::string& tag, 95 const std::string& tag,
96 std::vector<const sessions::SessionTab*>* tabs) override; 96 std::vector<const sessions::SessionTab*>* tabs) override;
97 void DeleteForeignSession(const std::string& tag) override; 97 void DeleteForeignSession(const std::string& tag) override;
98 bool GetLocalSession(const SyncedSession** local_session) override; 98 bool GetLocalSession(const SyncedSession** local_session) override;
99 99
100 // LocalSessionEventHandler implementation. 100 // LocalSessionEventHandler implementation.
101 void OnLocalTabModified(SyncedTabDelegate* modified_tab) override; 101 void OnLocalTabModified(SyncedTabDelegate* modified_tab) override;
102 void OnFaviconsChanged(const std::set<GURL>& page_urls, 102 void OnFaviconsChanged(const std::set<GURL>& page_urls,
103 const GURL& icon_url) override; 103 const GURL& icon_url) override;
104 void SetAllBrowsersClosing(bool browsers_closing) override;
105
106 bool GetAllBrowsersClosingForTesting();
107 static void SetInitialAllBrowsersClosingValueForTesting(
108 bool initial_browsers_closing);
104 109
105 // Returns the tag used to uniquely identify this machine's session in the 110 // Returns the tag used to uniquely identify this machine's session in the
106 // sync model. 111 // sync model.
107 const std::string& current_machine_tag() const { 112 const std::string& current_machine_tag() const {
108 DCHECK(!current_machine_tag_.empty()); 113 DCHECK(!current_machine_tag_.empty());
109 return current_machine_tag_; 114 return current_machine_tag_;
110 } 115 }
111 116
112 FaviconCache* GetFaviconCache(); 117 FaviconCache* GetFaviconCache();
113 118
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 284
280 // Tracks whether our local representation of which sync nodes map to what 285 // Tracks whether our local representation of which sync nodes map to what
281 // tabs (belonging to the current local session) is inconsistent. This can 286 // tabs (belonging to the current local session) is inconsistent. This can
282 // happen if a foreign client deems our session as "stale" and decides to 287 // happen if a foreign client deems our session as "stale" and decides to
283 // delete it. Rather than respond by bullishly re-creating our nodes 288 // delete it. Rather than respond by bullishly re-creating our nodes
284 // immediately, which could lead to ping-pong sequences, we give the benefit 289 // immediately, which could lead to ping-pong sequences, we give the benefit
285 // of the doubt and hold off until another local navigation occurs, which 290 // of the doubt and hold off until another local navigation occurs, which
286 // proves that we are still relevant. 291 // proves that we are still relevant.
287 bool local_tab_pool_out_of_sync_; 292 bool local_tab_pool_out_of_sync_;
288 293
294 // Indicates that browsers are closing, so we shouldn't sync tabs closing
295 // events.
296 bool all_browsers_closing_;
297
289 syncer::SyncPrefs* sync_prefs_; 298 syncer::SyncPrefs* sync_prefs_;
290 299
291 std::unique_ptr<syncer::SyncErrorFactory> error_handler_; 300 std::unique_ptr<syncer::SyncErrorFactory> error_handler_;
292 std::unique_ptr<syncer::SyncChangeProcessor> sync_processor_; 301 std::unique_ptr<syncer::SyncChangeProcessor> sync_processor_;
293 302
294 // Local device info provider, owned by ProfileSyncService. 303 // Local device info provider, owned by ProfileSyncService.
295 const syncer::LocalDeviceInfoProvider* const local_device_; 304 const syncer::LocalDeviceInfoProvider* const local_device_;
296 305
297 // Unique client tag. 306 // Unique client tag.
298 std::string current_machine_tag_; 307 std::string current_machine_tag_;
(...skipping 23 matching lines...) Expand all
322 331
323 // Callback to inform sync that a sync data refresh is requested. 332 // Callback to inform sync that a sync data refresh is requested.
324 base::Closure datatype_refresh_callback_; 333 base::Closure datatype_refresh_callback_;
325 334
326 DISALLOW_COPY_AND_ASSIGN(SessionsSyncManager); 335 DISALLOW_COPY_AND_ASSIGN(SessionsSyncManager);
327 }; 336 };
328 337
329 } // namespace sync_sessions 338 } // namespace sync_sessions
330 339
331 #endif // COMPONENTS_SYNC_SESSIONS_SESSIONS_SYNC_MANAGER_H_ 340 #endif // COMPONENTS_SYNC_SESSIONS_SESSIONS_SYNC_MANAGER_H_
OLDNEW
« no previous file with comments | « components/sync_sessions/local_session_event_router.h ('k') | components/sync_sessions/sessions_sync_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698