| 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 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 535 | 536 |
| 536 bool ScriptController::executeScriptIfJavaScriptURL(const KURL& url) | 537 bool ScriptController::executeScriptIfJavaScriptURL(const KURL& url) |
| 537 { | 538 { |
| 538 if (!protocolIsJavaScript(url)) | 539 if (!protocolIsJavaScript(url)) |
| 539 return false; | 540 return false; |
| 540 | 541 |
| 541 if (!m_frame->page() | 542 if (!m_frame->page() |
| 542 || !m_frame->document()->contentSecurityPolicy()->allowJavaScriptURLs(m_
frame->document()->url(), eventHandlerPosition().m_line)) | 543 || !m_frame->document()->contentSecurityPolicy()->allowJavaScriptURLs(m_
frame->document()->url(), eventHandlerPosition().m_line)) |
| 543 return true; | 544 return true; |
| 544 | 545 |
| 546 if (m_frame->loader().stateMachine()->isDisplayingInitialEmptyDocument()) |
| 547 m_frame->loader().progress().progressStarted(); |
| 548 |
| 545 // We need to hold onto the LocalFrame here because executing script can | 549 // We need to hold onto the LocalFrame here because executing script can |
| 546 // destroy the frame. | 550 // destroy the frame. |
| 547 RefPtrWillBeRawPtr<LocalFrame> protect(m_frame.get()); | 551 RefPtrWillBeRawPtr<LocalFrame> protect(m_frame.get()); |
| 548 RefPtrWillBeRawPtr<Document> ownerDocument(m_frame->document()); | 552 RefPtrWillBeRawPtr<Document> ownerDocument(m_frame->document()); |
| 549 | 553 |
| 550 const int javascriptSchemeLength = sizeof("javascript:") - 1; | 554 const int javascriptSchemeLength = sizeof("javascript:") - 1; |
| 551 | 555 |
| 552 bool locationChangeBefore = m_frame->navigationScheduler().locationChangePen
ding(); | 556 bool locationChangeBefore = m_frame->navigationScheduler().locationChangePen
ding(); |
| 553 | 557 |
| 554 String decodedURL = decodeURLEscapeSequences(url.string()); | 558 String decodedURL = decodeURLEscapeSequences(url.string()); |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 644 resultArray->Set(i, evaluationResult); | 648 resultArray->Set(i, evaluationResult); |
| 645 } | 649 } |
| 646 | 650 |
| 647 if (results) { | 651 if (results) { |
| 648 for (size_t i = 0; i < resultArray->Length(); ++i) | 652 for (size_t i = 0; i < resultArray->Length(); ++i) |
| 649 results->append(handleScope.Escape(resultArray->Get(i))); | 653 results->append(handleScope.Escape(resultArray->Get(i))); |
| 650 } | 654 } |
| 651 } | 655 } |
| 652 | 656 |
| 653 } // namespace blink | 657 } // namespace blink |
| OLD | NEW |