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

Side by Side Diff: third_party/WebKit/JavaScriptCore/API/JSObjectRef.cpp

Issue 20076: WebKit merge 40500:40539 [WebKit side] (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | third_party/WebKit/JavaScriptCore/ChangeLog » ('j') | 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) 2006, 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Kelvin W Sherlock (ksherlock@gmail.com) 3 * Copyright (C) 2008 Kelvin W Sherlock (ksherlock@gmail.com)
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
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 449 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 exec->globalData().heap.registerThread(); 460 exec->globalData().heap.registerThread();
461 JSLock lock(exec); 461 JSLock lock(exec);
462 462
463 JSGlobalData* globalData = &exec->globalData(); 463 JSGlobalData* globalData = &exec->globalData();
464 464
465 JSPropertyNameArrayRef propertyNames = new OpaqueJSPropertyNameArray(globalD ata); 465 JSPropertyNameArrayRef propertyNames = new OpaqueJSPropertyNameArray(globalD ata);
466 PropertyNameArray array(globalData); 466 PropertyNameArray array(globalData);
467 jsObject->getPropertyNames(exec, array); 467 jsObject->getPropertyNames(exec, array);
468 468
469 size_t size = array.size(); 469 size_t size = array.size();
470 propertyNames->array.reserveCapacity(size); 470 propertyNames->array.reserveInitialCapacity(size);
471 for (size_t i = 0; i < size; ++i) 471 for (size_t i = 0; i < size; ++i)
472 propertyNames->array.append(JSRetainPtr<JSStringRef>(Adopt, OpaqueJSStri ng::create(array[i].ustring()).releaseRef())); 472 propertyNames->array.append(JSRetainPtr<JSStringRef>(Adopt, OpaqueJSStri ng::create(array[i].ustring()).releaseRef()));
473 473
474 return JSPropertyNameArrayRetain(propertyNames); 474 return JSPropertyNameArrayRetain(propertyNames);
475 } 475 }
476 476
477 JSPropertyNameArrayRef JSPropertyNameArrayRetain(JSPropertyNameArrayRef array) 477 JSPropertyNameArrayRef JSPropertyNameArrayRetain(JSPropertyNameArrayRef array)
478 { 478 {
479 ++array->refCount; 479 ++array->refCount;
480 return array; 480 return array;
(...skipping 19 matching lines...) Expand all
500 500
501 void JSPropertyNameAccumulatorAddName(JSPropertyNameAccumulatorRef array, JSStri ngRef propertyName) 501 void JSPropertyNameAccumulatorAddName(JSPropertyNameAccumulatorRef array, JSStri ngRef propertyName)
502 { 502 {
503 PropertyNameArray* propertyNames = toJS(array); 503 PropertyNameArray* propertyNames = toJS(array);
504 504
505 propertyNames->globalData()->heap.registerThread(); 505 propertyNames->globalData()->heap.registerThread();
506 JSLock lock(propertyNames->globalData()->isSharedInstance); 506 JSLock lock(propertyNames->globalData()->isSharedInstance);
507 507
508 propertyNames->add(propertyName->identifier(propertyNames->globalData())); 508 propertyNames->add(propertyName->identifier(propertyNames->globalData()));
509 } 509 }
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/JavaScriptCore/ChangeLog » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698