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

Side by Side Diff: src/inspector/injected-script.cc

Issue 2841053002: [inspector] Add some context scopes to inspector code (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « no previous file | src/inspector/v8-function-call.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 m_native->unbind(boundId); 168 m_native->unbind(boundId);
169 } 169 }
170 170
171 Response InjectedScript::wrapObject( 171 Response InjectedScript::wrapObject(
172 v8::Local<v8::Value> value, const String16& groupName, bool forceValueType, 172 v8::Local<v8::Value> value, const String16& groupName, bool forceValueType,
173 bool generatePreview, 173 bool generatePreview,
174 std::unique_ptr<protocol::Runtime::RemoteObject>* result) const { 174 std::unique_ptr<protocol::Runtime::RemoteObject>* result) const {
175 v8::HandleScope handles(m_context->isolate()); 175 v8::HandleScope handles(m_context->isolate());
176 v8::Local<v8::Value> wrappedObject; 176 v8::Local<v8::Value> wrappedObject;
177 v8::Local<v8::Context> context = m_context->context(); 177 v8::Local<v8::Context> context = m_context->context();
178 v8::Context::Scope contextScope(context);
dgozman 2017/04/26 15:52:49 I don't think this is needed. It calls into wrapVa
Jens Widell 2017/04/26 15:57:13 Indeed. I now wonder how come I ended up adding th
178 Response response = wrapValue(value, groupName, forceValueType, 179 Response response = wrapValue(value, groupName, forceValueType,
179 generatePreview, &wrappedObject); 180 generatePreview, &wrappedObject);
180 if (!response.isSuccess()) return response; 181 if (!response.isSuccess()) return response;
181 protocol::ErrorSupport errors; 182 protocol::ErrorSupport errors;
182 std::unique_ptr<protocol::Value> protocolValue; 183 std::unique_ptr<protocol::Value> protocolValue;
183 response = toProtocolValue(context, wrappedObject, &protocolValue); 184 response = toProtocolValue(context, wrappedObject, &protocolValue);
184 if (!response.isSuccess()) return response; 185 if (!response.isSuccess()) return response;
185 186
186 *result = 187 *result =
187 protocol::Runtime::RemoteObject::fromValue(protocolValue.get(), &errors); 188 protocol::Runtime::RemoteObject::fromValue(protocolValue.get(), &errors);
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 Response InjectedScript::CallFrameScope::findInjectedScript( 537 Response InjectedScript::CallFrameScope::findInjectedScript(
537 V8InspectorSessionImpl* session) { 538 V8InspectorSessionImpl* session) {
538 std::unique_ptr<RemoteCallFrameId> remoteId; 539 std::unique_ptr<RemoteCallFrameId> remoteId;
539 Response response = RemoteCallFrameId::parse(m_remoteCallFrameId, &remoteId); 540 Response response = RemoteCallFrameId::parse(m_remoteCallFrameId, &remoteId);
540 if (!response.isSuccess()) return response; 541 if (!response.isSuccess()) return response;
541 m_frameOrdinal = static_cast<size_t>(remoteId->frameOrdinal()); 542 m_frameOrdinal = static_cast<size_t>(remoteId->frameOrdinal());
542 return session->findInjectedScript(remoteId.get(), m_injectedScript); 543 return session->findInjectedScript(remoteId.get(), m_injectedScript);
543 } 544 }
544 545
545 } // namespace v8_inspector 546 } // namespace v8_inspector
OLDNEW
« no previous file with comments | « no previous file | src/inspector/v8-function-call.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698