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

Side by Side Diff: third_party/WebKit/Source/web/WebLocalFrameImpl.cpp

Issue 2706923002: Rework security checks to be based on Window rather than Frame. (Closed)
Patch Set: Fix test typo 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 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 816 matching lines...) Expand 10 before | Expand all | Expand 10 after
827 } 827 }
828 828
829 v8::Local<v8::Context> WebLocalFrameImpl::mainWorldScriptContext() const { 829 v8::Local<v8::Context> WebLocalFrameImpl::mainWorldScriptContext() const {
830 ScriptState* scriptState = ScriptState::forMainWorld(frame()); 830 ScriptState* scriptState = ScriptState::forMainWorld(frame());
831 DCHECK(scriptState); 831 DCHECK(scriptState);
832 return scriptState->context(); 832 return scriptState->context();
833 } 833 }
834 834
835 bool WebFrame::scriptCanAccess(WebFrame* target) { 835 bool WebFrame::scriptCanAccess(WebFrame* target) {
836 return BindingSecurity::shouldAllowAccessToFrame( 836 return BindingSecurity::shouldAllowAccessToFrame(
837 currentDOMWindow(mainThreadIsolate()), target->toImplBase()->frame(), 837 currentDOMWindow(mainThreadIsolate()), *target->toImplBase()->frame(),
838 BindingSecurity::ErrorReportOption::DoNotReport); 838 BindingSecurity::ErrorReportOption::DoNotReport);
839 } 839 }
840 840
841 void WebLocalFrameImpl::reload(WebFrameLoadType loadType) { 841 void WebLocalFrameImpl::reload(WebFrameLoadType loadType) {
842 // TODO(clamy): Remove this function once RenderFrame calls load for all 842 // TODO(clamy): Remove this function once RenderFrame calls load for all
843 // requests. 843 // requests.
844 reloadWithOverrideURL(KURL(), loadType); 844 reloadWithOverrideURL(KURL(), loadType);
845 } 845 }
846 846
847 void WebLocalFrameImpl::reloadWithOverrideURL(const WebURL& overrideUrl, 847 void WebLocalFrameImpl::reloadWithOverrideURL(const WebURL& overrideUrl,
(...skipping 1606 matching lines...) Expand 10 before | Expand all | Expand 10 after
2454 createMarkup(startPosition, endPosition, AnnotateForInterchange, 2454 createMarkup(startPosition, endPosition, AnnotateForInterchange,
2455 ConvertBlocksToInlines::NotConvert, ResolveNonLocalURLs); 2455 ConvertBlocksToInlines::NotConvert, ResolveNonLocalURLs);
2456 } else { 2456 } else {
2457 clipHtml = 2457 clipHtml =
2458 createMarkup(endPosition, startPosition, AnnotateForInterchange, 2458 createMarkup(endPosition, startPosition, AnnotateForInterchange,
2459 ConvertBlocksToInlines::NotConvert, ResolveNonLocalURLs); 2459 ConvertBlocksToInlines::NotConvert, ResolveNonLocalURLs);
2460 } 2460 }
2461 } 2461 }
2462 2462
2463 } // namespace blink 2463 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698