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

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

Issue 1950303004: [DevTools] Add additional accessor check in InjectedScriptSource.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "platform/v8_inspector/V8InjectedScriptHost.h" 5 #include "platform/v8_inspector/V8InjectedScriptHost.h"
6 6
7 #include "platform/inspector_protocol/String16.h" 7 #include "platform/inspector_protocol/String16.h"
8 #include "platform/v8_inspector/InjectedScriptNative.h" 8 #include "platform/v8_inspector/InjectedScriptNative.h"
9 #include "platform/v8_inspector/V8Compat.h" 9 #include "platform/v8_inspector/V8Compat.h"
10 #include "platform/v8_inspector/V8DebuggerImpl.h" 10 #include "platform/v8_inspector/V8DebuggerImpl.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 { 62 {
63 if (info.Length() < 1 || !info[0]->IsObject()) 63 if (info.Length() < 1 || !info[0]->IsObject())
64 return; 64 return;
65 65
66 v8::Local<v8::Object> object = info[0].As<v8::Object>(); 66 v8::Local<v8::Object> object = info[0].As<v8::Object>();
67 info.GetReturnValue().Set(object->GetConstructorName()); 67 info.GetReturnValue().Set(object->GetConstructorName());
68 } 68 }
69 69
70 void V8InjectedScriptHost::formatAccessorsAsProperties(const v8::FunctionCallbac kInfo<v8::Value>& info) 70 void V8InjectedScriptHost::formatAccessorsAsProperties(const v8::FunctionCallbac kInfo<v8::Value>& info)
71 { 71 {
72 if (info.Length() < 1) 72 ASSERT(info.Length() == 2);
73 info.GetReturnValue().Set(false);
74 if (!info[1]->IsFunction())
dgozman 2016/05/23 15:53:03 How this could be possible? Why do we return |fals
kozy 2016/05/23 17:05:12 It could be undefined and we don't want to format
73 return; 75 return;
74 76 if (info[1].As<v8::Function>()->ScriptId() != v8::UnboundScript::kNoScriptId )
dgozman 2016/05/23 15:53:03 Let's comment that this means user-defined code.
kozy 2016/05/23 17:05:12 Done.
77 return;
75 info.GetReturnValue().Set(unwrapDebugger(info)->client()->formatAccessorsAsP roperties(info[0])); 78 info.GetReturnValue().Set(unwrapDebugger(info)->client()->formatAccessorsAsP roperties(info[0]));
76 } 79 }
77 80
78 void V8InjectedScriptHost::subtypeCallback(const v8::FunctionCallbackInfo<v8::Va lue>& info) 81 void V8InjectedScriptHost::subtypeCallback(const v8::FunctionCallbackInfo<v8::Va lue>& info)
79 { 82 {
80 if (info.Length() < 1) 83 if (info.Length() < 1)
81 return; 84 return;
82 85
83 v8::Isolate* isolate = info.GetIsolate(); 86 v8::Isolate* isolate = info.GetIsolate();
84 v8::Local<v8::Value> value = info[0]; 87 v8::Local<v8::Value> value = info[0];
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 { 335 {
333 return v8::Private::ForApi(isolate, toV8StringInternalized(isolate, "V8Debug ger#scopeExtension")); 336 return v8::Private::ForApi(isolate, toV8StringInternalized(isolate, "V8Debug ger#scopeExtension"));
334 } 337 }
335 338
336 bool V8Debugger::isRemoteObjectAPIMethod(const String16& name) 339 bool V8Debugger::isRemoteObjectAPIMethod(const String16& name)
337 { 340 {
338 return name == "bindRemoteObject"; 341 return name == "bindRemoteObject";
339 } 342 }
340 343
341 } // namespace blink 344 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698