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_EXTENSIONS_API_STREAMS_PRIVATE_STREAMS_PRIVATE_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_STREAMS_PRIVATE_STREAMS_PRIVATE_API_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_STREAMS_PRIVATE_STREAMS_PRIVATE_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_STREAMS_PRIVATE_STREAMS_PRIVATE_API_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 | 62 |
63 // BrowserContextKeyedAPI implementation. | 63 // BrowserContextKeyedAPI implementation. |
64 static const char* service_name() { | 64 static const char* service_name() { |
65 return "StreamsPrivateAPI"; | 65 return "StreamsPrivateAPI"; |
66 } | 66 } |
67 static const bool kServiceIsNULLWhileTesting = true; | 67 static const bool kServiceIsNULLWhileTesting = true; |
68 static const bool kServiceRedirectedInIncognito = true; | 68 static const bool kServiceRedirectedInIncognito = true; |
69 | 69 |
70 content::BrowserContext* const browser_context_; | 70 content::BrowserContext* const browser_context_; |
71 StreamMap streams_; | 71 StreamMap streams_; |
72 base::WeakPtrFactory<StreamsPrivateAPI> weak_ptr_factory_; | |
73 | 72 |
74 // Listen to extension unloaded notifications. | 73 // Listen to extension unloaded notifications. |
75 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> | 74 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> |
76 extension_registry_observer_; | 75 extension_registry_observer_; |
| 76 |
| 77 base::WeakPtrFactory<StreamsPrivateAPI> weak_ptr_factory_; |
| 78 |
77 }; | 79 }; |
78 | 80 |
79 class StreamsPrivateAbortFunction : public UIThreadExtensionFunction { | 81 class StreamsPrivateAbortFunction : public UIThreadExtensionFunction { |
80 public: | 82 public: |
81 StreamsPrivateAbortFunction(); | 83 StreamsPrivateAbortFunction(); |
82 DECLARE_EXTENSION_FUNCTION("streamsPrivate.abort", STREAMSPRIVATE_ABORT) | 84 DECLARE_EXTENSION_FUNCTION("streamsPrivate.abort", STREAMSPRIVATE_ABORT) |
83 | 85 |
84 protected: | 86 protected: |
85 virtual ~StreamsPrivateAbortFunction() {} | 87 virtual ~StreamsPrivateAbortFunction() {} |
86 | 88 |
87 // ExtensionFunction: | 89 // ExtensionFunction: |
88 virtual ExtensionFunction::ResponseAction Run() OVERRIDE; | 90 virtual ExtensionFunction::ResponseAction Run() OVERRIDE; |
89 | 91 |
90 private: | 92 private: |
91 void OnClose(); | 93 void OnClose(); |
92 | 94 |
93 std::string stream_url_; | 95 std::string stream_url_; |
94 }; | 96 }; |
95 | 97 |
96 } // namespace extensions | 98 } // namespace extensions |
97 | 99 |
98 #endif // CHROME_BROWSER_EXTENSIONS_API_STREAMS_PRIVATE_STREAMS_PRIVATE_API_H_ | 100 #endif // CHROME_BROWSER_EXTENSIONS_API_STREAMS_PRIVATE_STREAMS_PRIVATE_API_H_ |
OLD | NEW |