| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2010-2011 Google Inc. All rights reserved. | 2 * Copyright (c) 2010-2011 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 { | 137 { |
| 138 v8::Local<v8::Value> data = context->GetEmbedderData(static_cast<int>(v8::Co
ntext::kDebugIdIndex)); | 138 v8::Local<v8::Value> data = context->GetEmbedderData(static_cast<int>(v8::Co
ntext::kDebugIdIndex)); |
| 139 if (data.IsEmpty() || !data->IsString()) | 139 if (data.IsEmpty() || !data->IsString()) |
| 140 return 0; | 140 return 0; |
| 141 String16 dataString = toProtocolString(data.As<v8::String>()); | 141 String16 dataString = toProtocolString(data.As<v8::String>()); |
| 142 if (dataString.isEmpty()) | 142 if (dataString.isEmpty()) |
| 143 return 0; | 143 return 0; |
| 144 size_t commaPos = dataString.find(","); | 144 size_t commaPos = dataString.find(","); |
| 145 if (commaPos == kNotFound) | 145 if (commaPos == kNotFound) |
| 146 return 0; | 146 return 0; |
| 147 return dataString.left(commaPos).toInt(); | 147 return dataString.substring(0, commaPos).toInt(); |
| 148 } | 148 } |
| 149 | 149 |
| 150 void V8DebuggerImpl::addAgent(int contextGroupId, V8DebuggerAgentImpl* agent) | 150 void V8DebuggerImpl::addAgent(int contextGroupId, V8DebuggerAgentImpl* agent) |
| 151 { | 151 { |
| 152 ASSERT(contextGroupId); | 152 ASSERT(contextGroupId); |
| 153 ASSERT(!m_agentsMap.contains(contextGroupId)); | 153 ASSERT(!m_agentsMap.contains(contextGroupId)); |
| 154 if (m_agentsMap.isEmpty()) | 154 if (m_agentsMap.isEmpty()) |
| 155 enable(); | 155 enable(); |
| 156 m_agentsMap.set(contextGroupId, agent); | 156 m_agentsMap.set(contextGroupId, agent); |
| 157 | 157 |
| (...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 800 } | 800 } |
| 801 | 801 |
| 802 v8::Local<v8::Context> V8DebuggerImpl::regexContext() | 802 v8::Local<v8::Context> V8DebuggerImpl::regexContext() |
| 803 { | 803 { |
| 804 if (m_regexContext.IsEmpty()) | 804 if (m_regexContext.IsEmpty()) |
| 805 m_regexContext.Reset(m_isolate, v8::Context::New(m_isolate)); | 805 m_regexContext.Reset(m_isolate, v8::Context::New(m_isolate)); |
| 806 return m_regexContext.Get(m_isolate); | 806 return m_regexContext.Get(m_isolate); |
| 807 } | 807 } |
| 808 | 808 |
| 809 } // namespace blink | 809 } // namespace blink |
| OLD | NEW |