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 CHROME_BROWSER_PEPPER_FLASH_SETTINGS_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_PEPPER_FLASH_SETTINGS_MANAGER_H_ |
6 #define CHROME_BROWSER_PEPPER_FLASH_SETTINGS_MANAGER_H_ | 6 #define CHROME_BROWSER_PEPPER_FLASH_SETTINGS_MANAGER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/weak_ptr.h" |
10 #include "ppapi/c/private/ppp_flash_browser_operations.h" | 11 #include "ppapi/c/private/ppp_flash_browser_operations.h" |
11 #include "ppapi/shared_impl/ppp_flash_browser_operations_shared.h" | 12 #include "ppapi/shared_impl/ppp_flash_browser_operations_shared.h" |
12 | 13 |
13 class PluginPrefs; | 14 class PluginPrefs; |
14 class PrefService; | 15 class PrefService; |
15 | 16 |
16 namespace content { | 17 namespace content { |
17 class BrowserContext; | 18 class BrowserContext; |
18 } | 19 } |
19 | 20 |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 // - The manager can be deleted on the UI thread while the core still being | 107 // - The manager can be deleted on the UI thread while the core still being |
107 // used on the I/O thread. | 108 // used on the I/O thread. |
108 // - The manager can delete the core when it encounters errors and create | 109 // - The manager can delete the core when it encounters errors and create |
109 // another one to handle new requests. | 110 // another one to handle new requests. |
110 class Core; | 111 class Core; |
111 | 112 |
112 uint32 GetNextRequestId(); | 113 uint32 GetNextRequestId(); |
113 | 114 |
114 void EnsureCoreExists(); | 115 void EnsureCoreExists(); |
115 | 116 |
116 // Notified by |core_| when an error occurs. | 117 // Notifies us that an error occurred in |core|. |
117 void OnError(); | 118 void OnError(Core* core); |
| 119 |
| 120 base::WeakPtrFactory<PepperFlashSettingsManager> weak_ptr_factory_; |
118 | 121 |
119 // |client_| is not owned by this object and must outlive it. | 122 // |client_| is not owned by this object and must outlive it. |
120 Client* client_; | 123 Client* client_; |
121 | 124 |
122 // The browser context for the profile. | 125 // The browser context for the profile. |
123 content::BrowserContext* browser_context_; | 126 content::BrowserContext* browser_context_; |
124 | 127 |
125 scoped_refptr<Core> core_; | 128 scoped_refptr<Core> core_; |
126 | 129 |
127 uint32 next_request_id_; | 130 uint32 next_request_id_; |
128 | 131 |
129 DISALLOW_COPY_AND_ASSIGN(PepperFlashSettingsManager); | 132 DISALLOW_COPY_AND_ASSIGN(PepperFlashSettingsManager); |
130 }; | 133 }; |
131 | 134 |
132 #endif // CHROME_BROWSER_PEPPER_FLASH_SETTINGS_MANAGER_H_ | 135 #endif // CHROME_BROWSER_PEPPER_FLASH_SETTINGS_MANAGER_H_ |
OLD | NEW |