OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/renderer/dispatcher.h" | 5 #include "extensions/renderer/dispatcher.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/alias.h" | 10 #include "base/debug/alias.h" |
(...skipping 1224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1235 return; // lazy binding still there, nothing to do | 1235 return; // lazy binding still there, nothing to do |
1236 if (bind_object->Get(v8_bind_name)->IsObject()) | 1236 if (bind_object->Get(v8_bind_name)->IsObject()) |
1237 return; // binding has already been fully installed | 1237 return; // binding has already been fully installed |
1238 } | 1238 } |
1239 | 1239 |
1240 ModuleSystem* module_system = context->module_system(); | 1240 ModuleSystem* module_system = context->module_system(); |
1241 if (!source_map_.Contains(api_name)) { | 1241 if (!source_map_.Contains(api_name)) { |
1242 module_system->RegisterNativeHandler( | 1242 module_system->RegisterNativeHandler( |
1243 api_name, | 1243 api_name, |
1244 scoped_ptr<NativeHandler>(new BindingGeneratingNativeHandler( | 1244 scoped_ptr<NativeHandler>(new BindingGeneratingNativeHandler( |
1245 module_system, api_name, "binding"))); | 1245 context, api_name, "binding"))); |
1246 module_system->SetNativeLazyField( | 1246 module_system->SetNativeLazyField( |
1247 bind_object, bind_name, api_name, "binding"); | 1247 bind_object, bind_name, api_name, "binding"); |
1248 } else { | 1248 } else { |
1249 module_system->SetLazyField(bind_object, bind_name, api_name, "binding"); | 1249 module_system->SetLazyField(bind_object, bind_name, api_name, "binding"); |
1250 } | 1250 } |
1251 } | 1251 } |
1252 | 1252 |
1253 // NOTE: please use the naming convention "foo_natives" for these. | 1253 // NOTE: please use the naming convention "foo_natives" for these. |
1254 void Dispatcher::RegisterNativeHandlers(ModuleSystem* module_system, | 1254 void Dispatcher::RegisterNativeHandlers(ModuleSystem* module_system, |
1255 ScriptContext* context) { | 1255 ScriptContext* context) { |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1444 // The "guestViewDeny" module must always be loaded last. It registers | 1444 // The "guestViewDeny" module must always be loaded last. It registers |
1445 // error-providing custom elements for the GuestView types that are not | 1445 // error-providing custom elements for the GuestView types that are not |
1446 // available, and thus all of those types must have been checked and loaded | 1446 // available, and thus all of those types must have been checked and loaded |
1447 // (or not loaded) beforehand. | 1447 // (or not loaded) beforehand. |
1448 if (context_type == Feature::BLESSED_EXTENSION_CONTEXT) { | 1448 if (context_type == Feature::BLESSED_EXTENSION_CONTEXT) { |
1449 module_system->Require("guestViewDeny"); | 1449 module_system->Require("guestViewDeny"); |
1450 } | 1450 } |
1451 } | 1451 } |
1452 | 1452 |
1453 } // namespace extensions | 1453 } // namespace extensions |
OLD | NEW |