| OLD | NEW |
| 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_API_DATA_TYPE_ERROR_HANDLER_IMPL_H__ | 5 #ifndef COMPONENTS_SYNC_API_DATA_TYPE_ERROR_HANDLER_IMPL_H__ |
| 6 #define COMPONENTS_SYNC_API_DATA_TYPE_ERROR_HANDLER_IMPL_H__ | 6 #define COMPONENTS_SYNC_API_DATA_TYPE_ERROR_HANDLER_IMPL_H__ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/memory/ptr_util.h" | 12 #include "base/memory/ptr_util.h" |
| 13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 14 #include "base/single_thread_task_runner.h" | 14 #include "base/single_thread_task_runner.h" |
| 15 #include "components/sync/api/data_type_error_handler.h" | 15 #include "components/sync/api/data_type_error_handler.h" |
| 16 | 16 |
| 17 namespace syncer { | 17 namespace syncer { |
| 18 | 18 |
| 19 // The standard implementation of DataTypeErrorHandler. | 19 // The standard implementation of DataTypeErrorHandler. |
| 20 class DataTypeErrorHandlerImpl : public DataTypeErrorHandler { | 20 class DataTypeErrorHandlerImpl : public DataTypeErrorHandler { |
| 21 public: | 21 public: |
| 22 typedef base::Callback<void(const syncer::SyncError&)> ErrorCallback; | 22 typedef base::Callback<void(const SyncError&)> ErrorCallback; |
| 23 | 23 |
| 24 DataTypeErrorHandlerImpl( | 24 DataTypeErrorHandlerImpl( |
| 25 const scoped_refptr<base::SingleThreadTaskRunner>& ui_thread, | 25 const scoped_refptr<base::SingleThreadTaskRunner>& ui_thread, |
| 26 const base::Closure& dump_stack, | 26 const base::Closure& dump_stack, |
| 27 const ErrorCallback& sync_callback); | 27 const ErrorCallback& sync_callback); |
| 28 ~DataTypeErrorHandlerImpl() override; | 28 ~DataTypeErrorHandlerImpl() override; |
| 29 | 29 |
| 30 void OnUnrecoverableError(const SyncError& error) override; | 30 void OnUnrecoverableError(const SyncError& error) override; |
| 31 SyncError CreateAndUploadError(const tracked_objects::Location& location, | 31 SyncError CreateAndUploadError(const tracked_objects::Location& location, |
| 32 const std::string& message, | 32 const std::string& message, |
| (...skipping 11 matching lines...) Expand all Loading... |
| 44 | 44 |
| 45 // The callback used to inform sync of the error on the |ui_thread_|. | 45 // The callback used to inform sync of the error on the |ui_thread_|. |
| 46 ErrorCallback sync_callback_; | 46 ErrorCallback sync_callback_; |
| 47 | 47 |
| 48 DISALLOW_COPY_AND_ASSIGN(DataTypeErrorHandlerImpl); | 48 DISALLOW_COPY_AND_ASSIGN(DataTypeErrorHandlerImpl); |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 } // namespace syncer | 51 } // namespace syncer |
| 52 | 52 |
| 53 #endif // COMPONENTS_SYNC_API_DATA_TYPE_ERROR_HANDLER_IMPL_H__ | 53 #endif // COMPONENTS_SYNC_API_DATA_TYPE_ERROR_HANDLER_IMPL_H__ |
| OLD | NEW |