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

Side by Side Diff: components/sync_sessions/local_session_event_router.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_LOCAL_SESSION_EVENT_ROUTER_H_ 5 #ifndef COMPONENTS_SYNC_SESSIONS_LOCAL_SESSION_EVENT_ROUTER_H_
6 #define COMPONENTS_SYNC_SESSIONS_LOCAL_SESSION_EVENT_ROUTER_H_ 6 #define COMPONENTS_SYNC_SESSIONS_LOCAL_SESSION_EVENT_ROUTER_H_
7 7
8 #include <set> 8 #include <set>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 17 matching lines...) Expand all
28 28
29 // A local navigation occurred that triggered updates to favicon data for 29 // A local navigation occurred that triggered updates to favicon data for
30 // each page URL in |page_urls| (e.g. http://www.google.com) and the icon URL 30 // each page URL in |page_urls| (e.g. http://www.google.com) and the icon URL
31 // |icon_url| (e.g. http://www.google.com/favicon.ico). This is routed through 31 // |icon_url| (e.g. http://www.google.com/favicon.ico). This is routed through
32 // Sessions Sync so that we can filter (exclude) favicon updates for pages 32 // Sessions Sync so that we can filter (exclude) favicon updates for pages
33 // that aren't currently part of the set of local open tabs, and pass relevant 33 // that aren't currently part of the set of local open tabs, and pass relevant
34 // updates on to FaviconCache for out-of-band favicon syncing. 34 // updates on to FaviconCache for out-of-band favicon syncing.
35 virtual void OnFaviconsChanged(const std::set<GURL>& page_urls, 35 virtual void OnFaviconsChanged(const std::set<GURL>& page_urls,
36 const GURL& icon_url) = 0; 36 const GURL& icon_url) = 0;
37 37
38 // A flag set when browsers are closing, so we shouldn't send tabs
39 // closing events to sync server. Tabs will be restored on the next browser
40 // start.
41 virtual void SetAllBrowsersClosing(bool browsers_closing) = 0;
42
38 protected: 43 protected:
39 LocalSessionEventHandler() {} 44 LocalSessionEventHandler() {}
40 45
41 private: 46 private:
42 DISALLOW_COPY_AND_ASSIGN(LocalSessionEventHandler); 47 DISALLOW_COPY_AND_ASSIGN(LocalSessionEventHandler);
43 }; 48 };
44 49
45 // The LocalSessionEventRouter is responsible for hooking itself up to various 50 // The LocalSessionEventRouter is responsible for hooking itself up to various
46 // notification sources in the browser process and forwarding relevant 51 // notification sources in the browser process and forwarding relevant
47 // events to a handler as defined in the LocalSessionEventHandler contract. 52 // events to a handler as defined in the LocalSessionEventHandler contract.
48 class LocalSessionEventRouter { 53 class LocalSessionEventRouter {
49 public: 54 public:
50 virtual ~LocalSessionEventRouter() {} 55 virtual ~LocalSessionEventRouter() {}
51 virtual void StartRoutingTo(LocalSessionEventHandler* handler) = 0; 56 virtual void StartRoutingTo(LocalSessionEventHandler* handler) = 0;
52 virtual void Stop() = 0; 57 virtual void Stop() = 0;
53 58
54 protected: 59 protected:
55 LocalSessionEventRouter() {} 60 LocalSessionEventRouter() {}
56 61
57 private: 62 private:
58 DISALLOW_COPY_AND_ASSIGN(LocalSessionEventRouter); 63 DISALLOW_COPY_AND_ASSIGN(LocalSessionEventRouter);
59 }; 64 };
60 65
61 } // namespace sync_sessions 66 } // namespace sync_sessions
62 67
63 #endif // COMPONENTS_SYNC_SESSIONS_LOCAL_SESSION_EVENT_ROUTER_H_ 68 #endif // COMPONENTS_SYNC_SESSIONS_LOCAL_SESSION_EVENT_ROUTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698