| OLD | NEW |
| 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 WEBKIT_BROWSER_FILEAPI_TASK_RUNNER_BOUND_OBSERVER_LIST_H_ | 5 #ifndef WEBKIT_BROWSER_FILEAPI_TASK_RUNNER_BOUND_OBSERVER_LIST_H_ |
| 6 #define WEBKIT_BROWSER_FILEAPI_TASK_RUNNER_BOUND_OBSERVER_LIST_H_ | 6 #define WEBKIT_BROWSER_FILEAPI_TASK_RUNNER_BOUND_OBSERVER_LIST_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/sequenced_task_runner.h" | 13 #include "base/sequenced_task_runner.h" |
| 14 #include "base/threading/thread.h" | 14 #include "base/threading/thread.h" |
| 15 | 15 |
| 16 namespace fileapi { | 16 namespace storage { |
| 17 | 17 |
| 18 // A wrapper for dispatching method. | 18 // A wrapper for dispatching method. |
| 19 template <class T, class Method, class Params> | 19 template <class T, class Method, class Params> |
| 20 void NotifyWrapper(T obj, Method m, const Params& p) { | 20 void NotifyWrapper(T obj, Method m, const Params& p) { |
| 21 DispatchToMethod(base::internal::UnwrapTraits<T>::Unwrap(obj), m, p); | 21 DispatchToMethod(base::internal::UnwrapTraits<T>::Unwrap(obj), m, p); |
| 22 } | 22 } |
| 23 | 23 |
| 24 // An observer list helper to notify on a given task runner. | 24 // An observer list helper to notify on a given task runner. |
| 25 // Observer pointers (stored as ObserverStoreType) must be kept alive | 25 // Observer pointers (stored as ObserverStoreType) must be kept alive |
| 26 // until this list dispatches all the notifications. | 26 // until this list dispatches all the notifications. |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 }; | 87 }; |
| 88 | 88 |
| 89 class FileAccessObserver; | 89 class FileAccessObserver; |
| 90 class FileChangeObserver; | 90 class FileChangeObserver; |
| 91 class FileUpdateObserver; | 91 class FileUpdateObserver; |
| 92 | 92 |
| 93 typedef TaskRunnerBoundObserverList<FileAccessObserver> AccessObserverList; | 93 typedef TaskRunnerBoundObserverList<FileAccessObserver> AccessObserverList; |
| 94 typedef TaskRunnerBoundObserverList<FileChangeObserver> ChangeObserverList; | 94 typedef TaskRunnerBoundObserverList<FileChangeObserver> ChangeObserverList; |
| 95 typedef TaskRunnerBoundObserverList<FileUpdateObserver> UpdateObserverList; | 95 typedef TaskRunnerBoundObserverList<FileUpdateObserver> UpdateObserverList; |
| 96 | 96 |
| 97 } // namespace fileapi | 97 } // namespace storage |
| 98 | 98 |
| 99 #endif // WEBKIT_BROWSER_FILEAPI_TASK_RUNNER_BOUND_OBSERVER_LIST_H_ | 99 #endif // WEBKIT_BROWSER_FILEAPI_TASK_RUNNER_BOUND_OBSERVER_LIST_H_ |
| OLD | NEW |