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

Side by Side Diff: Source/bindings/v8/custom/V8WindowCustom.cpp

Issue 31063004: Have Frame::loader() return a reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 2 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 | « Source/bindings/v8/V8WindowShell.cpp ('k') | Source/core/dom/CSSSelectorWatch.cpp » ('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) 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 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 return; 210 return;
211 } 211 }
212 212
213 // Opener can be shadowed if it is in the same domain. 213 // Opener can be shadowed if it is in the same domain.
214 // Have a special handling of null value to behave 214 // Have a special handling of null value to behave
215 // like Firefox. See bug http://b/1224887 & http://b/791706. 215 // like Firefox. See bug http://b/1224887 & http://b/791706.
216 if (value->IsNull()) { 216 if (value->IsNull()) {
217 // imp->frame() cannot be null, 217 // imp->frame() cannot be null,
218 // otherwise, SameOrigin check would have failed. 218 // otherwise, SameOrigin check would have failed.
219 ASSERT(imp->frame()); 219 ASSERT(imp->frame());
220 imp->frame()->loader()->setOpener(0); 220 imp->frame()->loader().setOpener(0);
221 } 221 }
222 222
223 // Delete the accessor from this object. 223 // Delete the accessor from this object.
224 info.Holder()->Delete(name); 224 info.Holder()->Delete(name);
225 225
226 // Put property on the front (this) object. 226 // Put property on the front (this) object.
227 info.This()->Set(name, value); 227 info.This()->Set(name, value);
228 } 228 }
229 229
230 static bool isLegacyTargetOriginDesignation(v8::Handle<v8::Value> value) 230 static bool isLegacyTargetOriginDesignation(v8::Handle<v8::Value> value)
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 446
447 DOMWindow* targetWindow = V8Window::toNative(window); 447 DOMWindow* targetWindow = V8Window::toNative(window);
448 448
449 ASSERT(targetWindow); 449 ASSERT(targetWindow);
450 450
451 Frame* target = targetWindow->frame(); 451 Frame* target = targetWindow->frame();
452 if (!target) 452 if (!target)
453 return false; 453 return false;
454 454
455 // Notify the loader's client if the initial document has been accessed. 455 // Notify the loader's client if the initial document has been accessed.
456 if (target->loader()->stateMachine()->isDisplayingInitialEmptyDocument()) 456 if (target->loader().stateMachine()->isDisplayingInitialEmptyDocument())
457 target->loader()->didAccessInitialDocument(); 457 target->loader().didAccessInitialDocument();
458 458
459 if (key->IsString()) { 459 if (key->IsString()) {
460 DEFINE_STATIC_LOCAL(AtomicString, nameOfProtoProperty, ("__proto__", Ato micString::ConstructFromLiteral)); 460 DEFINE_STATIC_LOCAL(AtomicString, nameOfProtoProperty, ("__proto__", Ato micString::ConstructFromLiteral));
461 461
462 String name = toWebCoreString(key.As<v8::String>()); 462 String name = toWebCoreString(key.As<v8::String>());
463 Frame* childFrame = target->tree().scopedChild(name); 463 Frame* childFrame = target->tree().scopedChild(name);
464 // Notice that we can't call HasRealNamedProperty for ACCESS_HAS 464 // Notice that we can't call HasRealNamedProperty for ACCESS_HAS
465 // because that would generate infinite recursion. 465 // because that would generate infinite recursion.
466 if (type == v8::ACCESS_HAS && childFrame) 466 if (type == v8::ACCESS_HAS && childFrame)
467 return true; 467 return true;
(...skipping 21 matching lines...) Expand all
489 489
490 DOMWindow* targetWindow = V8Window::toNative(window); 490 DOMWindow* targetWindow = V8Window::toNative(window);
491 491
492 ASSERT(targetWindow); 492 ASSERT(targetWindow);
493 493
494 Frame* target = targetWindow->frame(); 494 Frame* target = targetWindow->frame();
495 if (!target) 495 if (!target)
496 return false; 496 return false;
497 497
498 // Notify the loader's client if the initial document has been accessed. 498 // Notify the loader's client if the initial document has been accessed.
499 if (target->loader()->stateMachine()->isDisplayingInitialEmptyDocument()) 499 if (target->loader().stateMachine()->isDisplayingInitialEmptyDocument())
500 target->loader()->didAccessInitialDocument(); 500 target->loader().didAccessInitialDocument();
501 501
502 Frame* childFrame = target->tree().scopedChild(index); 502 Frame* childFrame = target->tree().scopedChild(index);
503 503
504 // Notice that we can't call HasRealNamedProperty for ACCESS_HAS 504 // Notice that we can't call HasRealNamedProperty for ACCESS_HAS
505 // because that would generate infinite recursion. 505 // because that would generate infinite recursion.
506 if (type == v8::ACCESS_HAS && childFrame) 506 if (type == v8::ACCESS_HAS && childFrame)
507 return true; 507 return true;
508 if (type == v8::ACCESS_GET 508 if (type == v8::ACCESS_GET
509 && childFrame 509 && childFrame
510 && !host->HasRealIndexedProperty(index) 510 && !host->HasRealIndexedProperty(index)
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
543 v8::Handle<v8::Context> context = frame->script().currentWorldContext(); 543 v8::Handle<v8::Context> context = frame->script().currentWorldContext();
544 if (context.IsEmpty()) 544 if (context.IsEmpty())
545 return v8Undefined(); 545 return v8Undefined();
546 546
547 v8::Handle<v8::Object> global = context->Global(); 547 v8::Handle<v8::Object> global = context->Global();
548 ASSERT(!global.IsEmpty()); 548 ASSERT(!global.IsEmpty());
549 return global; 549 return global;
550 } 550 }
551 551
552 } // namespace WebCore 552 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/v8/V8WindowShell.cpp ('k') | Source/core/dom/CSSSelectorWatch.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698