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

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

Issue 2150303002: Remove the prototype from all V8 functions that aren't constructors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: Created 4 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
« no previous file with comments | « extensions/renderer/console.cc ('k') | extensions/renderer/object_backed_native_handler.cc » ('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 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/module_system.h" 5 #include "extensions/renderer/module_system.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after
655 v8::Local<v8::Function> func = v8::Local<v8::Function>::Cast(func_as_value); 655 v8::Local<v8::Function> func = v8::Local<v8::Function>::Cast(func_as_value);
656 656
657 v8::Local<v8::Object> define_object = v8::Object::New(GetIsolate()); 657 v8::Local<v8::Object> define_object = v8::Object::New(GetIsolate());
658 gin::ModuleRegistry::InstallGlobals(GetIsolate(), define_object); 658 gin::ModuleRegistry::InstallGlobals(GetIsolate(), define_object);
659 659
660 v8::Local<v8::Object> exports = v8::Object::New(GetIsolate()); 660 v8::Local<v8::Object> exports = v8::Object::New(GetIsolate());
661 661
662 v8::Local<v8::FunctionTemplate> tmpl = v8::FunctionTemplate::New( 662 v8::Local<v8::FunctionTemplate> tmpl = v8::FunctionTemplate::New(
663 GetIsolate(), 663 GetIsolate(),
664 &SetExportsProperty); 664 &SetExportsProperty);
665 tmpl->RemovePrototype();
665 v8::Local<v8::String> v8_key; 666 v8::Local<v8::String> v8_key;
666 if (!v8_helpers::ToV8String(GetIsolate(), "$set", &v8_key)) { 667 if (!v8_helpers::ToV8String(GetIsolate(), "$set", &v8_key)) {
667 NOTREACHED(); 668 NOTREACHED();
668 return v8::Undefined(GetIsolate()); 669 return v8::Undefined(GetIsolate());
669 } 670 }
670 671
671 v8::Local<v8::Function> function; 672 v8::Local<v8::Function> function;
672 if (!tmpl->GetFunction(v8_context).ToLocal(&function)) { 673 if (!tmpl->GetFunction(v8_context).ToLocal(&function)) {
673 NOTREACHED(); 674 NOTREACHED();
674 return v8::Undefined(GetIsolate()); 675 return v8::Undefined(GetIsolate());
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
751 752
752 void ModuleSystem::ClobberExistingNativeHandler(const std::string& name) { 753 void ModuleSystem::ClobberExistingNativeHandler(const std::string& name) {
753 NativeHandlerMap::iterator existing_handler = native_handler_map_.find(name); 754 NativeHandlerMap::iterator existing_handler = native_handler_map_.find(name);
754 if (existing_handler != native_handler_map_.end()) { 755 if (existing_handler != native_handler_map_.end()) {
755 clobbered_native_handlers_.push_back(std::move(existing_handler->second)); 756 clobbered_native_handlers_.push_back(std::move(existing_handler->second));
756 native_handler_map_.erase(existing_handler); 757 native_handler_map_.erase(existing_handler);
757 } 758 }
758 } 759 }
759 760
760 } // namespace extensions 761 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/renderer/console.cc ('k') | extensions/renderer/object_backed_native_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698