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

Unified Diff: src/inspector/inspected-context.cc

Issue 2806303002: [debug,api] Do not use embedder field for debug context id. (Closed)
Patch Set: restore enum 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/debug/debug-interface.h ('k') | src/runtime/runtime-function.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/inspector/inspected-context.cc
diff --git a/src/inspector/inspected-context.cc b/src/inspector/inspected-context.cc
index 0509683789d6762e9ff865d49f02eaf235238958..8a87a12ecf16c18de973efe5b0779cab0e8a2a6a 100644
--- a/src/inspector/inspected-context.cc
+++ b/src/inspector/inspected-context.cc
@@ -4,6 +4,7 @@
#include "src/inspector/inspected-context.h"
+#include "src/debug/debug-interface.h"
#include "src/inspector/injected-script.h"
#include "src/inspector/string-util.h"
#include "src/inspector/v8-console.h"
@@ -25,8 +26,7 @@ InspectedContext::InspectedContext(V8InspectorImpl* inspector,
m_auxData(toString16(info.auxData)),
m_reported(false) {
v8::Isolate* isolate = m_inspector->isolate();
- info.context->SetEmbedderData(static_cast<int>(v8::Context::kDebugIdIndex),
- v8::Int32::New(isolate, contextId));
+ v8::debug::SetContextId(info.context, contextId);
v8::Local<v8::Object> global = info.context->Global();
v8::Local<v8::Object> console =
m_inspector->console()->createConsole(info.context);
@@ -46,10 +46,7 @@ InspectedContext::~InspectedContext() {
// static
int InspectedContext::contextId(v8::Local<v8::Context> context) {
- v8::Local<v8::Value> data =
- context->GetEmbedderData(static_cast<int>(v8::Context::kDebugIdIndex));
- if (data.IsEmpty() || !data->IsInt32()) return 0;
- return static_cast<int>(data.As<v8::Int32>()->Value());
+ return v8::debug::GetContextId(context);
}
v8::Local<v8::Context> InspectedContext::context() const {
« no previous file with comments | « src/debug/debug-interface.h ('k') | src/runtime/runtime-function.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698