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

Unified Diff: third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp

Issue 2680013008: Reduce use of ExecutionContextTask in core/ (Closed)
Patch Set: fix stacktrace Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp
diff --git a/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp b/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp
index 987e599999e96857ca7cbb9f2aa1a1ff7f6d99b1..78d0920ae9698b25d8ed3c04cf9c2c779198a056 100644
--- a/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp
+++ b/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp
@@ -25,12 +25,12 @@
#include "core/frame/csp/ContentSecurityPolicy.h"
+#include <memory>
#include "bindings/core/v8/ScriptController.h"
#include "bindings/core/v8/SourceLocation.h"
#include "core/dom/DOMStringList.h"
#include "core/dom/Document.h"
#include "core/dom/Element.h"
-#include "core/dom/ExecutionContextTask.h"
#include "core/dom/SandboxFlags.h"
#include "core/dom/TaskRunnerHelper.h"
#include "core/events/EventQueue.h"
@@ -71,7 +71,6 @@
#include "wtf/text/ParsingUtilities.h"
#include "wtf/text/StringBuilder.h"
#include "wtf/text/StringUTF8Adaptor.h"
-#include <memory>
namespace blink {
@@ -1137,9 +1136,9 @@ void ContentSecurityPolicy::reportViolation(
// Fire a violation event if we're working within an execution context (e.g.
// we're not processing 'frame-ancestors').
if (m_executionContext) {
- m_executionContext->postTask(
- TaskType::Networking, BLINK_FROM_HERE,
- createSameThreadTask(&ContentSecurityPolicy::dispatchViolationEvents,
+ TaskRunnerHelper::get(TaskType::Networking, m_executionContext)
+ ->postTask(BLINK_FROM_HERE,
+ WTF::bind(&ContentSecurityPolicy::dispatchViolationEvents,
wrapPersistent(this), violationData,
wrapPersistent(element)));
}

Powered by Google App Engine
This is Rietveld 408576698