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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/V8DOMConfiguration.cpp

Issue 2739833002: [Bindings] Make both installMethodInternal's check same conditions (Closed)
Patch Set: Created 3 years, 9 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 | no next file » | 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 if (method.holderCheckConfiguration == V8DOMConfiguration::DoNotCheckHolder) 393 if (method.holderCheckConfiguration == V8DOMConfiguration::DoNotCheckHolder)
394 signature = v8::Local<v8::Signature>(); 394 signature = v8::Local<v8::Signature>();
395 395
396 DCHECK(method.propertyLocationConfiguration); 396 DCHECK(method.propertyLocationConfiguration);
397 if (method.propertyLocationConfiguration & 397 if (method.propertyLocationConfiguration &
398 (V8DOMConfiguration::OnInstance | V8DOMConfiguration::OnPrototype)) { 398 (V8DOMConfiguration::OnInstance | V8DOMConfiguration::OnPrototype)) {
399 v8::Local<v8::FunctionTemplate> functionTemplate = 399 v8::Local<v8::FunctionTemplate> functionTemplate =
400 v8::FunctionTemplate::New(isolate, callback, v8::Local<v8::Value>(), 400 v8::FunctionTemplate::New(isolate, callback, v8::Local<v8::Value>(),
401 signature, method.length); 401 signature, method.length);
402 functionTemplate->RemovePrototype(); 402 functionTemplate->RemovePrototype();
403 if (method.accessCheckConfiguration == V8DOMConfiguration::CheckAccess)
404 functionTemplate->SetAcceptAnyReceiver(false);
403 v8::Local<v8::Function> function = 405 v8::Local<v8::Function> function =
404 functionTemplate->GetFunction(isolate->GetCurrentContext()) 406 functionTemplate->GetFunction(isolate->GetCurrentContext())
405 .ToLocalChecked(); 407 .ToLocalChecked();
406 if (method.propertyLocationConfiguration & V8DOMConfiguration::OnInstance) 408 if (method.propertyLocationConfiguration & V8DOMConfiguration::OnInstance)
407 instance 409 instance
408 ->DefineOwnProperty( 410 ->DefineOwnProperty(
409 isolate->GetCurrentContext(), name, function, 411 isolate->GetCurrentContext(), name, function,
410 static_cast<v8::PropertyAttribute>(method.attribute)) 412 static_cast<v8::PropertyAttribute>(method.attribute))
411 .ToChecked(); 413 .ToChecked();
412 if (method.propertyLocationConfiguration & V8DOMConfiguration::OnPrototype) 414 if (method.propertyLocationConfiguration & V8DOMConfiguration::OnPrototype)
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
668 void V8DOMConfiguration::setClassString( 670 void V8DOMConfiguration::setClassString(
669 v8::Isolate* isolate, 671 v8::Isolate* isolate,
670 v8::Local<v8::ObjectTemplate> objectTemplate, 672 v8::Local<v8::ObjectTemplate> objectTemplate,
671 const char* classString) { 673 const char* classString) {
672 objectTemplate->Set( 674 objectTemplate->Set(
673 v8::Symbol::GetToStringTag(isolate), v8AtomicString(isolate, classString), 675 v8::Symbol::GetToStringTag(isolate), v8AtomicString(isolate, classString),
674 static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontEnum)); 676 static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontEnum));
675 } 677 }
676 678
677 } // namespace blink 679 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698