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_FUNCTION_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <list> | 10 #include <list> |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 // Helper class to track the lifetime of ExtensionFunction's RenderViewHost | 256 // Helper class to track the lifetime of ExtensionFunction's RenderViewHost |
257 // pointer and NULL it out when it dies. We use this separate class (instead | 257 // pointer and NULL it out when it dies. We use this separate class (instead |
258 // of implementing NotificationObserver on ExtensionFunction) because it is | 258 // of implementing NotificationObserver on ExtensionFunction) because it is |
259 // common for subclasses of ExtensionFunction to be NotificationObservers, and | 259 // common for subclasses of ExtensionFunction to be NotificationObservers, and |
260 // it would be an easy error to forget to call the base class's Observe() | 260 // it would be an easy error to forget to call the base class's Observe() |
261 // method. | 261 // method. |
262 class RenderViewHostTracker : public NotificationObserver { | 262 class RenderViewHostTracker : public NotificationObserver { |
263 public: | 263 public: |
264 explicit RenderViewHostTracker(UIThreadExtensionFunction* function); | 264 explicit RenderViewHostTracker(UIThreadExtensionFunction* function); |
265 private: | 265 private: |
266 virtual void Observe(NotificationType type, | 266 virtual void Observe(int type, |
267 const NotificationSource& source, | 267 const NotificationSource& source, |
268 const NotificationDetails& details); | 268 const NotificationDetails& details); |
269 UIThreadExtensionFunction* function_; | 269 UIThreadExtensionFunction* function_; |
270 NotificationRegistrar registrar_; | 270 NotificationRegistrar registrar_; |
271 }; | 271 }; |
272 | 272 |
273 virtual void Destruct() const; | 273 virtual void Destruct() const; |
274 | 274 |
275 scoped_ptr<RenderViewHostTracker> tracker_; | 275 scoped_ptr<RenderViewHostTracker> tracker_; |
276 }; | 276 }; |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 public: | 349 public: |
350 SyncIOThreadExtensionFunction(); | 350 SyncIOThreadExtensionFunction(); |
351 | 351 |
352 virtual void Run() OVERRIDE; | 352 virtual void Run() OVERRIDE; |
353 | 353 |
354 protected: | 354 protected: |
355 virtual ~SyncIOThreadExtensionFunction(); | 355 virtual ~SyncIOThreadExtensionFunction(); |
356 }; | 356 }; |
357 | 357 |
358 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_H_ | 358 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_H_ |
OLD | NEW |