| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009, 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 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 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 if (!window) | 381 if (!window) |
| 382 return; | 382 return; |
| 383 | 383 |
| 384 Frame* frame = window->frame(); | 384 Frame* frame = window->frame(); |
| 385 // window is detached from a frame. | 385 // window is detached from a frame. |
| 386 if (!frame) | 386 if (!frame) |
| 387 return; | 387 return; |
| 388 | 388 |
| 389 // Search sub-frames. | 389 // Search sub-frames. |
| 390 AtomicString propName = toWebCoreAtomicString(name); | 390 AtomicString propName = toWebCoreAtomicString(name); |
| 391 Frame* child = frame->tree()->scopedChild(propName); | 391 Frame* child = frame->tree().scopedChild(propName); |
| 392 if (child) { | 392 if (child) { |
| 393 v8SetReturnValueFast(info, child->domWindow(), window); | 393 v8SetReturnValueFast(info, child->domWindow(), window); |
| 394 return; | 394 return; |
| 395 } | 395 } |
| 396 | 396 |
| 397 // Search IDL functions defined in the prototype | 397 // Search IDL functions defined in the prototype |
| 398 if (!info.Holder()->GetRealNamedProperty(name).IsEmpty()) | 398 if (!info.Holder()->GetRealNamedProperty(name).IsEmpty()) |
| 399 return; | 399 return; |
| 400 | 400 |
| 401 // Search named items in the document. | 401 // Search named items in the document. |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 return false; | 448 return false; |
| 449 | 449 |
| 450 // Notify the loader's client if the initial document has been accessed. | 450 // Notify the loader's client if the initial document has been accessed. |
| 451 if (target->loader()->stateMachine()->isDisplayingInitialEmptyDocument()) | 451 if (target->loader()->stateMachine()->isDisplayingInitialEmptyDocument()) |
| 452 target->loader()->didAccessInitialDocument(); | 452 target->loader()->didAccessInitialDocument(); |
| 453 | 453 |
| 454 if (key->IsString()) { | 454 if (key->IsString()) { |
| 455 DEFINE_STATIC_LOCAL(AtomicString, nameOfProtoProperty, ("__proto__", Ato
micString::ConstructFromLiteral)); | 455 DEFINE_STATIC_LOCAL(AtomicString, nameOfProtoProperty, ("__proto__", Ato
micString::ConstructFromLiteral)); |
| 456 | 456 |
| 457 String name = toWebCoreString(key.As<v8::String>()); | 457 String name = toWebCoreString(key.As<v8::String>()); |
| 458 Frame* childFrame = target->tree()->scopedChild(name); | 458 Frame* childFrame = target->tree().scopedChild(name); |
| 459 // Notice that we can't call HasRealNamedProperty for ACCESS_HAS | 459 // Notice that we can't call HasRealNamedProperty for ACCESS_HAS |
| 460 // because that would generate infinite recursion. | 460 // because that would generate infinite recursion. |
| 461 if (type == v8::ACCESS_HAS && childFrame) | 461 if (type == v8::ACCESS_HAS && childFrame) |
| 462 return true; | 462 return true; |
| 463 // We need to explicitly compare against nameOfProtoProperty because | 463 // We need to explicitly compare against nameOfProtoProperty because |
| 464 // V8's JSObject::LocalLookup finds __proto__ before | 464 // V8's JSObject::LocalLookup finds __proto__ before |
| 465 // interceptors and even when __proto__ isn't a "real named property". | 465 // interceptors and even when __proto__ isn't a "real named property". |
| 466 v8::Handle<v8::String> keyString = key.As<v8::String>(); | 466 v8::Handle<v8::String> keyString = key.As<v8::String>(); |
| 467 if (type == v8::ACCESS_GET | 467 if (type == v8::ACCESS_GET |
| 468 && childFrame | 468 && childFrame |
| (...skipping 18 matching lines...) Expand all Loading... |
| 487 ASSERT(targetWindow); | 487 ASSERT(targetWindow); |
| 488 | 488 |
| 489 Frame* target = targetWindow->frame(); | 489 Frame* target = targetWindow->frame(); |
| 490 if (!target) | 490 if (!target) |
| 491 return false; | 491 return false; |
| 492 | 492 |
| 493 // Notify the loader's client if the initial document has been accessed. | 493 // Notify the loader's client if the initial document has been accessed. |
| 494 if (target->loader()->stateMachine()->isDisplayingInitialEmptyDocument()) | 494 if (target->loader()->stateMachine()->isDisplayingInitialEmptyDocument()) |
| 495 target->loader()->didAccessInitialDocument(); | 495 target->loader()->didAccessInitialDocument(); |
| 496 | 496 |
| 497 Frame* childFrame = target->tree()->scopedChild(index); | 497 Frame* childFrame = target->tree().scopedChild(index); |
| 498 | 498 |
| 499 // Notice that we can't call HasRealNamedProperty for ACCESS_HAS | 499 // Notice that we can't call HasRealNamedProperty for ACCESS_HAS |
| 500 // because that would generate infinite recursion. | 500 // because that would generate infinite recursion. |
| 501 if (type == v8::ACCESS_HAS && childFrame) | 501 if (type == v8::ACCESS_HAS && childFrame) |
| 502 return true; | 502 return true; |
| 503 if (type == v8::ACCESS_GET | 503 if (type == v8::ACCESS_GET |
| 504 && childFrame | 504 && childFrame |
| 505 && !host->HasRealIndexedProperty(index) | 505 && !host->HasRealIndexedProperty(index) |
| 506 && !window->HasRealIndexedProperty(index)) | 506 && !window->HasRealIndexedProperty(index)) |
| 507 return true; | 507 return true; |
| (...skipping 30 matching lines...) Expand all Loading... |
| 538 v8::Handle<v8::Context> context = frame->script()->currentWorldContext(); | 538 v8::Handle<v8::Context> context = frame->script()->currentWorldContext(); |
| 539 if (context.IsEmpty()) | 539 if (context.IsEmpty()) |
| 540 return v8Undefined(); | 540 return v8Undefined(); |
| 541 | 541 |
| 542 v8::Handle<v8::Object> global = context->Global(); | 542 v8::Handle<v8::Object> global = context->Global(); |
| 543 ASSERT(!global.IsEmpty()); | 543 ASSERT(!global.IsEmpty()); |
| 544 return global; | 544 return global; |
| 545 } | 545 } |
| 546 | 546 |
| 547 } // namespace WebCore | 547 } // namespace WebCore |
| OLD | NEW |