Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(341)

Side by Side Diff: third_party/WebKit/Source/platform/v8_inspector/V8DebuggerImpl.cpp

Issue 1779033003: DevTools: always use 16bit strings for inspector protocol. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebaselined Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 { 138 {
139 v8::Local<v8::Value> data = context->GetEmbedderData(static_cast<int>(v8::Co ntext::kDebugIdIndex)); 139 v8::Local<v8::Value> data = context->GetEmbedderData(static_cast<int>(v8::Co ntext::kDebugIdIndex));
140 if (data.IsEmpty() || !data->IsString()) 140 if (data.IsEmpty() || !data->IsString())
141 return 0; 141 return 0;
142 String16 dataString = toProtocolString(data.As<v8::String>()); 142 String16 dataString = toProtocolString(data.As<v8::String>());
143 if (dataString.isEmpty()) 143 if (dataString.isEmpty())
144 return 0; 144 return 0;
145 size_t commaPos = dataString.find(","); 145 size_t commaPos = dataString.find(",");
146 if (commaPos == kNotFound) 146 if (commaPos == kNotFound)
147 return 0; 147 return 0;
148 return dataString.left(commaPos).toInt(); 148 return dataString.substring(0, commaPos).toInt();
149 } 149 }
150 150
151 void V8DebuggerImpl::addDebuggerAgent(int contextGroupId, V8DebuggerAgentImpl* a gent) 151 void V8DebuggerImpl::addDebuggerAgent(int contextGroupId, V8DebuggerAgentImpl* a gent)
152 { 152 {
153 ASSERT(contextGroupId); 153 ASSERT(contextGroupId);
154 ASSERT(!m_debuggerAgentsMap.contains(contextGroupId)); 154 ASSERT(!m_debuggerAgentsMap.contains(contextGroupId));
155 if (m_debuggerAgentsMap.isEmpty()) 155 if (m_debuggerAgentsMap.isEmpty())
156 enable(); 156 enable();
157 m_debuggerAgentsMap.set(contextGroupId, agent); 157 m_debuggerAgentsMap.set(contextGroupId, agent);
158 158
(...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after
837 } 837 }
838 838
839 v8::Local<v8::Context> V8DebuggerImpl::regexContext() 839 v8::Local<v8::Context> V8DebuggerImpl::regexContext()
840 { 840 {
841 if (m_regexContext.IsEmpty()) 841 if (m_regexContext.IsEmpty())
842 m_regexContext.Reset(m_isolate, v8::Context::New(m_isolate)); 842 m_regexContext.Reset(m_isolate, v8::Context::New(m_isolate));
843 return m_regexContext.Get(m_isolate); 843 return m_regexContext.Get(m_isolate);
844 } 844 }
845 845
846 } // namespace blink 846 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698