OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/supervised_user/supervised_user_url_filter.h" | 5 #include "chrome/browser/supervised_user/supervised_user_url_filter.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <set> | 10 #include <set> |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 | 229 |
230 } // namespace | 230 } // namespace |
231 | 231 |
232 SupervisedUserURLFilter::SupervisedUserURLFilter() | 232 SupervisedUserURLFilter::SupervisedUserURLFilter() |
233 : default_behavior_(ALLOW), | 233 : default_behavior_(ALLOW), |
234 contents_(new Contents()), | 234 contents_(new Contents()), |
235 blacklist_(nullptr), | 235 blacklist_(nullptr), |
236 amp_cache_path_regex_(kAmpCachePathPattern), | 236 amp_cache_path_regex_(kAmpCachePathPattern), |
237 google_amp_viewer_path_regex_(kGoogleAmpViewerPathPattern), | 237 google_amp_viewer_path_regex_(kGoogleAmpViewerPathPattern), |
238 google_web_cache_query_regex_(kGoogleWebCacheQueryPattern), | 238 google_web_cache_query_regex_(kGoogleWebCacheQueryPattern), |
239 blocking_task_runner_( | 239 blocking_task_runner_(base::CreateTaskRunnerWithTraits( |
240 base::CreateTaskRunnerWithTraits( | 240 {base::MayBlock(), base::TaskPriority::BACKGROUND, |
241 base::TaskTraits() | 241 base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN})), |
242 .MayBlock() | |
243 .WithPriority(base::TaskPriority::BACKGROUND) | |
244 .WithShutdownBehavior( | |
245 base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN)) | |
246 .get()), | |
247 weak_ptr_factory_(this) { | 242 weak_ptr_factory_(this) { |
248 DCHECK(amp_cache_path_regex_.ok()); | 243 DCHECK(amp_cache_path_regex_.ok()); |
249 DCHECK(google_amp_viewer_path_regex_.ok()); | 244 DCHECK(google_amp_viewer_path_regex_.ok()); |
250 DCHECK(google_web_cache_query_regex_.ok()); | 245 DCHECK(google_web_cache_query_regex_.ok()); |
251 // Detach from the current thread so we can be constructed on a different | 246 // Detach from the current thread so we can be constructed on a different |
252 // thread than the one where we're used. | 247 // thread than the one where we're used. |
253 DetachFromThread(); | 248 DetachFromThread(); |
254 } | 249 } |
255 | 250 |
256 SupervisedUserURLFilter::~SupervisedUserURLFilter() {} | 251 SupervisedUserURLFilter::~SupervisedUserURLFilter() {} |
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
681 | 676 |
682 FilteringBehavior behavior = | 677 FilteringBehavior behavior = |
683 GetBehaviorFromSafeSearchClassification(classification); | 678 GetBehaviorFromSafeSearchClassification(classification); |
684 | 679 |
685 callback.Run(behavior, supervised_user_error_page::ASYNC_CHECKER, uncertain); | 680 callback.Run(behavior, supervised_user_error_page::ASYNC_CHECKER, uncertain); |
686 for (Observer& observer : observers_) { | 681 for (Observer& observer : observers_) { |
687 observer.OnURLChecked(url, behavior, | 682 observer.OnURLChecked(url, behavior, |
688 supervised_user_error_page::ASYNC_CHECKER, uncertain); | 683 supervised_user_error_page::ASYNC_CHECKER, uncertain); |
689 } | 684 } |
690 } | 685 } |
OLD | NEW |