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

Side by Side Diff: Source/bindings/v8/ScriptController.cpp

Issue 353873003: Clean up usage of CSP functions (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix to apply Created 6 years, 6 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/v8/ScriptController.h ('k') | Source/core/dom/ScriptLoader.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 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 OwnPtr<V8WindowShell> isolatedWorldShell = V8WindowShell::create(m_f rame, world, m_isolate); 226 OwnPtr<V8WindowShell> isolatedWorldShell = V8WindowShell::create(m_f rame, world, m_isolate);
227 shell = isolatedWorldShell.get(); 227 shell = isolatedWorldShell.get();
228 m_isolatedWorlds.set(world.worldId(), isolatedWorldShell.release()); 228 m_isolatedWorlds.set(world.worldId(), isolatedWorldShell.release());
229 } 229 }
230 } 230 }
231 if (!shell->isContextInitialized() && shell->initializeIfNeeded() && world.i sMainWorld()) 231 if (!shell->isContextInitialized() && shell->initializeIfNeeded() && world.i sMainWorld())
232 m_frame->loader().dispatchDidClearWindowObjectInMainWorld(); 232 m_frame->loader().dispatchDidClearWindowObjectInMainWorld();
233 return shell; 233 return shell;
234 } 234 }
235 235
236 bool ScriptController::shouldBypassMainWorldContentSecurityPolicy() 236 bool ScriptController::shouldBypassMainWorldCSP()
237 { 237 {
238 v8::Handle<v8::Context> context = m_isolate->GetCurrentContext(); 238 v8::Handle<v8::Context> context = m_isolate->GetCurrentContext();
239 if (context.IsEmpty() || !toDOMWindow(context)) 239 if (context.IsEmpty() || !toDOMWindow(context))
240 return false; 240 return false;
241 DOMWrapperWorld& world = DOMWrapperWorld::current(m_isolate); 241 DOMWrapperWorld& world = DOMWrapperWorld::current(m_isolate);
242 return world.isIsolatedWorld() ? world.isolatedWorldHasContentSecurityPolicy () : false; 242 return world.isIsolatedWorld() ? world.isolatedWorldHasContentSecurityPolicy () : false;
243 } 243 }
244 244
245 TextPosition ScriptController::eventHandlerPosition() const 245 TextPosition ScriptController::eventHandlerPosition() const
246 { 246 {
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
615 resultArray->Set(i, evaluationResult); 615 resultArray->Set(i, evaluationResult);
616 } 616 }
617 617
618 if (results) { 618 if (results) {
619 for (size_t i = 0; i < resultArray->Length(); ++i) 619 for (size_t i = 0; i < resultArray->Length(); ++i)
620 results->append(handleScope.Escape(resultArray->Get(i))); 620 results->append(handleScope.Escape(resultArray->Get(i)));
621 } 621 }
622 } 622 }
623 623
624 } // namespace WebCore 624 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/v8/ScriptController.h ('k') | Source/core/dom/ScriptLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698