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

Side by Side Diff: Source/bindings/core/v8/custom/V8InjectedScriptHostCustom.cpp

Issue 1153613007: bindings: Use CreateDataProperty() instead of ForceSet() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: DefineOwnProperty() doesn't work in V8InjectedScriptHost::setNonEnumPropertyMethodCustom 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 /* 1 /*
2 * Copyright (C) 2007-2011 Google Inc. All rights reserved. 2 * Copyright (C) 2007-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 547 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 558
559 host->client()->unmuteWarningsAndDeprecations(); 559 host->client()->unmuteWarningsAndDeprecations();
560 } 560 }
561 561
562 void V8InjectedScriptHost::setNonEnumPropertyMethodCustom(const v8::FunctionCall backInfo<v8::Value>& info) 562 void V8InjectedScriptHost::setNonEnumPropertyMethodCustom(const v8::FunctionCall backInfo<v8::Value>& info)
563 { 563 {
564 if (info.Length() < 3 || !info[0]->IsObject() || !info[1]->IsString()) 564 if (info.Length() < 3 || !info[0]->IsObject() || !info[1]->IsString())
565 return; 565 return;
566 566
567 v8::Local<v8::Object> object = info[0].As<v8::Object>(); 567 v8::Local<v8::Object> object = info[0].As<v8::Object>();
568 // TODO(bashi): Use DefineOwnProperty() if possible.
jochen (gone - plz use gerrit) 2015/06/03 10:55:17 what exception does this throw?
bashi 2015/06/05 01:10:27 Nevermind; this custom bindings has gone. https://
568 object->ForceSet(info.GetIsolate()->GetCurrentContext(), info[1], info[2], v 8::DontEnum); 569 object->ForceSet(info.GetIsolate()->GetCurrentContext(), info[1], info[2], v 8::DontEnum);
569 } 570 }
570 571
571 void V8InjectedScriptHost::bindMethodCustom(const v8::FunctionCallbackInfo<v8::V alue>& info) 572 void V8InjectedScriptHost::bindMethodCustom(const v8::FunctionCallbackInfo<v8::V alue>& info)
572 { 573 {
573 if (info.Length() < 2 || !info[1]->IsString()) 574 if (info.Length() < 2 || !info[1]->IsString())
574 return; 575 return;
575 InjectedScriptNative* injectedScriptNative = InjectedScriptNative::fromInjec tedScriptHost(info.Holder()); 576 InjectedScriptNative* injectedScriptNative = InjectedScriptNative::fromInjec tedScriptHost(info.Holder());
576 if (!injectedScriptNative) 577 if (!injectedScriptNative)
577 return; 578 return;
(...skipping 24 matching lines...) Expand all
602 InjectedScriptNative* injectedScriptNative = InjectedScriptNative::fromInjec tedScriptHost(info.Holder()); 603 InjectedScriptNative* injectedScriptNative = InjectedScriptNative::fromInjec tedScriptHost(info.Holder());
603 if (!injectedScriptNative) 604 if (!injectedScriptNative)
604 return; 605 return;
605 int id = info[0].As<v8::Int32>()->Value(); 606 int id = info[0].As<v8::Int32>()->Value();
606 String groupName = injectedScriptNative->groupName(id); 607 String groupName = injectedScriptNative->groupName(id);
607 if (!groupName.isEmpty()) 608 if (!groupName.isEmpty())
608 info.GetReturnValue().Set(v8String(info.GetIsolate(), groupName)); 609 info.GetReturnValue().Set(v8String(info.GetIsolate(), groupName));
609 } 610 }
610 611
611 } // namespace blink 612 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698