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

Side by Side Diff: Source/bindings/core/v8/BindingSecurity.cpp

Issue 1085973003: Make error messages for cross-domain access OOPIF-friendly. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 8 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 | « no previous file | Source/core/frame/DOMWindow.h » ('j') | Source/core/frame/DOMWindow.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 83
84 bool BindingSecurity::shouldAllowAccessToFrame(v8::Isolate* isolate, Frame* targ et, SecurityReportingOption reportingOption) 84 bool BindingSecurity::shouldAllowAccessToFrame(v8::Isolate* isolate, Frame* targ et, SecurityReportingOption reportingOption)
85 { 85 {
86 if (!target || !target->isLocalFrame()) 86 if (!target || !target->isLocalFrame())
87 return false; 87 return false;
88 return canAccessDocument(isolate, toLocalFrame(target)->document(), reportin gOption); 88 return canAccessDocument(isolate, toLocalFrame(target)->document(), reportin gOption);
89 } 89 }
90 90
91 bool BindingSecurity::shouldAllowAccessToFrame(v8::Isolate* isolate, Frame* targ et, ExceptionState& exceptionState) 91 bool BindingSecurity::shouldAllowAccessToFrame(v8::Isolate* isolate, Frame* targ et, ExceptionState& exceptionState)
92 { 92 {
93 if (!target || !target->isLocalFrame()) 93 if (!target)
94 return false; 94 return false;
95
96 if (target->isRemoteFrame() && target->domWindow()) {
haraken 2015/04/16 03:41:19 Shouldn't this be something like: if (target->isR
alexmos 2015/04/17 16:49:06 Yes. I've already removed this code though, as th
97 LocalDOMWindow* callingWindow = callingDOMWindow(isolate);
98 exceptionState.throwSecurityError(target->domWindow()->sanitizedCrossDom ainAccessErrorMessage(callingWindow), target->domWindow()->crossDomainAccessErro rMessage(callingWindow));
99 return false;
100 }
101
95 return canAccessDocument(isolate, toLocalFrame(target)->document(), exceptio nState); 102 return canAccessDocument(isolate, toLocalFrame(target)->document(), exceptio nState);
96 } 103 }
97 104
98 bool BindingSecurity::shouldAllowAccessToNode(v8::Isolate* isolate, Node* target , ExceptionState& exceptionState) 105 bool BindingSecurity::shouldAllowAccessToNode(v8::Isolate* isolate, Node* target , ExceptionState& exceptionState)
99 { 106 {
100 return target && canAccessDocument(isolate, &target->document(), exceptionSt ate); 107 return target && canAccessDocument(isolate, &target->document(), exceptionSt ate);
101 } 108 }
102 109
103 } 110 }
OLDNEW
« no previous file with comments | « no previous file | Source/core/frame/DOMWindow.h » ('j') | Source/core/frame/DOMWindow.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698