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 1740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1853 Document* ownerDocument(frame()->document()); | 1854 Document* ownerDocument(frame()->document()); |
1854 | 1855 |
1855 // Protect privileged pages against bookmarklets and other javascript | 1856 // Protect privileged pages against bookmarklets and other javascript |
1856 // manipulations. | 1857 // manipulations. |
1857 if (SchemeRegistry::shouldTreatURLSchemeAsNotAllowingJavascriptURLs( | 1858 if (SchemeRegistry::shouldTreatURLSchemeAsNotAllowingJavascriptURLs( |
1858 frame()->document()->url().protocol())) | 1859 frame()->document()->url().protocol())) |
1859 return; | 1860 return; |
1860 | 1861 |
1861 String script = decodeURLEscapeSequences( | 1862 String script = decodeURLEscapeSequences( |
1862 url.getString().substring(strlen("javascript:"))); | 1863 url.getString().substring(strlen("javascript:"))); |
1863 UserGestureIndicator gestureIndicator( | 1864 UserGestureIndicator gestureIndicator(DocumentUserGestureToken::create( |
1864 UserGestureToken::create(UserGestureToken::NewGesture)); | 1865 frame()->document(), UserGestureToken::NewGesture)); |
1865 v8::HandleScope handleScope(toIsolate(frame())); | 1866 v8::HandleScope handleScope(toIsolate(frame())); |
1866 v8::Local<v8::Value> result = | 1867 v8::Local<v8::Value> result = |
1867 frame()->script().executeScriptInMainWorldAndReturnValue( | 1868 frame()->script().executeScriptInMainWorldAndReturnValue( |
1868 ScriptSourceCode(script)); | 1869 ScriptSourceCode(script)); |
1869 if (result.IsEmpty() || !result->IsString()) | 1870 if (result.IsEmpty() || !result->IsString()) |
1870 return; | 1871 return; |
1871 String scriptResult = toCoreString(v8::Local<v8::String>::Cast(result)); | 1872 String scriptResult = toCoreString(v8::Local<v8::String>::Cast(result)); |
1872 if (!frame()->navigationScheduler().locationChangePending()) | 1873 if (!frame()->navigationScheduler().locationChangePending()) |
1873 frame()->loader().replaceDocumentWhileExecutingJavaScriptURL(scriptResult, | 1874 frame()->loader().replaceDocumentWhileExecutingJavaScriptURL(scriptResult, |
1874 ownerDocument); | 1875 ownerDocument); |
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2347 feature = UseCounter::ChromeLoadTimesNpnNegotiatedProtocol; | 2348 feature = UseCounter::ChromeLoadTimesNpnNegotiatedProtocol; |
2348 } else if (metric == "wasAlternateProtocolAvailable") { | 2349 } else if (metric == "wasAlternateProtocolAvailable") { |
2349 feature = UseCounter::ChromeLoadTimesWasAlternateProtocolAvailable; | 2350 feature = UseCounter::ChromeLoadTimesWasAlternateProtocolAvailable; |
2350 } else if (metric == "connectionInfo") { | 2351 } else if (metric == "connectionInfo") { |
2351 feature = UseCounter::ChromeLoadTimesConnectionInfo; | 2352 feature = UseCounter::ChromeLoadTimesConnectionInfo; |
2352 } | 2353 } |
2353 UseCounter::count(frame(), feature); | 2354 UseCounter::count(frame(), feature); |
2354 } | 2355 } |
2355 | 2356 |
2356 } // namespace blink | 2357 } // namespace blink |
OLD | NEW |