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 #include "chrome/browser/extensions/api/api_resource.h" | 5 #include "chrome/browser/extensions/api/api_resource.h" |
6 #include "chrome/browser/extensions/api/api_resource_event_notifier.h" | |
7 | 6 |
8 namespace extensions { | 7 namespace extensions { |
9 | 8 |
10 ApiResource::ApiResource(const std::string& owner_extension_id, | 9 ApiResource::ApiResource(const std::string& owner_extension_id) |
11 ApiResourceEventNotifier* event_notifier) | 10 : owner_extension_id_(owner_extension_id) { |
12 : owner_extension_id_(owner_extension_id), | |
13 event_notifier_(event_notifier) { | |
14 | 11 |
15 CHECK(!owner_extension_id_.empty()); | 12 CHECK(!owner_extension_id_.empty()); |
16 if (event_notifier) | |
17 CHECK(event_notifier->src_extension_id() == owner_extension_id_); | |
18 | |
19 // scoped_refptr<> constructor does the initial AddRef() for us on | |
20 // event_notifier_. | |
21 } | 13 } |
22 | 14 |
23 ApiResource::~ApiResource() { | 15 ApiResource::~ApiResource() { |
24 // scoped_refptr<> constructor calls Release() for us on event_notifier_. | |
25 } | 16 } |
26 | 17 |
27 } | 18 } |
OLD | NEW |