| 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/v8-console-message.h" | 5 #include "src/inspector/v8-console-message.h" |
| 6 | 6 |
| 7 #include "src/inspector/inspected-context.h" | 7 #include "src/inspector/inspected-context.h" |
| 8 #include "src/inspector/protocol/Protocol.h" | 8 #include "src/inspector/protocol/Protocol.h" |
| 9 #include "src/inspector/string-util.h" | 9 #include "src/inspector/string-util.h" |
| 10 #include "src/inspector/v8-console-agent-impl.h" | 10 #include "src/inspector/v8-console-agent-impl.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 if (!builder.append(value)) return String16(); | 69 if (!builder.append(value)) return String16(); |
| 70 return builder.toString(); | 70 return builder.toString(); |
| 71 } | 71 } |
| 72 | 72 |
| 73 private: | 73 private: |
| 74 enum { | 74 enum { |
| 75 IgnoreNull = 1 << 0, | 75 IgnoreNull = 1 << 0, |
| 76 IgnoreUndefined = 1 << 1, | 76 IgnoreUndefined = 1 << 1, |
| 77 }; | 77 }; |
| 78 | 78 |
| 79 V8ValueStringBuilder(v8::Local<v8::Context> context) | 79 explicit V8ValueStringBuilder(v8::Local<v8::Context> context) |
| 80 : m_arrayLimit(maxArrayItemsLimit), | 80 : m_arrayLimit(maxArrayItemsLimit), |
| 81 m_isolate(context->GetIsolate()), | 81 m_isolate(context->GetIsolate()), |
| 82 m_tryCatch(context->GetIsolate()), | 82 m_tryCatch(context->GetIsolate()), |
| 83 m_context(context) {} | 83 m_context(context) {} |
| 84 | 84 |
| 85 bool append(v8::Local<v8::Value> value, unsigned ignoreOptions = 0) { | 85 bool append(v8::Local<v8::Value> value, unsigned ignoreOptions = 0) { |
| 86 if (value.IsEmpty()) return true; | 86 if (value.IsEmpty()) return true; |
| 87 if ((ignoreOptions & IgnoreNull) && value->IsNull()) return true; | 87 if ((ignoreOptions & IgnoreNull) && value->IsNull()) return true; |
| 88 if ((ignoreOptions & IgnoreUndefined) && value->IsUndefined()) return true; | 88 if ((ignoreOptions & IgnoreUndefined) && value->IsUndefined()) return true; |
| 89 if (value->IsString()) return append(v8::Local<v8::String>::Cast(value)); | 89 if (value->IsString()) return append(v8::Local<v8::String>::Cast(value)); |
| (...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 464 m_inspector->sessionForContextGroup(m_contextGroupId)) | 464 m_inspector->sessionForContextGroup(m_contextGroupId)) |
| 465 session->releaseObjectGroup("console"); | 465 session->releaseObjectGroup("console"); |
| 466 } | 466 } |
| 467 | 467 |
| 468 void V8ConsoleMessageStorage::contextDestroyed(int contextId) { | 468 void V8ConsoleMessageStorage::contextDestroyed(int contextId) { |
| 469 for (size_t i = 0; i < m_messages.size(); ++i) | 469 for (size_t i = 0; i < m_messages.size(); ++i) |
| 470 m_messages[i]->contextDestroyed(contextId); | 470 m_messages[i]->contextDestroyed(contextId); |
| 471 } | 471 } |
| 472 | 472 |
| 473 } // namespace v8_inspector | 473 } // namespace v8_inspector |
| OLD | NEW |