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

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

Issue 2408333004: Move persistent gesture state to Document, add DocumentUserGestureToken (Closed)
Patch Set: Re-add dropped null check 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 1780 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp ('k') | third_party/WebKit/Source/web/WebPluginContainerImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698