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

Side by Side Diff: extensions/renderer/dispatcher.cc

Issue 1192763002: extensions: Use V8 Maybe APIs in NativeHandler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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 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 1222 matching lines...) Expand 10 before | Expand all | Expand 10 after
1233 return; // lazy binding still there, nothing to do 1233 return; // lazy binding still there, nothing to do
1234 if (bind_object->Get(v8_bind_name)->IsObject()) 1234 if (bind_object->Get(v8_bind_name)->IsObject())
1235 return; // binding has already been fully installed 1235 return; // binding has already been fully installed
1236 } 1236 }
1237 1237
1238 ModuleSystem* module_system = context->module_system(); 1238 ModuleSystem* module_system = context->module_system();
1239 if (!source_map_.Contains(api_name)) { 1239 if (!source_map_.Contains(api_name)) {
1240 module_system->RegisterNativeHandler( 1240 module_system->RegisterNativeHandler(
1241 api_name, 1241 api_name,
1242 scoped_ptr<NativeHandler>(new BindingGeneratingNativeHandler( 1242 scoped_ptr<NativeHandler>(new BindingGeneratingNativeHandler(
1243 module_system, api_name, "binding"))); 1243 context, api_name, "binding")));
1244 module_system->SetNativeLazyField( 1244 module_system->SetNativeLazyField(
1245 bind_object, bind_name, api_name, "binding"); 1245 bind_object, bind_name, api_name, "binding");
1246 } else { 1246 } else {
1247 module_system->SetLazyField(bind_object, bind_name, api_name, "binding"); 1247 module_system->SetLazyField(bind_object, bind_name, api_name, "binding");
1248 } 1248 }
1249 } 1249 }
1250 1250
1251 // NOTE: please use the naming convention "foo_natives" for these. 1251 // NOTE: please use the naming convention "foo_natives" for these.
1252 void Dispatcher::RegisterNativeHandlers(ModuleSystem* module_system, 1252 void Dispatcher::RegisterNativeHandlers(ModuleSystem* module_system,
1253 ScriptContext* context) { 1253 ScriptContext* context) {
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
1442 // The "guestViewDeny" module must always be loaded last. It registers 1442 // The "guestViewDeny" module must always be loaded last. It registers
1443 // error-providing custom elements for the GuestView types that are not 1443 // error-providing custom elements for the GuestView types that are not
1444 // available, and thus all of those types must have been checked and loaded 1444 // available, and thus all of those types must have been checked and loaded
1445 // (or not loaded) beforehand. 1445 // (or not loaded) beforehand.
1446 if (context_type == Feature::BLESSED_EXTENSION_CONTEXT) { 1446 if (context_type == Feature::BLESSED_EXTENSION_CONTEXT) {
1447 module_system->Require("guestViewDeny"); 1447 module_system->Require("guestViewDeny");
1448 } 1448 }
1449 } 1449 }
1450 1450
1451 } // namespace extensions 1451 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/renderer/binding_generating_native_handler.cc ('k') | extensions/renderer/module_system.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698