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

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

Issue 2753773003: v8bindings: Reverts crrev.com/2606723002 with minimum changes. (Closed)
Patch Set: Updated tests and their expectations. 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 | « third_party/WebKit/LayoutTests/http/tests/security/xss-DENIED-window-name-alert-expected.txt ('k') | 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) 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 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 if (child) { 347 if (child) {
348 // step 3. Remove each browsing context from childBrowsingContexts whose 348 // step 3. Remove each browsing context from childBrowsingContexts whose
349 // active document's origin is not same origin with activeDocument's origin 349 // active document's origin is not same origin with activeDocument's origin
350 // and whose browsing context name does not match the name of its browsing 350 // and whose browsing context name does not match the name of its browsing
351 // context container's name content attribute value. 351 // context container's name content attribute value.
352 if (BindingSecurity::shouldAllowNamedAccessTo(window, child->domWindow()) || 352 if (BindingSecurity::shouldAllowNamedAccessTo(window, child->domWindow()) ||
353 name == child->owner()->browsingContextContainerName()) { 353 name == child->owner()->browsingContextContainerName()) {
354 v8SetReturnValueFast(info, child->domWindow(), window); 354 v8SetReturnValueFast(info, child->domWindow(), window);
355 return; 355 return;
356 } 356 }
357
358 // In addition to the above spec'ed case, we return the child window
359 // regardless of step 3 due to crbug.com/701489 for the time being.
360 // TODO(yukishiino): Makes iframe.name update the browsing context name
361 // appropriately and makes the new name available in the named access on
362 // window. Then, removes the following two lines.
363 v8SetReturnValueFast(info, child->domWindow(), window);
364 return;
357 } 365 }
358 366
359 // This is a cross-origin interceptor. Check that the caller has access to the 367 // This is a cross-origin interceptor. Check that the caller has access to the
360 // named results. 368 // named results.
361 if (!BindingSecurity::shouldAllowAccessTo( 369 if (!BindingSecurity::shouldAllowAccessTo(
362 currentDOMWindow(info.GetIsolate()), window, 370 currentDOMWindow(info.GetIsolate()), window,
363 BindingSecurity::ErrorReportOption::DoNotReport)) { 371 BindingSecurity::ErrorReportOption::DoNotReport)) {
364 BindingSecurity::failedAccessCheckFor(info.GetIsolate(), frame); 372 BindingSecurity::failedAccessCheckFor(info.GetIsolate(), frame);
365 return; 373 return;
366 } 374 }
(...skipping 26 matching lines...) Expand all
393 if (items->hasExactlyOneItem()) { 401 if (items->hasExactlyOneItem()) {
394 v8SetReturnValueFast(info, items->item(0), window); 402 v8SetReturnValueFast(info, items->item(0), window);
395 return; 403 return;
396 } 404 }
397 v8SetReturnValueFast(info, items, window); 405 v8SetReturnValueFast(info, items, window);
398 return; 406 return;
399 } 407 }
400 } 408 }
401 409
402 } // namespace blink 410 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/security/xss-DENIED-window-name-alert-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698