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

Side by Side Diff: sync/syncable/directory.h

Issue 10540089: Removes reference counting from syncable::Directory::Kernel as it is no longer required because syn… (Closed) Base URL: https://src.chromium.org/svn/trunk/src/
Patch Set: Created 8 years, 6 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
« no previous file with comments | « AUTHORS ('k') | sync/syncable/directory.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) 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 SYNC_SYNCABLE_DIRECTORY_H_ 5 #ifndef SYNC_SYNCABLE_DIRECTORY_H_
6 #define SYNC_SYNCABLE_DIRECTORY_H_ 6 #define SYNC_SYNCABLE_DIRECTORY_H_
7 #pragma once 7 #pragma once
8 8
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 struct Kernel { 490 struct Kernel {
491 // |delegate| must not be NULL. |transaction_observer| must be 491 // |delegate| must not be NULL. |transaction_observer| must be
492 // initialized. 492 // initialized.
493 Kernel(const std::string& name, const KernelLoadInfo& info, 493 Kernel(const std::string& name, const KernelLoadInfo& info,
494 DirectoryChangeDelegate* delegate, 494 DirectoryChangeDelegate* delegate,
495 const browser_sync::WeakHandle<TransactionObserver>& 495 const browser_sync::WeakHandle<TransactionObserver>&
496 transaction_observer); 496 transaction_observer);
497 497
498 ~Kernel(); 498 ~Kernel();
499 499
500 void AddRef(); // For convenience.
501 void Release();
502
503 // TODO(timsteele): audit use of the member and remove if possible
504 volatile base::subtle::AtomicWord refcount;
505
506 // Implements ReadTransaction / WriteTransaction using a simple lock. 500 // Implements ReadTransaction / WriteTransaction using a simple lock.
507 base::Lock transaction_mutex; 501 base::Lock transaction_mutex;
508 502
509 // Protected by transaction_mutex. Used by WriteTransactions. 503 // Protected by transaction_mutex. Used by WriteTransactions.
510 int64 next_write_transaction_id; 504 int64 next_write_transaction_id;
511 505
512 // The name of this directory. 506 // The name of this directory.
513 std::string const name; 507 std::string const name;
514 508
515 // Protects all members below. 509 // Protects all members below.
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
613 607
614 browser_sync::UnrecoverableErrorHandler* const unrecoverable_error_handler_; 608 browser_sync::UnrecoverableErrorHandler* const unrecoverable_error_handler_;
615 const browser_sync::ReportUnrecoverableErrorFunction 609 const browser_sync::ReportUnrecoverableErrorFunction
616 report_unrecoverable_error_function_; 610 report_unrecoverable_error_function_;
617 bool unrecoverable_error_set_; 611 bool unrecoverable_error_set_;
618 }; 612 };
619 613
620 } // namespace syncable 614 } // namespace syncable
621 615
622 #endif // SYNC_SYNCABLE_DIRECTORY_H_ 616 #endif // SYNC_SYNCABLE_DIRECTORY_H_
OLDNEW
« no previous file with comments | « AUTHORS ('k') | sync/syncable/directory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698