Chromium Code Reviews| 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/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 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 690 } | 690 } |
| 691 | 691 |
| 692 v8::Local<v8::Value> ModuleSystem::LoadModule(const std::string& module_name) { | 692 v8::Local<v8::Value> ModuleSystem::LoadModule(const std::string& module_name) { |
| 693 return LoadModuleWithNativeAPIBridge(module_name, | 693 return LoadModuleWithNativeAPIBridge(module_name, |
| 694 v8::Undefined(GetIsolate())); | 694 v8::Undefined(GetIsolate())); |
| 695 } | 695 } |
| 696 | 696 |
| 697 v8::Local<v8::Value> ModuleSystem::LoadModuleWithNativeAPIBridge( | 697 v8::Local<v8::Value> ModuleSystem::LoadModuleWithNativeAPIBridge( |
| 698 const std::string& module_name, | 698 const std::string& module_name, |
| 699 v8::Local<v8::Value> api_bridge) { | 699 v8::Local<v8::Value> api_bridge) { |
| 700 LOG(WARNING) << "Module: " << module_name; | |
|
lazyboy
2017/06/27 17:47:22
Remove this debug logs.
Devlin
2017/06/28 18:25:48
Whoops! Thought I did that. Done.
| |
| 700 v8::EscapableHandleScope handle_scope(GetIsolate()); | 701 v8::EscapableHandleScope handle_scope(GetIsolate()); |
| 701 v8::Local<v8::Context> v8_context = context()->v8_context(); | 702 v8::Local<v8::Context> v8_context = context()->v8_context(); |
| 702 v8::Context::Scope context_scope(v8_context); | 703 v8::Context::Scope context_scope(v8_context); |
| 703 | 704 |
| 704 v8::Local<v8::String> source = | 705 v8::Local<v8::String> source = |
| 705 source_map_->GetSource(GetIsolate(), module_name); | 706 source_map_->GetSource(GetIsolate(), module_name); |
| 706 if (source.IsEmpty()) { | 707 if (source.IsEmpty()) { |
| 707 Fatal(context_, "No source for require(" + module_name + ")"); | 708 Fatal(context_, "No source for require(" + module_name + ")"); |
| 708 return v8::Undefined(GetIsolate()); | 709 return v8::Undefined(GetIsolate()); |
| 709 } | 710 } |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 882 !value->IsFunction()) { | 883 !value->IsFunction()) { |
| 883 Fatal(context_, module_name + "." + method_name + " is not a function"); | 884 Fatal(context_, module_name + "." + method_name + " is not a function"); |
| 884 return function; | 885 return function; |
| 885 } | 886 } |
| 886 | 887 |
| 887 function = v8::Local<v8::Function>::Cast(value); | 888 function = v8::Local<v8::Function>::Cast(value); |
| 888 return function; | 889 return function; |
| 889 } | 890 } |
| 890 | 891 |
| 891 } // namespace extensions | 892 } // namespace extensions |
| OLD | NEW |