Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 59 #include "core/frame/Settings.h" | 59 #include "core/frame/Settings.h" |
| 60 #include "core/frame/UseCounter.h" | 60 #include "core/frame/UseCounter.h" |
| 61 #include "core/frame/csp/ContentSecurityPolicy.h" | 61 #include "core/frame/csp/ContentSecurityPolicy.h" |
| 62 #include "core/html/HTMLPlugInElement.h" | 62 #include "core/html/HTMLPlugInElement.h" |
| 63 #include "core/inspector/InspectorInstrumentation.h" | 63 #include "core/inspector/InspectorInstrumentation.h" |
| 64 #include "core/inspector/InspectorTraceEvents.h" | 64 #include "core/inspector/InspectorTraceEvents.h" |
| 65 #include "core/inspector/ScriptCallStack.h" | 65 #include "core/inspector/ScriptCallStack.h" |
| 66 #include "core/loader/DocumentLoader.h" | 66 #include "core/loader/DocumentLoader.h" |
| 67 #include "core/loader/FrameLoader.h" | 67 #include "core/loader/FrameLoader.h" |
| 68 #include "core/loader/FrameLoaderClient.h" | 68 #include "core/loader/FrameLoaderClient.h" |
| 69 #include "core/loader/ProgressTracker.h" | |
| 69 #include "core/plugins/PluginView.h" | 70 #include "core/plugins/PluginView.h" |
| 70 #include "platform/NotImplemented.h" | 71 #include "platform/NotImplemented.h" |
| 71 #include "platform/TraceEvent.h" | 72 #include "platform/TraceEvent.h" |
| 72 #include "platform/UserGestureIndicator.h" | 73 #include "platform/UserGestureIndicator.h" |
| 73 #include "platform/Widget.h" | 74 #include "platform/Widget.h" |
| 74 #include "platform/weborigin/SecurityOrigin.h" | 75 #include "platform/weborigin/SecurityOrigin.h" |
| 75 #include "public/platform/Platform.h" | 76 #include "public/platform/Platform.h" |
| 76 #include "wtf/CurrentTime.h" | 77 #include "wtf/CurrentTime.h" |
| 77 #include "wtf/StdLibExtras.h" | 78 #include "wtf/StdLibExtras.h" |
| 78 #include "wtf/StringExtras.h" | 79 #include "wtf/StringExtras.h" |
| (...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 528 | 529 |
| 529 bool ScriptController::executeScriptIfJavaScriptURL(const KURL& url) | 530 bool ScriptController::executeScriptIfJavaScriptURL(const KURL& url) |
| 530 { | 531 { |
| 531 if (!protocolIsJavaScript(url)) | 532 if (!protocolIsJavaScript(url)) |
| 532 return false; | 533 return false; |
| 533 | 534 |
| 534 if (!m_frame->page() | 535 if (!m_frame->page() |
| 535 || !m_frame->document()->contentSecurityPolicy()->allowJavaScriptURLs(m_ frame->document()->url(), eventHandlerPosition().m_line)) | 536 || !m_frame->document()->contentSecurityPolicy()->allowJavaScriptURLs(m_ frame->document()->url(), eventHandlerPosition().m_line)) |
| 536 return true; | 537 return true; |
| 537 | 538 |
| 539 if (m_frame->loader().stateMachine()->isDisplayingInitialEmptyDocument()) | |
| 540 m_frame->loader().progress().progressStarted(); | |
|
Nate Chapin
2014/09/15 23:39:34
Apparently we've never marked the start of a navig
| |
| 541 | |
| 538 // We need to hold onto the LocalFrame here because executing script can | 542 // We need to hold onto the LocalFrame here because executing script can |
| 539 // destroy the frame. | 543 // destroy the frame. |
| 540 RefPtr<LocalFrame> protector(m_frame); | 544 RefPtr<LocalFrame> protector(m_frame); |
| 541 RefPtrWillBeRawPtr<Document> ownerDocument(m_frame->document()); | 545 RefPtrWillBeRawPtr<Document> ownerDocument(m_frame->document()); |
| 542 | 546 |
| 543 const int javascriptSchemeLength = sizeof("javascript:") - 1; | 547 const int javascriptSchemeLength = sizeof("javascript:") - 1; |
| 544 | 548 |
| 545 bool locationChangeBefore = m_frame->navigationScheduler().locationChangePen ding(); | 549 bool locationChangeBefore = m_frame->navigationScheduler().locationChangePen ding(); |
| 546 | 550 |
| 547 String decodedURL = decodeURLEscapeSequences(url.string()); | 551 String decodedURL = decodeURLEscapeSequences(url.string()); |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 637 resultArray->Set(i, evaluationResult); | 641 resultArray->Set(i, evaluationResult); |
| 638 } | 642 } |
| 639 | 643 |
| 640 if (results) { | 644 if (results) { |
| 641 for (size_t i = 0; i < resultArray->Length(); ++i) | 645 for (size_t i = 0; i < resultArray->Length(); ++i) |
| 642 results->append(handleScope.Escape(resultArray->Get(i))); | 646 results->append(handleScope.Escape(resultArray->Get(i))); |
| 643 } | 647 } |
| 644 } | 648 } |
| 645 | 649 |
| 646 } // namespace blink | 650 } // namespace blink |
| OLD | NEW |