OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 the V8 project 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 // The infrastructure used for (localized) message reporting in V8. | 5 // The infrastructure used for (localized) message reporting in V8. |
6 // | 6 // |
7 // Note: there's a big unresolved issue about ownership of the data | 7 // Note: there's a big unresolved issue about ownership of the data |
8 // structures used by this framework. | 8 // structures used by this framework. |
9 | 9 |
10 #ifndef V8_MESSAGES_H_ | 10 #ifndef V8_MESSAGES_H_ |
11 #define V8_MESSAGES_H_ | 11 #define V8_MESSAGES_H_ |
12 | 12 |
| 13 #include <memory> |
| 14 |
13 #include "src/base/smart-pointers.h" | 15 #include "src/base/smart-pointers.h" |
14 #include "src/handles.h" | 16 #include "src/handles.h" |
15 #include "src/list.h" | 17 #include "src/list.h" |
16 | 18 |
17 namespace v8 { | 19 namespace v8 { |
18 namespace internal { | 20 namespace internal { |
19 | 21 |
20 // Forward declarations. | 22 // Forward declarations. |
21 class JSMessageObject; | 23 class JSMessageObject; |
22 class LookupIterator; | 24 class LookupIterator; |
(...skipping 525 matching lines...) Loading... |
548 MessageLocation* location, Handle<Object> argument, | 550 MessageLocation* location, Handle<Object> argument, |
549 Handle<JSArray> stack_frames); | 551 Handle<JSArray> stack_frames); |
550 | 552 |
551 // Report a formatted message (needs JS allocation). | 553 // Report a formatted message (needs JS allocation). |
552 static void ReportMessage(Isolate* isolate, MessageLocation* loc, | 554 static void ReportMessage(Isolate* isolate, MessageLocation* loc, |
553 Handle<JSMessageObject> message); | 555 Handle<JSMessageObject> message); |
554 | 556 |
555 static void DefaultMessageReport(Isolate* isolate, const MessageLocation* loc, | 557 static void DefaultMessageReport(Isolate* isolate, const MessageLocation* loc, |
556 Handle<Object> message_obj); | 558 Handle<Object> message_obj); |
557 static Handle<String> GetMessage(Isolate* isolate, Handle<Object> data); | 559 static Handle<String> GetMessage(Isolate* isolate, Handle<Object> data); |
558 static base::SmartArrayPointer<char> GetLocalizedMessage(Isolate* isolate, | 560 static std::unique_ptr<char[]> GetLocalizedMessage(Isolate* isolate, |
559 Handle<Object> data); | 561 Handle<Object> data); |
560 }; | 562 }; |
561 | 563 |
562 | 564 |
563 } // namespace internal | 565 } // namespace internal |
564 } // namespace v8 | 566 } // namespace v8 |
565 | 567 |
566 #endif // V8_MESSAGES_H_ | 568 #endif // V8_MESSAGES_H_ |
OLD | NEW |