Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1100)

Side by Side Diff: ios/web/web_state/web_state_impl.mm

Issue 2916473002: [ObjC ARC] Converts ios/web:web to ARC. (Closed)
Patch Set: Tweaks to unit test memory management Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #import "ios/web/web_state/web_state_impl.h" 5 #import "ios/web/web_state/web_state_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 20 matching lines...) Expand all
31 #include "ios/web/public/webui/web_ui_ios_controller.h" 31 #include "ios/web/public/webui/web_ui_ios_controller.h"
32 #include "ios/web/web_state/global_web_state_event_tracker.h" 32 #include "ios/web/web_state/global_web_state_event_tracker.h"
33 #import "ios/web/web_state/navigation_context_impl.h" 33 #import "ios/web/web_state/navigation_context_impl.h"
34 #import "ios/web/web_state/session_certificate_policy_cache_impl.h" 34 #import "ios/web/web_state/session_certificate_policy_cache_impl.h"
35 #import "ios/web/web_state/ui/crw_web_controller.h" 35 #import "ios/web/web_state/ui/crw_web_controller.h"
36 #import "ios/web/web_state/ui/crw_web_controller_container_view.h" 36 #import "ios/web/web_state/ui/crw_web_controller_container_view.h"
37 #include "ios/web/webui/web_ui_ios_controller_factory_registry.h" 37 #include "ios/web/webui/web_ui_ios_controller_factory_registry.h"
38 #include "ios/web/webui/web_ui_ios_impl.h" 38 #include "ios/web/webui/web_ui_ios_impl.h"
39 #include "net/http/http_response_headers.h" 39 #include "net/http/http_response_headers.h"
40 40
41 #if !defined(__has_feature) || !__has_feature(objc_arc)
42 #error "This file requires ARC support."
43 #endif
44
41 namespace web { 45 namespace web {
42 46
43 /* static */ 47 /* static */
44 std::unique_ptr<WebState> WebState::Create(const CreateParams& params) { 48 std::unique_ptr<WebState> WebState::Create(const CreateParams& params) {
45 std::unique_ptr<WebStateImpl> web_state(new WebStateImpl(params)); 49 std::unique_ptr<WebStateImpl> web_state(new WebStateImpl(params));
46 50
47 // Initialize the new session. 51 // Initialize the new session.
48 web_state->GetNavigationManagerImpl().InitializeSession(); 52 web_state->GetNavigationManagerImpl().InitializeSession();
49 53
50 // TODO(crbug.com/703565): remove std::move() once Xcode 9.0+ is required. 54 // TODO(crbug.com/703565): remove std::move() once Xcode 9.0+ is required.
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 bool WebStateImpl::Configured() const { 159 bool WebStateImpl::Configured() const {
156 return web_controller_ != nil; 160 return web_controller_ != nil;
157 } 161 }
158 162
159 CRWWebController* WebStateImpl::GetWebController() { 163 CRWWebController* WebStateImpl::GetWebController() {
160 return web_controller_; 164 return web_controller_;
161 } 165 }
162 166
163 void WebStateImpl::SetWebController(CRWWebController* web_controller) { 167 void WebStateImpl::SetWebController(CRWWebController* web_controller) {
164 [web_controller_ close]; 168 [web_controller_ close];
165 web_controller_.reset([web_controller retain]); 169 web_controller_.reset(web_controller);
PL 2017/06/01 01:56:21 The converter created this, but can we just assign
166 } 170 }
167 171
168 void WebStateImpl::OnTitleChanged() { 172 void WebStateImpl::OnTitleChanged() {
169 for (auto& observer : observers_) 173 for (auto& observer : observers_)
170 observer.TitleWasSet(); 174 observer.TitleWasSet();
171 } 175 }
172 176
173 void WebStateImpl::OnVisibleSecurityStateChange() { 177 void WebStateImpl::OnVisibleSecurityStateChange() {
174 for (auto& observer : observers_) 178 for (auto& observer : observers_)
175 observer.DidChangeVisibleSecurityState(); 179 observer.DidChangeVisibleSecurityState();
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after
709 const LoadCommittedDetails& load_details) { 713 const LoadCommittedDetails& load_details) {
710 for (auto& observer : observers_) 714 for (auto& observer : observers_)
711 observer.NavigationItemCommitted(load_details); 715 observer.NavigationItemCommitted(load_details);
712 } 716 }
713 717
714 WebState* WebStateImpl::GetWebState() { 718 WebState* WebStateImpl::GetWebState() {
715 return this; 719 return this;
716 } 720 }
717 721
718 } // namespace web 722 } // namespace web
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698