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

Side by Side Diff: third_party/WebKit/Source/web/WebLocalFrameImpl.cpp

Issue 2408333004: Move persistent gesture state to Document, add DocumentUserGestureToken (Closed)
Patch Set: Rebase Created 4 years, 1 month 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
OLDNEW
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
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 1779 matching lines...) Expand 10 before | Expand all | Expand 10 after
1892 Document* ownerDocument(frame()->document()); 1893 Document* ownerDocument(frame()->document());
1893 1894
1894 // Protect privileged pages against bookmarklets and other javascript 1895 // Protect privileged pages against bookmarklets and other javascript
1895 // manipulations. 1896 // manipulations.
1896 if (SchemeRegistry::shouldTreatURLSchemeAsNotAllowingJavascriptURLs( 1897 if (SchemeRegistry::shouldTreatURLSchemeAsNotAllowingJavascriptURLs(
1897 frame()->document()->url().protocol())) 1898 frame()->document()->url().protocol()))
1898 return; 1899 return;
1899 1900
1900 String script = decodeURLEscapeSequences( 1901 String script = decodeURLEscapeSequences(
1901 url.getString().substring(strlen("javascript:"))); 1902 url.getString().substring(strlen("javascript:")));
1902 UserGestureIndicator gestureIndicator( 1903 UserGestureIndicator gestureIndicator(DocumentUserGestureToken::create(
1903 UserGestureToken::create(UserGestureToken::NewGesture)); 1904 frame()->document(), UserGestureToken::NewGesture));
1904 v8::HandleScope handleScope(toIsolate(frame())); 1905 v8::HandleScope handleScope(toIsolate(frame()));
1905 v8::Local<v8::Value> result = 1906 v8::Local<v8::Value> result =
1906 frame()->script().executeScriptInMainWorldAndReturnValue( 1907 frame()->script().executeScriptInMainWorldAndReturnValue(
1907 ScriptSourceCode(script)); 1908 ScriptSourceCode(script));
1908 if (result.IsEmpty() || !result->IsString()) 1909 if (result.IsEmpty() || !result->IsString())
1909 return; 1910 return;
1910 String scriptResult = toCoreString(v8::Local<v8::String>::Cast(result)); 1911 String scriptResult = toCoreString(v8::Local<v8::String>::Cast(result));
1911 if (!frame()->navigationScheduler().locationChangePending()) 1912 if (!frame()->navigationScheduler().locationChangePending())
1912 frame()->loader().replaceDocumentWhileExecutingJavaScriptURL(scriptResult, 1913 frame()->loader().replaceDocumentWhileExecutingJavaScriptURL(scriptResult,
1913 ownerDocument); 1914 ownerDocument);
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after
2385 feature = UseCounter::ChromeLoadTimesNpnNegotiatedProtocol; 2386 feature = UseCounter::ChromeLoadTimesNpnNegotiatedProtocol;
2386 } else if (metric == "wasAlternateProtocolAvailable") { 2387 } else if (metric == "wasAlternateProtocolAvailable") {
2387 feature = UseCounter::ChromeLoadTimesWasAlternateProtocolAvailable; 2388 feature = UseCounter::ChromeLoadTimesWasAlternateProtocolAvailable;
2388 } else if (metric == "connectionInfo") { 2389 } else if (metric == "connectionInfo") {
2389 feature = UseCounter::ChromeLoadTimesConnectionInfo; 2390 feature = UseCounter::ChromeLoadTimesConnectionInfo;
2390 } 2391 }
2391 UseCounter::count(frame(), feature); 2392 UseCounter::count(frame(), feature);
2392 } 2393 }
2393 2394
2394 } // namespace blink 2395 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698