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 827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 838 }; | 838 }; |
| 839 { | 839 { |
| 840 v8::TryCatch try_catch(GetIsolate()); | 840 v8::TryCatch try_catch(GetIsolate()); |
| 841 try_catch.SetCaptureMessage(true); | 841 try_catch.SetCaptureMessage(true); |
| 842 context_->SafeCallFunction(func, arraysize(args), args); | 842 context_->SafeCallFunction(func, arraysize(args), args); |
| 843 if (try_catch.HasCaught()) { | 843 if (try_catch.HasCaught()) { |
| 844 HandleException(try_catch); | 844 HandleException(try_catch); |
| 845 return v8::Undefined(GetIsolate()); | 845 return v8::Undefined(GetIsolate()); |
| 846 } | 846 } |
| 847 } | 847 } |
| 848 | |
|
jbroman
2017/06/12 15:09:48
super-nit: accidental change?
Devlin
2017/06/12 20:30:14
Yep! Removed.
| |
| 848 return handle_scope.Escape(exports); | 849 return handle_scope.Escape(exports); |
| 849 } | 850 } |
| 850 | 851 |
| 851 void ModuleSystem::OnDidAddPendingModule( | 852 void ModuleSystem::OnDidAddPendingModule( |
| 852 const std::string& id, | 853 const std::string& id, |
| 853 const std::vector<std::string>& dependencies) { | 854 const std::vector<std::string>& dependencies) { |
| 854 bool module_system_managed = source_map_->Contains(id); | 855 bool module_system_managed = source_map_->Contains(id); |
| 855 | 856 |
| 856 gin::ModuleRegistry* registry = | 857 gin::ModuleRegistry* registry = |
| 857 gin::ModuleRegistry::From(context_->v8_context()); | 858 gin::ModuleRegistry::From(context_->v8_context()); |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 918 !value->IsFunction()) { | 919 !value->IsFunction()) { |
| 919 Fatal(context_, module_name + "." + method_name + " is not a function"); | 920 Fatal(context_, module_name + "." + method_name + " is not a function"); |
| 920 return function; | 921 return function; |
| 921 } | 922 } |
| 922 | 923 |
| 923 function = v8::Local<v8::Function>::Cast(value); | 924 function = v8::Local<v8::Function>::Cast(value); |
| 924 return function; | 925 return function; |
| 925 } | 926 } |
| 926 | 927 |
| 927 } // namespace extensions | 928 } // namespace extensions |
| OLD | NEW |