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

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

Issue 2723973002: Make V8Binding helpers return LocalFrame/LocalDOMWindow as appropriate (Closed)
Patch Set: . 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/ScriptState.cpp » ('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) 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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 155
156 LocalWindowProxy* ScriptController::windowProxy(DOMWrapperWorld& world) { 156 LocalWindowProxy* ScriptController::windowProxy(DOMWrapperWorld& world) {
157 LocalWindowProxy* windowProxy = m_windowProxyManager->windowProxy(world); 157 LocalWindowProxy* windowProxy = m_windowProxyManager->windowProxy(world);
158 windowProxy->initializeIfNeeded(); 158 windowProxy->initializeIfNeeded();
159 return windowProxy; 159 return windowProxy;
160 } 160 }
161 161
162 bool ScriptController::shouldBypassMainWorldCSP() { 162 bool ScriptController::shouldBypassMainWorldCSP() {
163 v8::HandleScope handleScope(isolate()); 163 v8::HandleScope handleScope(isolate());
164 v8::Local<v8::Context> context = isolate()->GetCurrentContext(); 164 v8::Local<v8::Context> context = isolate()->GetCurrentContext();
165 if (context.IsEmpty() || !toDOMWindow(context)) 165 if (context.IsEmpty() || !toLocalDOMWindow(context))
166 return false; 166 return false;
167 DOMWrapperWorld& world = DOMWrapperWorld::current(isolate()); 167 DOMWrapperWorld& world = DOMWrapperWorld::current(isolate());
168 return world.isIsolatedWorld() ? world.isolatedWorldHasContentSecurityPolicy() 168 return world.isIsolatedWorld() ? world.isolatedWorldHasContentSecurityPolicy()
169 : false; 169 : false;
170 } 170 }
171 171
172 TextPosition ScriptController::eventHandlerPosition() const { 172 TextPosition ScriptController::eventHandlerPosition() const {
173 ScriptableDocumentParser* parser = 173 ScriptableDocumentParser* parser =
174 frame()->document()->scriptableDocumentParser(); 174 frame()->document()->scriptableDocumentParser();
175 if (parser) 175 if (parser)
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 for (size_t i = 0; i < resultArray->Length(); ++i) { 375 for (size_t i = 0; i < resultArray->Length(); ++i) {
376 v8::Local<v8::Value> value; 376 v8::Local<v8::Value> value;
377 if (!resultArray->Get(scriptState->context(), i).ToLocal(&value)) 377 if (!resultArray->Get(scriptState->context(), i).ToLocal(&value))
378 return; 378 return;
379 results->push_back(value); 379 results->push_back(value);
380 } 380 }
381 } 381 }
382 } 382 }
383 383
384 } // namespace blink 384 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/ScriptState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698