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

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

Issue 301233010: Oilpan: use transition types for remaining RefPtr<Document>s in dom/. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Have Document weakly track its attached Ranges 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
« no previous file with comments | « no previous file | Source/bindings/v8/custom/V8DocumentCustom.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 498 matching lines...) Expand 10 before | Expand all | Expand 10 after
509 if (!protocolIsJavaScript(url)) 509 if (!protocolIsJavaScript(url))
510 return false; 510 return false;
511 511
512 if (!m_frame->page() 512 if (!m_frame->page()
513 || !m_frame->document()->contentSecurityPolicy()->allowJavaScriptURLs(m_ frame->document()->url(), eventHandlerPosition().m_line)) 513 || !m_frame->document()->contentSecurityPolicy()->allowJavaScriptURLs(m_ frame->document()->url(), eventHandlerPosition().m_line))
514 return true; 514 return true;
515 515
516 // We need to hold onto the LocalFrame here because executing script can 516 // We need to hold onto the LocalFrame here because executing script can
517 // destroy the frame. 517 // destroy the frame.
518 RefPtr<LocalFrame> protector(m_frame); 518 RefPtr<LocalFrame> protector(m_frame);
519 RefPtr<Document> ownerDocument(m_frame->document()); 519 RefPtrWillBeRawPtr<Document> ownerDocument(m_frame->document());
520 520
521 const int javascriptSchemeLength = sizeof("javascript:") - 1; 521 const int javascriptSchemeLength = sizeof("javascript:") - 1;
522 522
523 bool locationChangeBefore = m_frame->navigationScheduler().locationChangePen ding(); 523 bool locationChangeBefore = m_frame->navigationScheduler().locationChangePen ding();
524 524
525 String decodedURL = decodeURLEscapeSequences(url.string()); 525 String decodedURL = decodeURLEscapeSequences(url.string());
526 ScriptValue result = evaluateScriptInMainWorld(ScriptSourceCode(decodedURL.s ubstring(javascriptSchemeLength)), NotSharableCrossOrigin, DoNotExecuteScriptWhe nScriptsDisabled); 526 ScriptValue result = evaluateScriptInMainWorld(ScriptSourceCode(decodedURL.s ubstring(javascriptSchemeLength)), NotSharableCrossOrigin, DoNotExecuteScriptWhe nScriptsDisabled);
527 527
528 // If executing script caused this frame to be removed from the page, we 528 // If executing script caused this frame to be removed from the page, we
529 // don't want to try to replace its document! 529 // don't want to try to replace its document!
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
616 resultArray->Set(i, evaluationResult); 616 resultArray->Set(i, evaluationResult);
617 } 617 }
618 618
619 if (results) { 619 if (results) {
620 for (size_t i = 0; i < resultArray->Length(); ++i) 620 for (size_t i = 0; i < resultArray->Length(); ++i)
621 results->append(ScriptValue(ScriptState::from(context), resultArray- >Get(i))); 621 results->append(ScriptValue(ScriptState::from(context), resultArray- >Get(i)));
622 } 622 }
623 } 623 }
624 624
625 } // namespace WebCore 625 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | Source/bindings/v8/custom/V8DocumentCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698