OLD | NEW |
| (Empty) |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef EXTENSIONS_BROWSER_API_COPRESENCE_ENDPOINTS_COPRESENCE_ENDPOINTS_RESOURC
ES_H_ | |
6 #define EXTENSIONS_BROWSER_API_COPRESENCE_ENDPOINTS_COPRESENCE_ENDPOINTS_RESOURC
ES_H_ | |
7 | |
8 #include <string> | |
9 | |
10 #include "base/macros.h" | |
11 #include "base/memory/scoped_ptr.h" | |
12 #include "extensions/browser/api/api_resource.h" | |
13 #include "extensions/browser/api/api_resource_manager.h" | |
14 | |
15 namespace copresence_endpoints { | |
16 class CopresenceEndpoint; | |
17 } | |
18 | |
19 namespace extensions { | |
20 | |
21 class CopresenceEndpointResource : public ApiResource { | |
22 public: | |
23 CopresenceEndpointResource( | |
24 const std::string& owner_extension_id, | |
25 scoped_ptr<copresence_endpoints::CopresenceEndpoint> endpoint); | |
26 ~CopresenceEndpointResource() override; | |
27 | |
28 copresence_endpoints::CopresenceEndpoint* endpoint(); | |
29 | |
30 std::string& packet() { return packet_; } | |
31 | |
32 static const content::BrowserThread::ID kThreadId = | |
33 content::BrowserThread::UI; | |
34 | |
35 private: | |
36 friend class ApiResourceManager<CopresenceEndpointResource>; | |
37 static const char* service_name() { | |
38 return "CopresenceEndpointResourceManager"; | |
39 } | |
40 | |
41 scoped_ptr<copresence_endpoints::CopresenceEndpoint> endpoint_; | |
42 std::string packet_; | |
43 | |
44 DISALLOW_COPY_AND_ASSIGN(CopresenceEndpointResource); | |
45 }; | |
46 | |
47 } // namespace extensions | |
48 | |
49 #endif // EXTENSIONS_BROWSER_API_COPRESENCE_ENDPOINTS_COPRESENCE_ENDPOINTS_RESO
URCES_H_ | |
OLD | NEW |