OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "ios/web/web_state/web_state_weak_ptr_factory.h" | 5 #include "ios/web/web_state/web_state_weak_ptr_factory.h" |
6 | 6 |
7 #include "ios/web/public/web_state/web_state.h" | 7 #import "ios/web/public/web_state/web_state.h" |
8 | 8 |
9 namespace web { | 9 namespace web { |
10 | 10 |
11 // static | 11 // static |
12 base::WeakPtr<WebState> WebStateWeakPtrFactory::CreateWeakPtr( | 12 base::WeakPtr<WebState> WebStateWeakPtrFactory::CreateWeakPtr( |
13 WebState* web_state) { | 13 WebState* web_state) { |
14 if (!web_state) | 14 if (!web_state) |
15 return base::WeakPtr<WebState>(); | 15 return base::WeakPtr<WebState>(); |
16 return web_state->AsWeakPtr(); | 16 return web_state->AsWeakPtr(); |
17 } | 17 } |
18 | 18 |
19 } // namespace web | 19 } // namespace web |
OLD | NEW |