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

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

Issue 561813003: Prepare blink to unify definitions of load completion (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
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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698