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

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

Issue 2728303006: Add AllowUserAgentScript to WebFrame::callFunctionEvenIfScriptDisabled. (Closed)
Patch Set: Created 3 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 799 matching lines...) Expand 10 before | Expand all | Expand 10 after
810 callback); 810 callback);
811 } 811 }
812 812
813 // TODO(bashi): Consider returning MaybeLocal. 813 // TODO(bashi): Consider returning MaybeLocal.
814 v8::Local<v8::Value> WebLocalFrameImpl::callFunctionEvenIfScriptDisabled( 814 v8::Local<v8::Value> WebLocalFrameImpl::callFunctionEvenIfScriptDisabled(
815 v8::Local<v8::Function> function, 815 v8::Local<v8::Function> function,
816 v8::Local<v8::Value> receiver, 816 v8::Local<v8::Value> receiver,
817 int argc, 817 int argc,
818 v8::Local<v8::Value> argv[]) { 818 v8::Local<v8::Value> argv[]) {
819 DCHECK(frame()); 819 DCHECK(frame());
820 ScriptForbiddenScope::AllowUserAgentScript allowScriptingEvenIfForbidden;
820 v8::Local<v8::Value> result; 821 v8::Local<v8::Value> result;
821 if (!V8ScriptRunner::callFunction( 822 if (!V8ScriptRunner::callFunction(
822 function, frame()->document(), receiver, argc, 823 function, frame()->document(), receiver, argc,
823 static_cast<v8::Local<v8::Value>*>(argv), toIsolate(frame())) 824 static_cast<v8::Local<v8::Value>*>(argv), toIsolate(frame()))
824 .ToLocal(&result)) 825 .ToLocal(&result))
825 return v8::Local<v8::Value>(); 826 return v8::Local<v8::Value>();
826 return result; 827 return result;
827 } 828 }
828 829
829 v8::Local<v8::Context> WebLocalFrameImpl::mainWorldScriptContext() const { 830 v8::Local<v8::Context> WebLocalFrameImpl::mainWorldScriptContext() const {
(...skipping 1630 matching lines...) Expand 10 before | Expand all | Expand 10 after
2460 createMarkup(startPosition, endPosition, AnnotateForInterchange, 2461 createMarkup(startPosition, endPosition, AnnotateForInterchange,
2461 ConvertBlocksToInlines::NotConvert, ResolveNonLocalURLs); 2462 ConvertBlocksToInlines::NotConvert, ResolveNonLocalURLs);
2462 } else { 2463 } else {
2463 clipHtml = 2464 clipHtml =
2464 createMarkup(endPosition, startPosition, AnnotateForInterchange, 2465 createMarkup(endPosition, startPosition, AnnotateForInterchange,
2465 ConvertBlocksToInlines::NotConvert, ResolveNonLocalURLs); 2466 ConvertBlocksToInlines::NotConvert, ResolveNonLocalURLs);
2466 } 2467 }
2467 } 2468 }
2468 2469
2469 } // namespace blink 2470 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698