| OLD | NEW |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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 #include "src/inspector/V8ConsoleMessage.h" | 5 #include "src/inspector/V8ConsoleMessage.h" |
| 6 | 6 |
| 7 #include "src/inspector/InspectedContext.h" | 7 #include "src/inspector/InspectedContext.h" |
| 8 #include "src/inspector/StringUtil.h" | 8 #include "src/inspector/StringUtil.h" |
| 9 #include "src/inspector/V8ConsoleAgentImpl.h" | 9 #include "src/inspector/V8ConsoleAgentImpl.h" |
| 10 #include "src/inspector/V8InspectorImpl.h" | 10 #include "src/inspector/V8InspectorImpl.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 if (!builder.append(value)) return String16(); | 68 if (!builder.append(value)) return String16(); |
| 69 return builder.toString(); | 69 return builder.toString(); |
| 70 } | 70 } |
| 71 | 71 |
| 72 private: | 72 private: |
| 73 enum { | 73 enum { |
| 74 IgnoreNull = 1 << 0, | 74 IgnoreNull = 1 << 0, |
| 75 IgnoreUndefined = 1 << 1, | 75 IgnoreUndefined = 1 << 1, |
| 76 }; | 76 }; |
| 77 | 77 |
| 78 V8ValueStringBuilder(v8::Isolate* isolate) | 78 explicit V8ValueStringBuilder(v8::Isolate* isolate) |
| 79 : m_arrayLimit(maxArrayItemsLimit), | 79 : m_arrayLimit(maxArrayItemsLimit), |
| 80 m_isolate(isolate), | 80 m_isolate(isolate), |
| 81 m_tryCatch(isolate) {} | 81 m_tryCatch(isolate) {} |
| 82 | 82 |
| 83 bool append(v8::Local<v8::Value> value, unsigned ignoreOptions = 0) { | 83 bool append(v8::Local<v8::Value> value, unsigned ignoreOptions = 0) { |
| 84 if (value.IsEmpty()) return true; | 84 if (value.IsEmpty()) return true; |
| 85 if ((ignoreOptions & IgnoreNull) && value->IsNull()) return true; | 85 if ((ignoreOptions & IgnoreNull) && value->IsNull()) return true; |
| 86 if ((ignoreOptions & IgnoreUndefined) && value->IsUndefined()) return true; | 86 if ((ignoreOptions & IgnoreUndefined) && value->IsUndefined()) return true; |
| 87 if (value->IsString()) return append(v8::Local<v8::String>::Cast(value)); | 87 if (value->IsString()) return append(v8::Local<v8::String>::Cast(value)); |
| 88 if (value->IsStringObject()) | 88 if (value->IsStringObject()) |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 457 m_inspector->sessionForContextGroup(m_contextGroupId)) | 457 m_inspector->sessionForContextGroup(m_contextGroupId)) |
| 458 session->releaseObjectGroup("console"); | 458 session->releaseObjectGroup("console"); |
| 459 } | 459 } |
| 460 | 460 |
| 461 void V8ConsoleMessageStorage::contextDestroyed(int contextId) { | 461 void V8ConsoleMessageStorage::contextDestroyed(int contextId) { |
| 462 for (size_t i = 0; i < m_messages.size(); ++i) | 462 for (size_t i = 0; i < m_messages.size(); ++i) |
| 463 m_messages[i]->contextDestroyed(contextId); | 463 m_messages[i]->contextDestroyed(contextId); |
| 464 } | 464 } |
| 465 | 465 |
| 466 } // namespace v8_inspector | 466 } // namespace v8_inspector |
| OLD | NEW |