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

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

Issue 1417023006: bindings: Refactors BindingSecurity::shouldAllowAccessToXXX. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed the assertion condition. Created 5 years 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 #include "wtf/text/StringBuilder.h" 82 #include "wtf/text/StringBuilder.h"
83 #include "wtf/text/TextPosition.h" 83 #include "wtf/text/TextPosition.h"
84 84
85 namespace blink { 85 namespace blink {
86 86
87 bool ScriptController::canAccessFromCurrentOrigin(LocalFrame *frame) 87 bool ScriptController::canAccessFromCurrentOrigin(LocalFrame *frame)
88 { 88 {
89 if (!frame) 89 if (!frame)
90 return false; 90 return false;
91 v8::Isolate* isolate = toIsolate(frame); 91 v8::Isolate* isolate = toIsolate(frame);
92 return !isolate->InContext() || BindingSecurity::shouldAllowAccessToFrame(is olate, callingDOMWindow(isolate), frame); 92 return !isolate->InContext() || BindingSecurity::shouldAllowAccessToFrame(is olate, callingDOMWindow(isolate), frame, ReportSecurityError);
93 } 93 }
94 94
95 ScriptController::ScriptController(LocalFrame* frame) 95 ScriptController::ScriptController(LocalFrame* frame)
96 : m_windowProxyManager(WindowProxyManager::create(*frame)) 96 : m_windowProxyManager(WindowProxyManager::create(*frame))
97 , m_sourceURL(0) 97 , m_sourceURL(0)
98 , m_windowScriptNPObject(0) 98 , m_windowScriptNPObject(0)
99 { 99 {
100 } 100 }
101 101
102 ScriptController::~ScriptController() 102 ScriptController::~ScriptController()
(...skipping 494 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