OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_DOM_DISTILLER_CORE_TASK_TRACKER_H_ | 5 #ifndef COMPONENTS_DOM_DISTILLER_CORE_TASK_TRACKER_H_ |
6 #define COMPONENTS_DOM_DISTILLER_CORE_TASK_TRACKER_H_ | 6 #define COMPONENTS_DOM_DISTILLER_CORE_TASK_TRACKER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/bind.h" | 11 #include "base/bind.h" |
12 #include "base/callback.h" | 12 #include "base/callback.h" |
13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
14 #include "components/dom_distiller/core/article_entry.h" | 14 #include "components/dom_distiller/core/article_entry.h" |
15 #include "components/dom_distiller/core/distiller.h" | 15 #include "components/dom_distiller/core/distiller.h" |
16 #include "components/dom_distiller/core/proto/distilled_page.pb.h" | 16 #include "components/dom_distiller/core/proto/distilled_page.pb.h" |
17 | 17 |
18 class GURL; | 18 class GURL; |
19 | 19 |
20 namespace dom_distiller { | 20 namespace dom_distiller { |
21 | 21 |
22 class DistilledArticleProto; | 22 class DistilledArticleProto; |
23 | 23 |
24 // A handle to a request to view a DOM distiller entry or URL. The request will | 24 // A handle to a request to view a DOM distiller entry or URL. The request will |
25 // be cancelled when the handle is destroyed. | 25 // be cancelled when the handle is destroyed. |
26 class ViewerHandle { | 26 class ViewerHandle { |
| 27 public: |
27 typedef base::Callback<void()> CancelCallback; | 28 typedef base::Callback<void()> CancelCallback; |
28 | |
29 public: | |
30 explicit ViewerHandle(CancelCallback callback); | 29 explicit ViewerHandle(CancelCallback callback); |
31 ~ViewerHandle(); | 30 ~ViewerHandle(); |
32 | 31 |
33 private: | 32 private: |
34 CancelCallback cancel_callback_; | 33 CancelCallback cancel_callback_; |
35 DISALLOW_COPY_AND_ASSIGN(ViewerHandle); | 34 DISALLOW_COPY_AND_ASSIGN(ViewerHandle); |
36 }; | 35 }; |
37 | 36 |
38 // Interface for a DOM distiller entry viewer. Implement this to make a view | 37 // Interface for a DOM distiller entry viewer. Implement this to make a view |
39 // request and receive the data for an entry when it becomes available. | 38 // request and receive the data for an entry when it becomes available. |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 // Note: This should remain the last member so it'll be destroyed and | 120 // Note: This should remain the last member so it'll be destroyed and |
122 // invalidate its weak pointers before any other members are destroyed. | 121 // invalidate its weak pointers before any other members are destroyed. |
123 base::WeakPtrFactory<TaskTracker> weak_ptr_factory_; | 122 base::WeakPtrFactory<TaskTracker> weak_ptr_factory_; |
124 | 123 |
125 DISALLOW_COPY_AND_ASSIGN(TaskTracker); | 124 DISALLOW_COPY_AND_ASSIGN(TaskTracker); |
126 }; | 125 }; |
127 | 126 |
128 } // namespace dom_distiller | 127 } // namespace dom_distiller |
129 | 128 |
130 #endif // COMPONENTS_DOM_DISTILLER_CORE_TASK_TRACKER_H_ | 129 #endif // COMPONENTS_DOM_DISTILLER_CORE_TASK_TRACKER_H_ |
OLD | NEW |