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

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

Issue 1235463006: Export BindingSecurity checks via WebFrame (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 5 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/core/v8/BindingSecurity.h ('k') | public/web/WebFrame.h » ('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 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 // LocalFrame, and also notifies the embedder via WebFrameClient that the frame is 78 // LocalFrame, and also notifies the embedder via WebFrameClient that the frame is
79 // detached. Most embedders will invoke close() on the WebFrame at this point, 79 // detached. Most embedders will invoke close() on the WebFrame at this point,
80 // triggering its deletion unless something else is still retaining a reference. 80 // triggering its deletion unless something else is still retaining a reference.
81 // 81 //
82 // The client is expected to be set whenever the WebLocalFrameImpl is attached t o 82 // The client is expected to be set whenever the WebLocalFrameImpl is attached t o
83 // the DOM. 83 // the DOM.
84 84
85 #include "config.h" 85 #include "config.h"
86 #include "web/WebLocalFrameImpl.h" 86 #include "web/WebLocalFrameImpl.h"
87 87
88 #include "bindings/core/v8/BindingSecurity.h"
88 #include "bindings/core/v8/DOMWrapperWorld.h" 89 #include "bindings/core/v8/DOMWrapperWorld.h"
89 #include "bindings/core/v8/ExceptionState.h" 90 #include "bindings/core/v8/ExceptionState.h"
90 #include "bindings/core/v8/ExceptionStatePlaceholder.h" 91 #include "bindings/core/v8/ExceptionStatePlaceholder.h"
91 #include "bindings/core/v8/ScriptController.h" 92 #include "bindings/core/v8/ScriptController.h"
92 #include "bindings/core/v8/ScriptSourceCode.h" 93 #include "bindings/core/v8/ScriptSourceCode.h"
93 #include "bindings/core/v8/ScriptValue.h" 94 #include "bindings/core/v8/ScriptValue.h"
94 #include "bindings/core/v8/V8Binding.h" 95 #include "bindings/core/v8/V8Binding.h"
95 #include "bindings/core/v8/V8GCController.h" 96 #include "bindings/core/v8/V8GCController.h"
96 #include "bindings/core/v8/V8PerIsolateData.h" 97 #include "bindings/core/v8/V8PerIsolateData.h"
97 #include "core/HTMLNames.h" 98 #include "core/HTMLNames.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 #include "public/web/WebAutofillClient.h" 193 #include "public/web/WebAutofillClient.h"
193 #include "public/web/WebConsoleMessage.h" 194 #include "public/web/WebConsoleMessage.h"
194 #include "public/web/WebDOMEvent.h" 195 #include "public/web/WebDOMEvent.h"
195 #include "public/web/WebDocument.h" 196 #include "public/web/WebDocument.h"
196 #include "public/web/WebFindOptions.h" 197 #include "public/web/WebFindOptions.h"
197 #include "public/web/WebFormElement.h" 198 #include "public/web/WebFormElement.h"
198 #include "public/web/WebFrameClient.h" 199 #include "public/web/WebFrameClient.h"
199 #include "public/web/WebHistoryItem.h" 200 #include "public/web/WebHistoryItem.h"
200 #include "public/web/WebIconURL.h" 201 #include "public/web/WebIconURL.h"
201 #include "public/web/WebInputElement.h" 202 #include "public/web/WebInputElement.h"
203 #include "public/web/WebKit.h"
202 #include "public/web/WebNode.h" 204 #include "public/web/WebNode.h"
203 #include "public/web/WebPerformance.h" 205 #include "public/web/WebPerformance.h"
204 #include "public/web/WebPlugin.h" 206 #include "public/web/WebPlugin.h"
205 #include "public/web/WebPrintParams.h" 207 #include "public/web/WebPrintParams.h"
206 #include "public/web/WebPrintPresetOptions.h" 208 #include "public/web/WebPrintPresetOptions.h"
207 #include "public/web/WebRange.h" 209 #include "public/web/WebRange.h"
208 #include "public/web/WebScriptSource.h" 210 #include "public/web/WebScriptSource.h"
209 #include "public/web/WebSerializedScriptValue.h" 211 #include "public/web/WebSerializedScriptValue.h"
210 #include "public/web/WebTestInterfaceFactory.h" 212 #include "public/web/WebTestInterfaceFactory.h"
211 #include "public/web/WebTreeScopeType.h" 213 #include "public/web/WebTreeScopeType.h"
(...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after
940 return result; 942 return result;
941 } 943 }
942 944
943 v8::Local<v8::Context> WebLocalFrameImpl::mainWorldScriptContext() const 945 v8::Local<v8::Context> WebLocalFrameImpl::mainWorldScriptContext() const
944 { 946 {
945 ScriptState* scriptState = ScriptState::forMainWorld(frame()); 947 ScriptState* scriptState = ScriptState::forMainWorld(frame());
946 ASSERT(scriptState->contextIsValid()); 948 ASSERT(scriptState->contextIsValid());
947 return scriptState->context(); 949 return scriptState->context();
948 } 950 }
949 951
952 bool WebFrame::scriptCanAccess(WebFrame* target)
953 {
954 return BindingSecurity::shouldAllowAccessToFrame(mainThreadIsolate(), toCore Frame(target), DoNotReportSecurityError);
955 }
956
950 void WebLocalFrameImpl::reload(bool ignoreCache) 957 void WebLocalFrameImpl::reload(bool ignoreCache)
951 { 958 {
952 // TODO(clamy): Remove this function once RenderFrame calls load for all 959 // TODO(clamy): Remove this function once RenderFrame calls load for all
953 // requests. 960 // requests.
954 reloadWithOverrideURL(KURL(), ignoreCache); 961 reloadWithOverrideURL(KURL(), ignoreCache);
955 } 962 }
956 963
957 void WebLocalFrameImpl::reloadWithOverrideURL(const WebURL& overrideUrl, bool ig noreCache) 964 void WebLocalFrameImpl::reloadWithOverrideURL(const WebURL& overrideUrl, bool ig noreCache)
958 { 965 {
959 // TODO(clamy): Remove this function once RenderFrame calls load for all 966 // TODO(clamy): Remove this function once RenderFrame calls load for all
(...skipping 1234 matching lines...) Expand 10 before | Expand all | Expand 10 after
2194 } 2201 }
2195 2202
2196 WebSandboxFlags WebLocalFrameImpl::effectiveSandboxFlags() const 2203 WebSandboxFlags WebLocalFrameImpl::effectiveSandboxFlags() const
2197 { 2204 {
2198 if (!frame()) 2205 if (!frame())
2199 return WebSandboxFlags::None; 2206 return WebSandboxFlags::None;
2200 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags( )); 2207 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags( ));
2201 } 2208 }
2202 2209
2203 } // namespace blink 2210 } // namespace blink
OLDNEW
« no previous file with comments | « Source/bindings/core/v8/BindingSecurity.h ('k') | public/web/WebFrame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698