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

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

Issue 2618693004: Mojo JS bindings: make sure that console.log() could be used in the bindings. (Closed)
Patch Set: . Created 3 years, 11 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 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 #import "base/mac/bind_objc_block.h" 8 #import "base/mac/bind_objc_block.h"
9 #import "base/mac/scoped_nsobject.h" 9 #import "base/mac/scoped_nsobject.h"
10 #include "base/memory/ref_counted_memory.h" 10 #include "base/memory/ref_counted_memory.h"
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 // Look for built-in scripts first. 216 // Look for built-in scripts first.
217 std::map<std::string, int> resource_map{ 217 std::map<std::string, int> resource_map{
218 {mojo::kBindingsModuleName, IDR_MOJO_BINDINGS_JS}, 218 {mojo::kBindingsModuleName, IDR_MOJO_BINDINGS_JS},
219 {mojo::kBufferModuleName, IDR_MOJO_BUFFER_JS}, 219 {mojo::kBufferModuleName, IDR_MOJO_BUFFER_JS},
220 {mojo::kCodecModuleName, IDR_MOJO_CODEC_JS}, 220 {mojo::kCodecModuleName, IDR_MOJO_CODEC_JS},
221 {mojo::kConnectorModuleName, IDR_MOJO_CONNECTOR_JS}, 221 {mojo::kConnectorModuleName, IDR_MOJO_CONNECTOR_JS},
222 {mojo::kInterfaceTypesModuleName, IDR_MOJO_INTERFACE_TYPES_JS}, 222 {mojo::kInterfaceTypesModuleName, IDR_MOJO_INTERFACE_TYPES_JS},
223 {mojo::kRouterModuleName, IDR_MOJO_ROUTER_JS}, 223 {mojo::kRouterModuleName, IDR_MOJO_ROUTER_JS},
224 {mojo::kUnicodeModuleName, IDR_MOJO_UNICODE_JS}, 224 {mojo::kUnicodeModuleName, IDR_MOJO_UNICODE_JS},
225 {mojo::kValidatorModuleName, IDR_MOJO_VALIDATOR_JS}, 225 {mojo::kValidatorModuleName, IDR_MOJO_VALIDATOR_JS},
226 {web::kConsoleModuleName, IDR_IOS_CONSOLE_JS},
226 {web::kSyncMessageChannelModuleName, 227 {web::kSyncMessageChannelModuleName,
227 IDR_IOS_MOJO_SYNC_MESSAGE_CHANNEL_JS}, 228 IDR_IOS_MOJO_SYNC_MESSAGE_CHANNEL_JS},
228 {web::kHandleUtilModuleName, IDR_IOS_MOJO_HANDLE_UTIL_JS}, 229 {web::kHandleUtilModuleName, IDR_IOS_MOJO_HANDLE_UTIL_JS},
229 {web::kSupportModuleName, IDR_IOS_MOJO_SUPPORT_JS}, 230 {web::kSupportModuleName, IDR_IOS_MOJO_SUPPORT_JS},
230 {web::kCoreModuleName, IDR_IOS_MOJO_CORE_JS}, 231 {web::kCoreModuleName, IDR_IOS_MOJO_CORE_JS},
231 {web::kInterfaceProviderModuleName, IDR_IOS_SHELL_INTERFACE_PROVIDER_JS}, 232 {web::kInterfaceProviderModuleName, IDR_IOS_SHELL_INTERFACE_PROVIDER_JS},
232 }; 233 };
233 scoped_refptr<base::RefCountedMemory> scriptData( 234 scoped_refptr<base::RefCountedMemory> scriptData(
234 web::GetWebClient()->GetDataResourceBytes(resource_map[moduleName])); 235 web::GetWebClient()->GetDataResourceBytes(resource_map[moduleName]));
235 if (scriptData) { 236 if (scriptData) {
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 301
301 - (std::unique_ptr<web::URLFetcherBlockAdapter>) 302 - (std::unique_ptr<web::URLFetcherBlockAdapter>)
302 fetcherForURL:(const GURL&)URL 303 fetcherForURL:(const GURL&)URL
303 completionHandler:(web::URLFetcherBlockAdapterCompletion)handler { 304 completionHandler:(web::URLFetcherBlockAdapterCompletion)handler {
304 return std::unique_ptr<web::URLFetcherBlockAdapter>( 305 return std::unique_ptr<web::URLFetcherBlockAdapter>(
305 new web::URLFetcherBlockAdapter( 306 new web::URLFetcherBlockAdapter(
306 URL, _webState->GetBrowserState()->GetRequestContext(), handler)); 307 URL, _webState->GetBrowserState()->GetRequestContext(), handler));
307 } 308 }
308 309
309 @end 310 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698