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

Side by Side Diff: third_party/WebKit/Source/core/frame/DOMWindowTimers.cpp

Issue 2713413002: Blink bindings: use v8 to enforce method call access checks (Closed)
Patch Set: Restore comment 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
4 * Copyright (C) 2013 Samsung Electronics. All rights reserved. 4 * Copyright (C) 2013 Samsung Electronics. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are 7 * modification, are permitted provided that the following conditions are
8 * met: 8 * met:
9 * 9 *
10 * * Redistributions of source code must retain the above copyright 10 * * Redistributions of source code must retain the above copyright
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 namespace blink { 43 namespace blink {
44 44
45 namespace DOMWindowTimers { 45 namespace DOMWindowTimers {
46 46
47 static bool isAllowed(ScriptState* scriptState, 47 static bool isAllowed(ScriptState* scriptState,
48 ExecutionContext* executionContext, 48 ExecutionContext* executionContext,
49 bool isEval) { 49 bool isEval) {
50 if (executionContext->isDocument()) { 50 if (executionContext->isDocument()) {
51 Document* document = static_cast<Document*>(executionContext); 51 Document* document = static_cast<Document*>(executionContext);
52 if (!document->frame())
53 return false;
52 if (isEval && 54 if (isEval &&
53 !document->contentSecurityPolicy()->allowEval( 55 !document->contentSecurityPolicy()->allowEval(
54 scriptState, ContentSecurityPolicy::SendReport, 56 scriptState, ContentSecurityPolicy::SendReport,
55 ContentSecurityPolicy::WillNotThrowException)) 57 ContentSecurityPolicy::WillNotThrowException))
56 return false; 58 return false;
57 return true; 59 return true;
58 } 60 }
59 if (executionContext->isWorkerGlobalScope()) { 61 if (executionContext->isWorkerGlobalScope()) {
60 WorkerGlobalScope* workerGlobalScope = 62 WorkerGlobalScope* workerGlobalScope =
61 static_cast<WorkerGlobalScope*>(executionContext); 63 static_cast<WorkerGlobalScope*>(executionContext);
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 } 150 }
149 151
150 void clearInterval(EventTarget& eventTarget, int timeoutID) { 152 void clearInterval(EventTarget& eventTarget, int timeoutID) {
151 if (ExecutionContext* context = eventTarget.getExecutionContext()) 153 if (ExecutionContext* context = eventTarget.getExecutionContext())
152 DOMTimer::removeByID(context, timeoutID); 154 DOMTimer::removeByID(context, timeoutID);
153 } 155 }
154 156
155 } // namespace DOMWindowTimers 157 } // namespace DOMWindowTimers
156 158
157 } // namespace blink 159 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698