| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008, 2009, 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2008, 2009, 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 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 } | 448 } |
| 449 return toV8(PassRefPtrWillBeRawPtr<HTMLCollection>(items.release()), creatio
nContext, isolate); | 449 return toV8(PassRefPtrWillBeRawPtr<HTMLCollection>(items.release()), creatio
nContext, isolate); |
| 450 } | 450 } |
| 451 | 451 |
| 452 static void getter(v8::Local<v8::Name> property, const v8::PropertyCallbackInfo<
v8::Value>& info) | 452 static void getter(v8::Local<v8::Name> property, const v8::PropertyCallbackInfo<
v8::Value>& info) |
| 453 { | 453 { |
| 454 // FIXME: Consider passing StringImpl directly. | 454 // FIXME: Consider passing StringImpl directly. |
| 455 AtomicString name = toCoreAtomicString(property.As<v8::String>()); | 455 AtomicString name = toCoreAtomicString(property.As<v8::String>()); |
| 456 HTMLDocument* htmlDocument = V8HTMLDocument::toImpl(info.Holder()); | 456 HTMLDocument* htmlDocument = V8HTMLDocument::toImpl(info.Holder()); |
| 457 ASSERT(htmlDocument); | 457 ASSERT(htmlDocument); |
| 458 v8::Handle<v8::Value> result = getNamedProperty(htmlDocument, name, info.Hol
der(), info.GetIsolate()); | 458 v8::Local<v8::Value> result = getNamedProperty(htmlDocument, name, info.Hold
er(), info.GetIsolate()); |
| 459 if (!result.IsEmpty()) { | 459 if (!result.IsEmpty()) { |
| 460 v8SetReturnValue(info, result); | 460 v8SetReturnValue(info, result); |
| 461 return; | 461 return; |
| 462 } | 462 } |
| 463 v8::Handle<v8::Value> prototype = info.Holder()->GetPrototype(); | 463 v8::Local<v8::Value> prototype = info.Holder()->GetPrototype(); |
| 464 if (prototype->IsObject()) { | 464 if (prototype->IsObject()) { |
| 465 v8SetReturnValue(info, prototype.As<v8::Object>()->Get(property)); | 465 v8::Local<v8::Value> value; |
| 466 return; | 466 if (prototype.As<v8::Object>()->Get(info.GetIsolate()->GetCurrentContext
(), property).ToLocal(&value)) |
| 467 v8SetReturnValue(info, value); |
| 467 } | 468 } |
| 468 } | 469 } |
| 469 | 470 |
| 470 void WindowProxy::namedItemAdded(HTMLDocument* document, const AtomicString& nam
e) | 471 void WindowProxy::namedItemAdded(HTMLDocument* document, const AtomicString& nam
e) |
| 471 { | 472 { |
| 472 ASSERT(m_world->isMainWorld()); | 473 ASSERT(m_world->isMainWorld()); |
| 473 | 474 |
| 474 if (!isContextInitialized() || !m_scriptState->contextIsValid()) | 475 if (!isContextInitialized() || !m_scriptState->contextIsValid()) |
| 475 return; | 476 return; |
| 476 | 477 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 501 | 502 |
| 502 void WindowProxy::updateSecurityOrigin(SecurityOrigin* origin) | 503 void WindowProxy::updateSecurityOrigin(SecurityOrigin* origin) |
| 503 { | 504 { |
| 504 ASSERT(m_world->isMainWorld()); | 505 ASSERT(m_world->isMainWorld()); |
| 505 if (!isContextInitialized()) | 506 if (!isContextInitialized()) |
| 506 return; | 507 return; |
| 507 setSecurityToken(origin); | 508 setSecurityToken(origin); |
| 508 } | 509 } |
| 509 | 510 |
| 510 } // namespace blink | 511 } // namespace blink |
| OLD | NEW |