| 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 #import "ios/web/web_state/ui/wk_web_view_configuration_provider.h" | 5 #import "ios/web/web_state/ui/wk_web_view_configuration_provider.h" |
| 6 | 6 |
| 7 #import <Foundation/Foundation.h> | 7 #import <Foundation/Foundation.h> |
| 8 #import <WebKit/WebKit.h> | 8 #import <WebKit/WebKit.h> |
| 9 | 9 |
| 10 #import "base/ios/weak_nsobject.h" | 10 #import "base/ios/weak_nsobject.h" |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 WKUserContentController* userContentController = | 80 WKUserContentController* userContentController = |
| 81 [GetWebViewConfiguration() userContentController]; | 81 [GetWebViewConfiguration() userContentController]; |
| 82 router_.reset([[CRWWKScriptMessageRouter alloc] | 82 router_.reset([[CRWWKScriptMessageRouter alloc] |
| 83 initWithUserContentController:userContentController]); | 83 initWithUserContentController:userContentController]); |
| 84 } | 84 } |
| 85 return router_; | 85 return router_; |
| 86 } | 86 } |
| 87 | 87 |
| 88 void WKWebViewConfigurationProvider::Purge() { | 88 void WKWebViewConfigurationProvider::Purge() { |
| 89 DCHECK([NSThread isMainThread]); | 89 DCHECK([NSThread isMainThread]); |
| 90 #if DCHECK_IS_ON() | |
| 91 base::WeakNSObject<id> weak_configuration(configuration_); | |
| 92 base::WeakNSObject<id> weak_router(router_); | |
| 93 base::WeakNSObject<id> weak_process_pool([configuration_ processPool]); | |
| 94 #endif // DCHECK_IS_ON() | |
| 95 configuration_.reset(); | 90 configuration_.reset(); |
| 96 router_.reset(); | 91 router_.reset(); |
| 97 // Make sure that no one retains configuration, router, processPool. | |
| 98 #if DCHECK_IS_ON() | |
| 99 DCHECK(!weak_configuration); | |
| 100 DCHECK(!weak_router); | |
| 101 // TODO(crbug.com/522672): Enable this DCHECK. | |
| 102 // DCHECK(!weak_process_pool); | |
| 103 #endif // DCHECK_IS_ON() | |
| 104 } | 92 } |
| 105 | 93 |
| 106 } // namespace web | 94 } // namespace web |
| OLD | NEW |