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

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

Issue 2805095: Fix deadlock by introducing a new transaction event. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Created 10 years, 5 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 // This file defines the "sync API", an interface to the syncer 5 // This file defines the "sync API", an interface to the syncer
6 // backend that exposes (1) the core functionality of maintaining a consistent 6 // backend that exposes (1) the core functionality of maintaining a consistent
7 // local snapshot of a hierarchical object set; (2) a means to transactionally 7 // local snapshot of a hierarchical object set; (2) a means to transactionally
8 // access and modify those objects; (3) a means to control client/server 8 // access and modify those objects; (3) a means to control client/server
9 // synchronization tasks, namely: pushing local object modifications to a 9 // synchronization tasks, namely: pushing local object modifications to a
10 // server, pulling nonlocal object modifications from a server to this client, 10 // server, pulling nonlocal object modifications from a server to this client,
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 467
468 DISALLOW_COPY_AND_ASSIGN(BaseTransaction); 468 DISALLOW_COPY_AND_ASSIGN(BaseTransaction);
469 }; 469 };
470 470
471 // Sync API's ReadTransaction is a read-only BaseTransaction. It wraps 471 // Sync API's ReadTransaction is a read-only BaseTransaction. It wraps
472 // a syncable::ReadTransaction. 472 // a syncable::ReadTransaction.
473 class ReadTransaction : public BaseTransaction { 473 class ReadTransaction : public BaseTransaction {
474 public: 474 public:
475 // Start a new read-only transaction on the specified repository. 475 // Start a new read-only transaction on the specified repository.
476 explicit ReadTransaction(UserShare* share); 476 explicit ReadTransaction(UserShare* share);
477
478 // Resume the middle of a transaction. Will not close transaction.
479 ReadTransaction(UserShare* share, syncable::BaseTransaction* trans);
480
477 virtual ~ReadTransaction(); 481 virtual ~ReadTransaction();
478 482
479 // BaseTransaction override. 483 // BaseTransaction override.
480 virtual syncable::BaseTransaction* GetWrappedTrans() const; 484 virtual syncable::BaseTransaction* GetWrappedTrans() const;
481 private: 485 private:
482 void* operator new(size_t size); // Transaction is meant for stack use only. 486 void* operator new(size_t size); // Transaction is meant for stack use only.
483 487
484 // The underlying syncable object which this class wraps. 488 // The underlying syncable object which this class wraps.
485 syncable::ReadTransaction* transaction_; 489 syncable::BaseTransaction* transaction_;
490 bool close_transaction_;
486 491
487 DISALLOW_COPY_AND_ASSIGN(ReadTransaction); 492 DISALLOW_COPY_AND_ASSIGN(ReadTransaction);
488 }; 493 };
489 494
490 // Sync API's WriteTransaction is a read/write BaseTransaction. It wraps 495 // Sync API's WriteTransaction is a read/write BaseTransaction. It wraps
491 // a syncable::WriteTransaction. 496 // a syncable::WriteTransaction.
492 class WriteTransaction : public BaseTransaction { 497 class WriteTransaction : public BaseTransaction {
493 public: 498 public:
494 // Start a new read/write transaction. 499 // Start a new read/write transaction.
495 explicit WriteTransaction(UserShare* share); 500 explicit WriteTransaction(UserShare* share);
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
881 // This allows actual HttpPostProvider subclass implementations to be 886 // This allows actual HttpPostProvider subclass implementations to be
882 // reference counted, which is useful if a particular implementation uses 887 // reference counted, which is useful if a particular implementation uses
883 // multiple threads to serve network requests. 888 // multiple threads to serve network requests.
884 virtual void Destroy(HttpPostProviderInterface* http) = 0; 889 virtual void Destroy(HttpPostProviderInterface* http) = 0;
885 virtual ~HttpPostProviderFactory() { } 890 virtual ~HttpPostProviderFactory() { }
886 }; 891 };
887 892
888 } // namespace sync_api 893 } // namespace sync_api
889 894
890 #endif // CHROME_BROWSER_SYNC_ENGINE_SYNCAPI_H_ 895 #endif // CHROME_BROWSER_SYNC_ENGINE_SYNCAPI_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sync/engine/syncapi.cc » ('j') | chrome/browser/sync/engine/syncapi.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698