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/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 } // namespace | 91 } // namespace |
92 | 92 |
93 std::string ModuleSystem::ExceptionHandler::CreateExceptionString( | 93 std::string ModuleSystem::ExceptionHandler::CreateExceptionString( |
94 const v8::TryCatch& try_catch) { | 94 const v8::TryCatch& try_catch) { |
95 v8::Handle<v8::Message> message(try_catch.Message()); | 95 v8::Handle<v8::Message> message(try_catch.Message()); |
96 if (message.IsEmpty()) { | 96 if (message.IsEmpty()) { |
97 return "try_catch has no message"; | 97 return "try_catch has no message"; |
98 } | 98 } |
99 | 99 |
100 std::string resource_name = "<unknown resource>"; | 100 std::string resource_name = "<unknown resource>"; |
101 if (!message->GetScriptResourceName().IsEmpty()) { | 101 if (!message->GetScriptOrigin().ResourceName().IsEmpty()) { |
102 v8::String::Utf8Value resource_name_v8( | 102 v8::String::Utf8Value resource_name_v8( |
103 message->GetScriptResourceName()->ToString()); | 103 message->GetScriptOrigin().ResourceName()->ToString()); |
104 resource_name.assign(*resource_name_v8, resource_name_v8.length()); | 104 resource_name.assign(*resource_name_v8, resource_name_v8.length()); |
105 } | 105 } |
106 | 106 |
107 std::string error_message = "<no error message>"; | 107 std::string error_message = "<no error message>"; |
108 if (!message->Get().IsEmpty()) { | 108 if (!message->Get().IsEmpty()) { |
109 v8::String::Utf8Value error_message_v8(message->Get()); | 109 v8::String::Utf8Value error_message_v8(message->Get()); |
110 error_message.assign(*error_message_v8, error_message_v8.length()); | 110 error_message.assign(*error_message_v8, error_message_v8.length()); |
111 } | 111 } |
112 | 112 |
113 return base::StringPrintf("%s:%d: %s", | 113 return base::StringPrintf("%s:%d: %s", |
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
580 v8::String::NewFromUtf8(GetIsolate(), "privates"); | 580 v8::String::NewFromUtf8(GetIsolate(), "privates"); |
581 v8::Local<v8::Value> privates = obj->GetHiddenValue(privates_key); | 581 v8::Local<v8::Value> privates = obj->GetHiddenValue(privates_key); |
582 if (privates.IsEmpty()) { | 582 if (privates.IsEmpty()) { |
583 privates = v8::Object::New(args.GetIsolate()); | 583 privates = v8::Object::New(args.GetIsolate()); |
584 obj->SetHiddenValue(privates_key, privates); | 584 obj->SetHiddenValue(privates_key, privates); |
585 } | 585 } |
586 args.GetReturnValue().Set(privates); | 586 args.GetReturnValue().Set(privates); |
587 } | 587 } |
588 | 588 |
589 } // namespace extensions | 589 } // namespace extensions |
OLD | NEW |