Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ | 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ |
| 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ | 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <functional> | 10 #include <functional> |
| (...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 417 | 417 |
| 418 DISALLOW_COPY_AND_ASSIGN(BaseMojoServiceWrapper); | 418 DISALLOW_COPY_AND_ASSIGN(BaseMojoServiceWrapper); |
| 419 }; | 419 }; |
| 420 | 420 |
| 421 // Wrapper around a mojo::InterfacePtr, which passes out WeakPtr's to the | 421 // Wrapper around a mojo::InterfacePtr, which passes out WeakPtr's to the |
| 422 // interface. | 422 // interface. |
| 423 template <typename Interface> | 423 template <typename Interface> |
| 424 class MojoServiceWrapper : public BaseMojoServiceWrapper { | 424 class MojoServiceWrapper : public BaseMojoServiceWrapper { |
| 425 public: | 425 public: |
| 426 MojoServiceWrapper(ServiceWorkerVersion* worker, | 426 MojoServiceWrapper(ServiceWorkerVersion* worker, |
| 427 mojo::InterfacePtr<Interface> interface) | 427 mojo::InterfacePtr<Interface> interface_ptr) |
|
Charlie Reis
2016/03/18 21:15:13
Not necessary in this CL?
| |
| 428 : BaseMojoServiceWrapper(worker, Interface::Name_), | 428 : BaseMojoServiceWrapper(worker, Interface::Name_), |
| 429 interface_(std::move(interface)), | 429 interface_(std::move(interface_ptr)), |
| 430 weak_ptr_factory_(interface_.get()) {} | 430 weak_ptr_factory_(interface_.get()) {} |
| 431 | 431 |
| 432 base::WeakPtr<Interface> GetWeakPtr() { | 432 base::WeakPtr<Interface> GetWeakPtr() { |
| 433 return weak_ptr_factory_.GetWeakPtr(); | 433 return weak_ptr_factory_.GetWeakPtr(); |
| 434 } | 434 } |
| 435 | 435 |
| 436 private: | 436 private: |
| 437 mojo::InterfacePtr<Interface> interface_; | 437 mojo::InterfacePtr<Interface> interface_; |
| 438 base::WeakPtrFactory<Interface> weak_ptr_factory_; | 438 base::WeakPtrFactory<Interface> weak_ptr_factory_; |
| 439 }; | 439 }; |
| (...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 767 | 767 |
| 768 // At this point |this| can have been deleted, so don't do anything other | 768 // At this point |this| can have been deleted, so don't do anything other |
| 769 // than returning. | 769 // than returning. |
| 770 | 770 |
| 771 return true; | 771 return true; |
| 772 } | 772 } |
| 773 | 773 |
| 774 } // namespace content | 774 } // namespace content |
| 775 | 775 |
| 776 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ | 776 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ |
| OLD | NEW |