OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CHROME_BROWSER_EXTENSIONS_EXTENSION_ERROR_REPORTER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_ERROR_REPORTER_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_ERROR_REPORTER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_ERROR_REPORTER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
| 11 #include "base/memory/ref_counted.h" |
11 #include "base/observer_list.h" | 12 #include "base/observer_list.h" |
| 13 #include "base/single_thread_task_runner.h" |
12 #include "base/strings/string16.h" | 14 #include "base/strings/string16.h" |
13 | 15 |
14 namespace base { | 16 namespace base { |
15 class MessageLoop; | |
16 class FilePath; | 17 class FilePath; |
17 } | 18 } |
18 | 19 |
19 namespace content { | 20 namespace content { |
20 class BrowserContext; | 21 class BrowserContext; |
21 } | 22 } |
22 | 23 |
23 // Exposes an easy way for the various components of the extension system to | 24 // Exposes an easy way for the various components of the extension system to |
24 // report errors. This is a singleton that lives on the UI thread, with the | 25 // report errors. This is a singleton that lives on the UI thread, with the |
25 // exception of ReportError() which may be called from any thread. | 26 // exception of ReportError() which may be called from any thread. |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 void AddObserver(Observer* observer); | 71 void AddObserver(Observer* observer); |
71 | 72 |
72 void RemoveObserver(Observer* observer); | 73 void RemoveObserver(Observer* observer); |
73 | 74 |
74 private: | 75 private: |
75 static ExtensionErrorReporter* instance_; | 76 static ExtensionErrorReporter* instance_; |
76 | 77 |
77 explicit ExtensionErrorReporter(bool enable_noisy_errors); | 78 explicit ExtensionErrorReporter(bool enable_noisy_errors); |
78 ~ExtensionErrorReporter(); | 79 ~ExtensionErrorReporter(); |
79 | 80 |
80 base::MessageLoop* ui_loop_; | 81 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; |
81 std::vector<base::string16> errors_; | 82 std::vector<base::string16> errors_; |
82 bool enable_noisy_errors_; | 83 bool enable_noisy_errors_; |
83 | 84 |
84 base::ObserverList<Observer> observers_; | 85 base::ObserverList<Observer> observers_; |
85 }; | 86 }; |
86 | 87 |
87 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_ERROR_REPORTER_H_ | 88 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_ERROR_REPORTER_H_ |
OLD | NEW |