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

Side by Side Diff: Source/web/WebPluginContainerImpl.cpp

Issue 314953005: Add an ASSERT about cross-world wrapper leakage into ScriptValue (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 if (!frame) 435 if (!frame)
436 return WebString(); 436 return WebString();
437 437
438 const KURL& kurl = url; 438 const KURL& kurl = url;
439 ASSERT(kurl.protocolIs("javascript")); 439 ASSERT(kurl.protocolIs("javascript"));
440 440
441 String script = decodeURLEscapeSequences( 441 String script = decodeURLEscapeSequences(
442 kurl.string().substring(strlen("javascript:"))); 442 kurl.string().substring(strlen("javascript:")));
443 443
444 UserGestureIndicator gestureIndicator(popupsAllowed ? DefinitelyProcessingNe wUserGesture : PossiblyProcessingUserGesture); 444 UserGestureIndicator gestureIndicator(popupsAllowed ? DefinitelyProcessingNe wUserGesture : PossiblyProcessingUserGesture);
445 ScriptValue result = frame->script().executeScriptInMainWorldAndReturnValue( ScriptSourceCode(script)); 445 v8::HandleScope handleScope(toIsolate(frame));
446 v8::Local<v8::Value> result = frame->script().executeScriptInMainWorldAndRet urnValue(ScriptSourceCode(script));
446 447
447 // Failure is reported as a null string. 448 // Failure is reported as a null string.
448 String resultString; 449 if (result.IsEmpty() || !result->IsString())
449 result.toString(resultString); 450 return WebString();
450 return resultString; 451 return toCoreString(v8::Handle<v8::String>::Cast(result));
451 } 452 }
452 453
453 void WebPluginContainerImpl::loadFrameRequest(const WebURLRequest& request, cons t WebString& target, bool notifyNeeded, void* notifyData) 454 void WebPluginContainerImpl::loadFrameRequest(const WebURLRequest& request, cons t WebString& target, bool notifyNeeded, void* notifyData)
454 { 455 {
455 LocalFrame* frame = m_element->document().frame(); 456 LocalFrame* frame = m_element->document().frame();
456 if (!frame || !frame->loader().documentLoader()) 457 if (!frame || !frame->loader().documentLoader())
457 return; // FIXME: send a notification in this case? 458 return; // FIXME: send a notification in this case?
458 459
459 if (notifyNeeded) { 460 if (notifyNeeded) {
460 // FIXME: This is a bit of hack to allow us to observe completion of 461 // FIXME: This is a bit of hack to allow us to observe completion of
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
900 901
901 return clipRect; 902 return clipRect;
902 } 903 }
903 904
904 bool WebPluginContainerImpl::pluginShouldPersist() const 905 bool WebPluginContainerImpl::pluginShouldPersist() const
905 { 906 {
906 return m_webPlugin->shouldPersist(); 907 return m_webPlugin->shouldPersist();
907 } 908 }
908 909
909 } // namespace blink 910 } // namespace blink
OLDNEW
« Source/bindings/v8/ScriptController.cpp ('K') | « Source/web/WebLocalFrameImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698