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

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

Issue 556713002: Add a missing handle scope to ScriptController::shouldBypassMainWorldCSP (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 3 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 | « no previous file | no next file » | 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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 m_isolatedWorlds.set(world.worldId(), isolatedWorldWindowProxy.relea se()); 233 m_isolatedWorlds.set(world.worldId(), isolatedWorldWindowProxy.relea se());
234 } 234 }
235 } 235 }
236 if (!windowProxy->isContextInitialized() && windowProxy->initializeIfNeeded( ) && world.isMainWorld()) 236 if (!windowProxy->isContextInitialized() && windowProxy->initializeIfNeeded( ) && world.isMainWorld())
237 m_frame->loader().dispatchDidClearWindowObjectInMainWorld(); 237 m_frame->loader().dispatchDidClearWindowObjectInMainWorld();
238 return windowProxy; 238 return windowProxy;
239 } 239 }
240 240
241 bool ScriptController::shouldBypassMainWorldCSP() 241 bool ScriptController::shouldBypassMainWorldCSP()
242 { 242 {
243 v8::HandleScope handleScope(m_isolate);
243 v8::Handle<v8::Context> context = m_isolate->GetCurrentContext(); 244 v8::Handle<v8::Context> context = m_isolate->GetCurrentContext();
244 if (context.IsEmpty() || !toDOMWindow(context)) 245 if (context.IsEmpty() || !toDOMWindow(context))
245 return false; 246 return false;
246 DOMWrapperWorld& world = DOMWrapperWorld::current(m_isolate); 247 DOMWrapperWorld& world = DOMWrapperWorld::current(m_isolate);
247 return world.isIsolatedWorld() ? world.isolatedWorldHasContentSecurityPolicy () : false; 248 return world.isIsolatedWorld() ? world.isolatedWorldHasContentSecurityPolicy () : false;
248 } 249 }
249 250
250 TextPosition ScriptController::eventHandlerPosition() const 251 TextPosition ScriptController::eventHandlerPosition() const
251 { 252 {
252 ScriptableDocumentParser* parser = m_frame->document()->scriptableDocumentPa rser(); 253 ScriptableDocumentParser* parser = m_frame->document()->scriptableDocumentPa rser();
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
633 resultArray->Set(i, evaluationResult); 634 resultArray->Set(i, evaluationResult);
634 } 635 }
635 636
636 if (results) { 637 if (results) {
637 for (size_t i = 0; i < resultArray->Length(); ++i) 638 for (size_t i = 0; i < resultArray->Length(); ++i)
638 results->append(handleScope.Escape(resultArray->Get(i))); 639 results->append(handleScope.Escape(resultArray->Get(i)));
639 } 640 }
640 } 641 }
641 642
642 } // namespace blink 643 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698