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

Side by Side Diff: Source/bindings/core/v8/inspector/V8InjectedScriptHost.cpp

Issue 1153613007: bindings: Use CreateDataProperty() instead of ForceSet() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix uninitialized error Created 5 years, 6 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 "config.h" 5 #include "config.h"
6 #include "bindings/core/v8/inspector/V8InjectedScriptHost.h" 6 #include "bindings/core/v8/inspector/V8InjectedScriptHost.h"
7 7
8 #include "bindings/core/v8/BindingSecurity.h" 8 #include "bindings/core/v8/BindingSecurity.h"
9 #include "bindings/core/v8/ExceptionState.h" 9 #include "bindings/core/v8/ExceptionState.h"
10 #include "bindings/core/v8/ScriptValue.h" 10 #include "bindings/core/v8/ScriptValue.h"
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 541
542 host->client()->unmuteWarningsAndDeprecations(); 542 host->client()->unmuteWarningsAndDeprecations();
543 } 543 }
544 544
545 void V8InjectedScriptHost::setNonEnumPropertyCallback(const v8::FunctionCallback Info<v8::Value>& info) 545 void V8InjectedScriptHost::setNonEnumPropertyCallback(const v8::FunctionCallback Info<v8::Value>& info)
546 { 546 {
547 if (info.Length() < 3 || !info[0]->IsObject() || !info[1]->IsString()) 547 if (info.Length() < 3 || !info[0]->IsObject() || !info[1]->IsString())
548 return; 548 return;
549 549
550 v8::Local<v8::Object> object = info[0].As<v8::Object>(); 550 v8::Local<v8::Object> object = info[0].As<v8::Object>();
551 // TODO(bashi): Use DefineOwnProperty() if possible.
551 object->ForceSet(info.GetIsolate()->GetCurrentContext(), info[1], info[2], v 8::DontEnum); 552 object->ForceSet(info.GetIsolate()->GetCurrentContext(), info[1], info[2], v 8::DontEnum);
552 } 553 }
553 554
554 void V8InjectedScriptHost::bindCallback(const v8::FunctionCallbackInfo<v8::Value >& info) 555 void V8InjectedScriptHost::bindCallback(const v8::FunctionCallbackInfo<v8::Value >& info)
555 { 556 {
556 if (info.Length() < 2 || !info[1]->IsString()) 557 if (info.Length() < 2 || !info[1]->IsString())
557 return; 558 return;
558 InjectedScriptNative* injectedScriptNative = InjectedScriptNative::fromInjec tedScriptHost(info.Holder()); 559 InjectedScriptNative* injectedScriptNative = InjectedScriptNative::fromInjec tedScriptHost(info.Holder());
559 if (!injectedScriptNative) 560 if (!injectedScriptNative)
560 return; 561 return;
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
640 { 641 {
641 return InjectedScriptHostWrapper::wrap(constructorTemplate, context, host); 642 return InjectedScriptHostWrapper::wrap(constructorTemplate, context, host);
642 } 643 }
643 644
644 InjectedScriptHost* V8InjectedScriptHost::unwrap(v8::Local<v8::Object> object) 645 InjectedScriptHost* V8InjectedScriptHost::unwrap(v8::Local<v8::Object> object)
645 { 646 {
646 return InjectedScriptHostWrapper::unwrap(object); 647 return InjectedScriptHostWrapper::unwrap(object);
647 } 648 }
648 649
649 } // namespace blink 650 } // namespace blink
OLDNEW
« no previous file with comments | « Source/bindings/core/v8/WindowProxy.cpp ('k') | Source/bindings/modules/v8/V8BindingForModules.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698