| OLD | NEW |
| 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 #include "bindings/core/v8/ExceptionStatePlaceholder.h" | 93 #include "bindings/core/v8/ExceptionStatePlaceholder.h" |
| 94 #include "bindings/core/v8/ScriptController.h" | 94 #include "bindings/core/v8/ScriptController.h" |
| 95 #include "bindings/core/v8/ScriptSourceCode.h" | 95 #include "bindings/core/v8/ScriptSourceCode.h" |
| 96 #include "bindings/core/v8/ScriptValue.h" | 96 #include "bindings/core/v8/ScriptValue.h" |
| 97 #include "bindings/core/v8/SourceLocation.h" | 97 #include "bindings/core/v8/SourceLocation.h" |
| 98 #include "bindings/core/v8/V8Binding.h" | 98 #include "bindings/core/v8/V8Binding.h" |
| 99 #include "bindings/core/v8/V8GCController.h" | 99 #include "bindings/core/v8/V8GCController.h" |
| 100 #include "bindings/core/v8/V8PerIsolateData.h" | 100 #include "bindings/core/v8/V8PerIsolateData.h" |
| 101 #include "core/HTMLNames.h" | 101 #include "core/HTMLNames.h" |
| 102 #include "core/dom/Document.h" | 102 #include "core/dom/Document.h" |
| 103 #include "core/dom/DocumentUserGestureToken.h" |
| 103 #include "core/dom/IconURL.h" | 104 #include "core/dom/IconURL.h" |
| 104 #include "core/dom/MessagePort.h" | 105 #include "core/dom/MessagePort.h" |
| 105 #include "core/dom/Node.h" | 106 #include "core/dom/Node.h" |
| 106 #include "core/dom/NodeTraversal.h" | 107 #include "core/dom/NodeTraversal.h" |
| 107 #include "core/dom/SuspendableTask.h" | 108 #include "core/dom/SuspendableTask.h" |
| 108 #include "core/dom/shadow/ShadowRoot.h" | 109 #include "core/dom/shadow/ShadowRoot.h" |
| 109 #include "core/editing/EditingUtilities.h" | 110 #include "core/editing/EditingUtilities.h" |
| 110 #include "core/editing/Editor.h" | 111 #include "core/editing/Editor.h" |
| 111 #include "core/editing/FrameSelection.h" | 112 #include "core/editing/FrameSelection.h" |
| 112 #include "core/editing/InputMethodController.h" | 113 #include "core/editing/InputMethodController.h" |
| (...skipping 1780 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1893 Document* ownerDocument(frame()->document()); | 1894 Document* ownerDocument(frame()->document()); |
| 1894 | 1895 |
| 1895 // Protect privileged pages against bookmarklets and other javascript | 1896 // Protect privileged pages against bookmarklets and other javascript |
| 1896 // manipulations. | 1897 // manipulations. |
| 1897 if (SchemeRegistry::shouldTreatURLSchemeAsNotAllowingJavascriptURLs( | 1898 if (SchemeRegistry::shouldTreatURLSchemeAsNotAllowingJavascriptURLs( |
| 1898 frame()->document()->url().protocol())) | 1899 frame()->document()->url().protocol())) |
| 1899 return; | 1900 return; |
| 1900 | 1901 |
| 1901 String script = decodeURLEscapeSequences( | 1902 String script = decodeURLEscapeSequences( |
| 1902 url.getString().substring(strlen("javascript:"))); | 1903 url.getString().substring(strlen("javascript:"))); |
| 1903 UserGestureIndicator gestureIndicator( | 1904 UserGestureIndicator gestureIndicator(DocumentUserGestureToken::create( |
| 1904 UserGestureToken::create(UserGestureToken::NewGesture)); | 1905 frame()->document(), UserGestureToken::NewGesture)); |
| 1905 v8::HandleScope handleScope(toIsolate(frame())); | 1906 v8::HandleScope handleScope(toIsolate(frame())); |
| 1906 v8::Local<v8::Value> result = | 1907 v8::Local<v8::Value> result = |
| 1907 frame()->script().executeScriptInMainWorldAndReturnValue( | 1908 frame()->script().executeScriptInMainWorldAndReturnValue( |
| 1908 ScriptSourceCode(script)); | 1909 ScriptSourceCode(script)); |
| 1909 if (result.IsEmpty() || !result->IsString()) | 1910 if (result.IsEmpty() || !result->IsString()) |
| 1910 return; | 1911 return; |
| 1911 String scriptResult = toCoreString(v8::Local<v8::String>::Cast(result)); | 1912 String scriptResult = toCoreString(v8::Local<v8::String>::Cast(result)); |
| 1912 if (!frame()->navigationScheduler().locationChangePending()) | 1913 if (!frame()->navigationScheduler().locationChangePending()) |
| 1913 frame()->loader().replaceDocumentWhileExecutingJavaScriptURL(scriptResult, | 1914 frame()->loader().replaceDocumentWhileExecutingJavaScriptURL(scriptResult, |
| 1914 ownerDocument); | 1915 ownerDocument); |
| (...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2386 feature = UseCounter::ChromeLoadTimesNpnNegotiatedProtocol; | 2387 feature = UseCounter::ChromeLoadTimesNpnNegotiatedProtocol; |
| 2387 } else if (metric == "wasAlternateProtocolAvailable") { | 2388 } else if (metric == "wasAlternateProtocolAvailable") { |
| 2388 feature = UseCounter::ChromeLoadTimesWasAlternateProtocolAvailable; | 2389 feature = UseCounter::ChromeLoadTimesWasAlternateProtocolAvailable; |
| 2389 } else if (metric == "connectionInfo") { | 2390 } else if (metric == "connectionInfo") { |
| 2390 feature = UseCounter::ChromeLoadTimesConnectionInfo; | 2391 feature = UseCounter::ChromeLoadTimesConnectionInfo; |
| 2391 } | 2392 } |
| 2392 UseCounter::count(frame(), feature); | 2393 UseCounter::count(frame(), feature); |
| 2393 } | 2394 } |
| 2394 | 2395 |
| 2395 } // namespace blink | 2396 } // namespace blink |
| OLD | NEW |