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

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

Issue 2151083002: DevTools: explicitly differentiate ints vs doubles in the protocol bindings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: lcean Created 4 years, 5 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 481 matching lines...) Expand 10 before | Expand all | Expand 10 after
492 V8DebuggerAgentImpl* agent = findEnabledDebuggerAgent(pausedContext); 492 V8DebuggerAgentImpl* agent = findEnabledDebuggerAgent(pausedContext);
493 if (!agent) 493 if (!agent)
494 return; 494 return;
495 495
496 std::vector<String16> breakpointIds; 496 std::vector<String16> breakpointIds;
497 if (!hitBreakpointNumbers.IsEmpty()) { 497 if (!hitBreakpointNumbers.IsEmpty()) {
498 breakpointIds.reserve(hitBreakpointNumbers->Length()); 498 breakpointIds.reserve(hitBreakpointNumbers->Length());
499 for (size_t i = 0; i < hitBreakpointNumbers->Length(); i++) { 499 for (size_t i = 0; i < hitBreakpointNumbers->Length(); i++) {
500 v8::Local<v8::Value> hitBreakpointNumber = hitBreakpointNumbers->Get (i); 500 v8::Local<v8::Value> hitBreakpointNumber = hitBreakpointNumbers->Get (i);
501 DCHECK(!hitBreakpointNumber.IsEmpty() && hitBreakpointNumber->IsInt3 2()); 501 DCHECK(!hitBreakpointNumber.IsEmpty() && hitBreakpointNumber->IsInt3 2());
502 breakpointIds.push_back(String16::number(hitBreakpointNumber->Int32V alue())); 502 breakpointIds.push_back(String16::fromInteger(hitBreakpointNumber->I nt32Value()));
503 } 503 }
504 } 504 }
505 505
506 m_pausedContext = pausedContext; 506 m_pausedContext = pausedContext;
507 m_executionState = executionState; 507 m_executionState = executionState;
508 V8DebuggerAgentImpl::SkipPauseRequest result = agent->didPause(pausedContext , exception, breakpointIds, isPromiseRejection); 508 V8DebuggerAgentImpl::SkipPauseRequest result = agent->didPause(pausedContext , exception, breakpointIds, isPromiseRejection);
509 if (result == V8DebuggerAgentImpl::RequestNoSkip) { 509 if (result == V8DebuggerAgentImpl::RequestNoSkip) {
510 m_runningNestedMessageLoop = true; 510 m_runningNestedMessageLoop = true;
511 int groupId = getGroupId(pausedContext); 511 int groupId = getGroupId(pausedContext);
512 DCHECK(groupId); 512 DCHECK(groupId);
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
747 v8::Local<v8::Value> V8DebuggerImpl::functionLocation(v8::Local<v8::Context> con text, v8::Local<v8::Function> function) 747 v8::Local<v8::Value> V8DebuggerImpl::functionLocation(v8::Local<v8::Context> con text, v8::Local<v8::Function> function)
748 { 748 {
749 int scriptId = function->ScriptId(); 749 int scriptId = function->ScriptId();
750 if (scriptId == v8::UnboundScript::kNoScriptId) 750 if (scriptId == v8::UnboundScript::kNoScriptId)
751 return v8::Null(m_isolate); 751 return v8::Null(m_isolate);
752 int lineNumber = function->GetScriptLineNumber(); 752 int lineNumber = function->GetScriptLineNumber();
753 int columnNumber = function->GetScriptColumnNumber(); 753 int columnNumber = function->GetScriptColumnNumber();
754 if (lineNumber == v8::Function::kLineOffsetNotFound || columnNumber == v8::F unction::kLineOffsetNotFound) 754 if (lineNumber == v8::Function::kLineOffsetNotFound || columnNumber == v8::F unction::kLineOffsetNotFound)
755 return v8::Null(m_isolate); 755 return v8::Null(m_isolate);
756 v8::Local<v8::Object> location = v8::Object::New(m_isolate); 756 v8::Local<v8::Object> location = v8::Object::New(m_isolate);
757 if (!location->Set(context, v8InternalizedString("scriptId"), toV8String(m_i solate, String16::number(scriptId))).FromMaybe(false)) 757 if (!location->Set(context, v8InternalizedString("scriptId"), toV8String(m_i solate, String16::fromInteger(scriptId))).FromMaybe(false))
758 return v8::Null(m_isolate); 758 return v8::Null(m_isolate);
759 if (!location->Set(context, v8InternalizedString("lineNumber"), v8::Integer: :New(m_isolate, lineNumber)).FromMaybe(false)) 759 if (!location->Set(context, v8InternalizedString("lineNumber"), v8::Integer: :New(m_isolate, lineNumber)).FromMaybe(false))
760 return v8::Null(m_isolate); 760 return v8::Null(m_isolate);
761 if (!location->Set(context, v8InternalizedString("columnNumber"), v8::Intege r::New(m_isolate, columnNumber)).FromMaybe(false)) 761 if (!location->Set(context, v8InternalizedString("columnNumber"), v8::Intege r::New(m_isolate, columnNumber)).FromMaybe(false))
762 return v8::Null(m_isolate); 762 return v8::Null(m_isolate);
763 if (!markAsInternal(context, location, V8InternalValueType::kLocation)) 763 if (!markAsInternal(context, location, V8InternalValueType::kLocation))
764 return v8::Null(m_isolate); 764 return v8::Null(m_isolate);
765 return location; 765 return location;
766 } 766 }
767 767
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
886 return nullptr; 886 return nullptr;
887 887
888 return contextIt->second.get(); 888 return contextIt->second.get();
889 } 889 }
890 890
891 void V8DebuggerImpl::contextCreated(const V8ContextInfo& info) 891 void V8DebuggerImpl::contextCreated(const V8ContextInfo& info)
892 { 892 {
893 DCHECK(info.context->GetIsolate() == m_isolate); 893 DCHECK(info.context->GetIsolate() == m_isolate);
894 // TODO(dgozman): make s_lastContextId non-static. 894 // TODO(dgozman): make s_lastContextId non-static.
895 int contextId = atomicIncrement(&s_lastContextId); 895 int contextId = atomicIncrement(&s_lastContextId);
896 String16 debugData = String16::number(info.contextGroupId) + "," + String16: :number(contextId) + "," + (info.isDefault ? "default" : "nondefault"); 896 String16 debugData = String16::fromInteger(info.contextGroupId) + "," + Stri ng16::fromInteger(contextId) + "," + (info.isDefault ? "default" : "nondefault") ;
897 v8::HandleScope scope(m_isolate); 897 v8::HandleScope scope(m_isolate);
898 v8::Context::Scope contextScope(info.context); 898 v8::Context::Scope contextScope(info.context);
899 info.context->SetEmbedderData(static_cast<int>(v8::Context::kDebugIdIndex), toV8String(m_isolate, debugData)); 899 info.context->SetEmbedderData(static_cast<int>(v8::Context::kDebugIdIndex), toV8String(m_isolate, debugData));
900 900
901 ContextsByGroupMap::iterator contextIt = m_contexts.find(info.contextGroupId ); 901 ContextsByGroupMap::iterator contextIt = m_contexts.find(info.contextGroupId );
902 if (contextIt == m_contexts.end()) 902 if (contextIt == m_contexts.end())
903 contextIt = m_contexts.insert(std::make_pair(info.contextGroupId, wrapUn ique(new ContextByIdMap()))).first; 903 contextIt = m_contexts.insert(std::make_pair(info.contextGroupId, wrapUn ique(new ContextByIdMap()))).first;
904 904
905 const auto& contextById = contextIt->second; 905 const auto& contextById = contextIt->second;
906 906
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
1168 1168
1169 V8InspectorSessionImpl* V8DebuggerImpl::sessionForContextGroup(int contextGroupI d) 1169 V8InspectorSessionImpl* V8DebuggerImpl::sessionForContextGroup(int contextGroupI d)
1170 { 1170 {
1171 if (!contextGroupId) 1171 if (!contextGroupId)
1172 return nullptr; 1172 return nullptr;
1173 SessionMap::iterator iter = m_sessions.find(contextGroupId); 1173 SessionMap::iterator iter = m_sessions.find(contextGroupId);
1174 return iter == m_sessions.end() ? nullptr : iter->second; 1174 return iter == m_sessions.end() ? nullptr : iter->second;
1175 } 1175 }
1176 1176
1177 } // namespace blink 1177 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698