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

Side by Side Diff: third_party/WebKit/Source/core/loader/SubresourceFilter.cpp

Issue 2959613002: Rename TaskRunner::RunsTasksOnCurrentThread() in //third_party (Closed)
Patch Set: Remove comments Created 3 years, 5 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 | third_party/WebKit/Source/platform/Timer.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/loader/SubresourceFilter.h" 5 #include "core/loader/SubresourceFilter.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "core/dom/Document.h" 9 #include "core/dom/Document.h"
10 #include "core/dom/TaskRunnerHelper.h" 10 #include "core/dom/TaskRunnerHelper.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 bool SubresourceFilter::AllowWebSocketConnection(const KURL& url) { 62 bool SubresourceFilter::AllowWebSocketConnection(const KURL& url) {
63 WebDocumentSubresourceFilter::LoadPolicy load_policy = 63 WebDocumentSubresourceFilter::LoadPolicy load_policy =
64 subresource_filter_->GetLoadPolicyForWebSocketConnect(url); 64 subresource_filter_->GetLoadPolicyForWebSocketConnect(url);
65 65
66 // Post a task to notify this load to avoid unduly blocking the worker 66 // Post a task to notify this load to avoid unduly blocking the worker
67 // thread. Note that this unconditionally calls reportLoad unlike allowLoad, 67 // thread. Note that this unconditionally calls reportLoad unlike allowLoad,
68 // because there aren't developer-invisible connections (like speculative 68 // because there aren't developer-invisible connections (like speculative
69 // preloads) happening here. 69 // preloads) happening here.
70 RefPtr<WebTaskRunner> task_runner = TaskRunnerHelper::Get( 70 RefPtr<WebTaskRunner> task_runner = TaskRunnerHelper::Get(
71 TaskType::kNetworking, document_loader_->GetFrame()); 71 TaskType::kNetworking, document_loader_->GetFrame());
72 DCHECK(task_runner->RunsTasksOnCurrentThread()); 72 DCHECK(task_runner->RunsTasksInCurrentSequence());
73 task_runner->PostTask(BLINK_FROM_HERE, 73 task_runner->PostTask(BLINK_FROM_HERE,
74 WTF::Bind(&SubresourceFilter::ReportLoad, 74 WTF::Bind(&SubresourceFilter::ReportLoad,
75 WrapPersistent(this), url, load_policy)); 75 WrapPersistent(this), url, load_policy));
76 return load_policy != WebDocumentSubresourceFilter::kDisallow; 76 return load_policy != WebDocumentSubresourceFilter::kDisallow;
77 } 77 }
78 78
79 void SubresourceFilter::ReportLoad( 79 void SubresourceFilter::ReportLoad(
80 const KURL& resource_url, 80 const KURL& resource_url,
81 WebDocumentSubresourceFilter::LoadPolicy load_policy) { 81 WebDocumentSubresourceFilter::LoadPolicy load_policy) {
82 Document* document = document_loader_->GetFrame() 82 Document* document = document_loader_->GetFrame()
(...skipping 17 matching lines...) Expand all
100 } 100 }
101 // fall through 101 // fall through
102 case WebDocumentSubresourceFilter::kWouldDisallow: 102 case WebDocumentSubresourceFilter::kWouldDisallow:
103 document_loader_->DidObserveLoadingBehavior( 103 document_loader_->DidObserveLoadingBehavior(
104 kWebLoadingBehaviorSubresourceFilterMatch); 104 kWebLoadingBehaviorSubresourceFilterMatch);
105 break; 105 break;
106 } 106 }
107 } 107 }
108 108
109 } // namespace blink 109 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/Timer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698