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

Side by Side Diff: ios/web/webui/crw_web_ui_manager.mm

Issue 2522943003: [iOS/ARC] Fix a violation of ODR in base::BindBlock under ARC. (Closed)
Patch Set: Use EXPECT_NSEQ instead of EXPECT_EQ/EXPECT_TRUE. Created 4 years 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
« no previous file with comments | « ios/web/net/request_tracker_impl.mm ('k') | ios/web/webui/mojo_facade.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/webui/crw_web_ui_manager.h" 5 #import "ios/web/webui/crw_web_ui_manager.h"
6 6
7 #include "base/json/string_escape.h" 7 #include "base/json/string_escape.h"
8 #include "base/mac/bind_objc_block.h" 8 #include "base/mac/bind_objc_block.h"
9 #include "base/mac/scoped_nsobject.h" 9 #include "base/mac/scoped_nsobject.h"
10 #include "base/memory/ref_counted_memory.h" 10 #include "base/memory/ref_counted_memory.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 return self; 84 return self;
85 } 85 }
86 86
87 - (instancetype)initWithWebState:(web::WebStateImpl*)webState { 87 - (instancetype)initWithWebState:(web::WebStateImpl*)webState {
88 if (self = [super init]) { 88 if (self = [super init]) {
89 _webState = webState; 89 _webState = webState;
90 _webStateObserverBridge.reset( 90 _webStateObserverBridge.reset(
91 new web::WebStateObserverBridge(webState, self)); 91 new web::WebStateObserverBridge(webState, self));
92 base::WeakNSObject<CRWWebUIManager> weakSelf(self); 92 base::WeakNSObject<CRWWebUIManager> weakSelf(self);
93 _webState->AddScriptCommandCallback( 93 _webState->AddScriptCommandCallback(
94 base::BindBlock( 94 base::BindBlockArc(
95 ^bool(const base::DictionaryValue& message, const GURL&, bool) { 95 ^bool(const base::DictionaryValue& message, const GURL&, bool) {
96 return [weakSelf handleWebUIJSMessage:message]; 96 return [weakSelf handleWebUIJSMessage:message];
97 }), 97 }),
98 kScriptCommandPrefix); 98 kScriptCommandPrefix);
99 } 99 }
100 return self; 100 return self;
101 } 101 }
102 102
103 - (void)dealloc { 103 - (void)dealloc {
104 [self resetWebState]; 104 [self resetWebState];
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 332
333 - (std::unique_ptr<web::URLFetcherBlockAdapter>) 333 - (std::unique_ptr<web::URLFetcherBlockAdapter>)
334 fetcherForURL:(const GURL&)URL 334 fetcherForURL:(const GURL&)URL
335 completionHandler:(web::URLFetcherBlockAdapterCompletion)handler { 335 completionHandler:(web::URLFetcherBlockAdapterCompletion)handler {
336 return std::unique_ptr<web::URLFetcherBlockAdapter>( 336 return std::unique_ptr<web::URLFetcherBlockAdapter>(
337 new web::URLFetcherBlockAdapter( 337 new web::URLFetcherBlockAdapter(
338 URL, _webState->GetBrowserState()->GetRequestContext(), handler)); 338 URL, _webState->GetBrowserState()->GetRequestContext(), handler));
339 } 339 }
340 340
341 @end 341 @end
OLDNEW
« no previous file with comments | « ios/web/net/request_tracker_impl.mm ('k') | ios/web/webui/mojo_facade.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698