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

Side by Side Diff: third_party/WebKit/Source/core/page/CreateWindow.cpp

Issue 2379313002: Fix 'noopener' targeting and return value. (Closed)
Patch Set: Rebase Created 4 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
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/custom/V8WindowCustom.cpp ('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) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 NavigationPolicy policy, 132 NavigationPolicy policy,
133 bool& created) { 133 bool& created) {
134 ASSERT(!features.dialog || request.frameName().isEmpty()); 134 ASSERT(!features.dialog || request.frameName().isEmpty());
135 ASSERT(request.resourceRequest().requestorOrigin() || 135 ASSERT(request.resourceRequest().requestorOrigin() ||
136 openerFrame.document()->url().isEmpty()); 136 openerFrame.document()->url().isEmpty());
137 ASSERT(request.resourceRequest().frameType() == 137 ASSERT(request.resourceRequest().frameType() ==
138 WebURLRequest::FrameTypeAuxiliary); 138 WebURLRequest::FrameTypeAuxiliary);
139 139
140 created = false; 140 created = false;
141 141
142 Frame* window = reuseExistingWindow(activeFrame, lookupFrame, 142 Frame* window = features.noopener
143 request.frameName(), policy); 143 ? nullptr
144 : reuseExistingWindow(activeFrame, lookupFrame,
145 request.frameName(), policy);
144 146
145 if (!window) { 147 if (!window) {
146 // Sandboxed frames cannot open new auxiliary browsing contexts. 148 // Sandboxed frames cannot open new auxiliary browsing contexts.
147 if (openerFrame.document()->isSandboxed(SandboxPopups)) { 149 if (openerFrame.document()->isSandboxed(SandboxPopups)) {
148 // FIXME: This message should be moved off the console once a solution to 150 // FIXME: This message should be moved off the console once a solution to
149 // https://bugs.webkit.org/show_bug.cgi?id=103274 exists. 151 // https://bugs.webkit.org/show_bug.cgi?id=103274 exists.
150 openerFrame.document()->addConsoleMessage(ConsoleMessage::create( 152 openerFrame.document()->addConsoleMessage(ConsoleMessage::create(
151 SecurityMessageSource, ErrorMessageLevel, 153 SecurityMessageSource, ErrorMessageLevel,
152 "Blocked opening '" + request.resourceRequest().url().elidedString() + 154 "Blocked opening '" + request.resourceRequest().url().elidedString() +
153 "' in a new window because the request was made in a sandboxed " 155 "' in a new window because the request was made in a sandboxed "
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 } 285 }
284 286
285 // TODO(japhet): Form submissions on RemoteFrames don't work yet. 287 // TODO(japhet): Form submissions on RemoteFrames don't work yet.
286 FrameLoadRequest newRequest(0, request.resourceRequest()); 288 FrameLoadRequest newRequest(0, request.resourceRequest());
287 newRequest.setForm(request.form()); 289 newRequest.setForm(request.form());
288 if (newFrame->isLocalFrame()) 290 if (newFrame->isLocalFrame())
289 toLocalFrame(newFrame)->loader().load(newRequest); 291 toLocalFrame(newFrame)->loader().load(newRequest);
290 } 292 }
291 293
292 } // namespace blink 294 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/custom/V8WindowCustom.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698