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

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

Issue 1718403002: Fix security checks when navigating remote frames to javascript: URLs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix check Created 4 years, 10 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) 2008, 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2008, 2009 Google Inc. All rights reserved.
3 * Copyright (C) 2009 Apple Inc. All rights reserved. 3 * Copyright (C) 2009 Apple Inc. All rights reserved.
4 * Copyright (C) 2014 Opera Software ASA. All rights reserved. 4 * Copyright (C) 2014 Opera Software ASA. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are 7 * modification, are permitted provided that the following conditions are
8 * met: 8 * met:
9 * 9 *
10 * * Redistributions of source code must retain the above copyright 10 * * Redistributions of source code must retain the above copyright
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 #include "public/platform/Platform.h" 76 #include "public/platform/Platform.h"
77 #include "wtf/CurrentTime.h" 77 #include "wtf/CurrentTime.h"
78 #include "wtf/StdLibExtras.h" 78 #include "wtf/StdLibExtras.h"
79 #include "wtf/StringExtras.h" 79 #include "wtf/StringExtras.h"
80 #include "wtf/text/CString.h" 80 #include "wtf/text/CString.h"
81 #include "wtf/text/StringBuilder.h" 81 #include "wtf/text/StringBuilder.h"
82 #include "wtf/text/TextPosition.h" 82 #include "wtf/text/TextPosition.h"
83 83
84 namespace blink { 84 namespace blink {
85 85
86 bool ScriptController::canAccessFromCurrentOrigin(LocalFrame *frame) 86 bool ScriptController::canAccessFromCurrentOrigin(ExecutionContext& context, Fra me* frame)
haraken 2016/02/23 10:07:59 How about just passing v8::Isolate, rather than Ex
alexmos 2016/02/23 17:51:05 Done.
87 { 87 {
88 if (!frame) 88 if (!frame)
89 return false; 89 return false;
90 v8::Isolate* isolate = toIsolate(frame); 90 v8::Isolate* isolate = toIsolate(&context);
91 return !isolate->InContext() || BindingSecurity::shouldAllowAccessToFrame(is olate, callingDOMWindow(isolate), frame, ReportSecurityError); 91 return !isolate->InContext() || BindingSecurity::shouldAllowAccessToFrame(is olate, callingDOMWindow(isolate), frame, ReportSecurityError);
92 } 92 }
93 93
94 ScriptController::ScriptController(LocalFrame* frame) 94 ScriptController::ScriptController(LocalFrame* frame)
95 : m_windowProxyManager(WindowProxyManager::create(*frame)) 95 : m_windowProxyManager(WindowProxyManager::create(*frame))
96 , m_sourceURL(0) 96 , m_sourceURL(0)
97 , m_windowScriptNPObject(0) 97 , m_windowScriptNPObject(0)
98 { 98 {
99 } 99 }
100 100
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after
597 for (size_t i = 0; i < resultArray->Length(); ++i) { 597 for (size_t i = 0; i < resultArray->Length(); ++i) {
598 v8::Local<v8::Value> value; 598 v8::Local<v8::Value> value;
599 if (!resultArray->Get(scriptState->context(), i).ToLocal(&value)) 599 if (!resultArray->Get(scriptState->context(), i).ToLocal(&value))
600 return; 600 return;
601 results->append(value); 601 results->append(value);
602 } 602 }
603 } 603 }
604 } 604 }
605 605
606 } // namespace blink 606 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698