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

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: 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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698