| 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" | 6 #include "chrome/browser/extensions/api/api_resource_event_notifier.h" |
| 7 | 7 |
| 8 namespace extensions { | 8 namespace extensions { |
| 9 | 9 |
| 10 APIResource::APIResource(APIResource::APIResourceType api_resource_type, | 10 ApiResource::ApiResource(ApiResourceEventNotifier* event_notifier) |
| 11 APIResourceEventNotifier* event_notifier) | 11 : event_notifier_(event_notifier) { |
| 12 : api_resource_type_(api_resource_type), event_notifier_(event_notifier) { | |
| 13 // scoped_refptr<> constructor does the initial AddRef() for us on | 12 // scoped_refptr<> constructor does the initial AddRef() for us on |
| 14 // event_notifier_. | 13 // event_notifier_. |
| 15 } | 14 } |
| 16 | 15 |
| 17 APIResource::~APIResource() { | 16 ApiResource::~ApiResource() { |
| 18 // scoped_refptr<> constructor calls Release() for us on event_notifier_. | 17 // scoped_refptr<> constructor calls Release() for us on event_notifier_. |
| 19 } | 18 } |
| 20 | 19 |
| 21 APIResource::APIResourceType APIResource::api_resource_type() const { | 20 ApiResourceEventNotifier* ApiResource::event_notifier() const { |
| 22 return api_resource_type_; | |
| 23 } | |
| 24 | |
| 25 APIResourceEventNotifier* APIResource::event_notifier() const { | |
| 26 return event_notifier_.get(); | 21 return event_notifier_.get(); |
| 27 } | 22 } |
| 28 | 23 |
| 29 } | 24 } |
| OLD | NEW |