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

Side by Side Diff: chrome/browser/sync/engine/sync_scheduler.h

Issue 7621085: Server directed error handling backend code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: upload before commit. Created 9 years, 3 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
« no previous file with comments | « no previous file | chrome/browser/sync/engine/sync_scheduler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 // A class to schedule syncer tasks intelligently. 5 // A class to schedule syncer tasks intelligently.
6 #ifndef CHROME_BROWSER_SYNC_ENGINE_SYNC_SCHEDULER_H_ 6 #ifndef CHROME_BROWSER_SYNC_ENGINE_SYNC_SCHEDULER_H_
7 #define CHROME_BROWSER_SYNC_ENGINE_SYNC_SCHEDULER_H_ 7 #define CHROME_BROWSER_SYNC_ENGINE_SYNC_SCHEDULER_H_
8 #pragma once 8 #pragma once
9 9
10 #include <string> 10 #include <string>
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 virtual void OnSilencedUntil( 113 virtual void OnSilencedUntil(
114 const base::TimeTicks& silenced_until) OVERRIDE; 114 const base::TimeTicks& silenced_until) OVERRIDE;
115 virtual bool IsSyncingCurrentlySilenced() OVERRIDE; 115 virtual bool IsSyncingCurrentlySilenced() OVERRIDE;
116 virtual void OnReceivedShortPollIntervalUpdate( 116 virtual void OnReceivedShortPollIntervalUpdate(
117 const base::TimeDelta& new_interval) OVERRIDE; 117 const base::TimeDelta& new_interval) OVERRIDE;
118 virtual void OnReceivedLongPollIntervalUpdate( 118 virtual void OnReceivedLongPollIntervalUpdate(
119 const base::TimeDelta& new_interval) OVERRIDE; 119 const base::TimeDelta& new_interval) OVERRIDE;
120 virtual void OnReceivedSessionsCommitDelay( 120 virtual void OnReceivedSessionsCommitDelay(
121 const base::TimeDelta& new_delay) OVERRIDE; 121 const base::TimeDelta& new_delay) OVERRIDE;
122 virtual void OnShouldStopSyncingPermanently() OVERRIDE; 122 virtual void OnShouldStopSyncingPermanently() OVERRIDE;
123 virtual void OnSyncProtocolError(
124 const sessions::SyncSessionSnapshot& snapshot) OVERRIDE;
123 125
124 // ServerConnectionEventListener implementation. 126 // ServerConnectionEventListener implementation.
125 // TODO(tim): schedule a nudge when valid connection detected? in 1 minute? 127 // TODO(tim): schedule a nudge when valid connection detected? in 1 minute?
126 virtual void OnServerConnectionEvent( 128 virtual void OnServerConnectionEvent(
127 const ServerConnectionEvent& event) OVERRIDE; 129 const ServerConnectionEvent& event) OVERRIDE;
128 130
129 private: 131 private:
130 enum JobProcessDecision { 132 enum JobProcessDecision {
131 // Indicates we should continue with the current job. 133 // Indicates we should continue with the current job.
132 CONTINUE, 134 CONTINUE,
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 347
346 // Used to update |server_connection_ok_|, see below. 348 // Used to update |server_connection_ok_|, see below.
347 void CheckServerConnectionManagerStatus( 349 void CheckServerConnectionManagerStatus(
348 HttpResponse::ServerConnectionCode code); 350 HttpResponse::ServerConnectionCode code);
349 351
350 // Called once the first time thread_ is started to broadcast an initial 352 // Called once the first time thread_ is started to broadcast an initial
351 // session snapshot containing data like initial_sync_ended. Important when 353 // session snapshot containing data like initial_sync_ended. Important when
352 // the client starts up and does not need to perform an initial sync. 354 // the client starts up and does not need to perform an initial sync.
353 void SendInitialSnapshot(); 355 void SendInitialSnapshot();
354 356
357 virtual void OnActionableError(const sessions::SyncSessionSnapshot& snapshot);
358
359
355 ScopedRunnableMethodFactory<SyncScheduler> method_factory_; 360 ScopedRunnableMethodFactory<SyncScheduler> method_factory_;
356 361
357 // Used for logging. 362 // Used for logging.
358 const std::string name_; 363 const std::string name_;
359 364
360 // The message loop this object is on. Almost all methods have to 365 // The message loop this object is on. Almost all methods have to
361 // be called on this thread. 366 // be called on this thread.
362 MessageLoop* const sync_loop_; 367 MessageLoop* const sync_loop_;
363 368
364 // Set in Start(), unset in Stop(). 369 // Set in Start(), unset in Stop().
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 scoped_ptr<Syncer> syncer_; 402 scoped_ptr<Syncer> syncer_;
398 403
399 scoped_ptr<sessions::SyncSessionContext> session_context_; 404 scoped_ptr<sessions::SyncSessionContext> session_context_;
400 405
401 DISALLOW_COPY_AND_ASSIGN(SyncScheduler); 406 DISALLOW_COPY_AND_ASSIGN(SyncScheduler);
402 }; 407 };
403 408
404 } // namespace browser_sync 409 } // namespace browser_sync
405 410
406 #endif // CHROME_BROWSER_SYNC_ENGINE_SYNC_SCHEDULER_H_ 411 #endif // CHROME_BROWSER_SYNC_ENGINE_SYNC_SCHEDULER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sync/engine/sync_scheduler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698