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

Unified Diff: ios/web/public/test/http_server.mm

Issue 2794933002: Relax DCHECKs regarding Threads and RefCounts in iOS' HttpServer. (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/public/test/http_server.mm
diff --git a/ios/web/public/test/http_server.mm b/ios/web/public/test/http_server.mm
index c5217160571ec5b3fd3ce695aa0c8500d613e35a..c20f7d1dd586bcc90d78a5ecd3051f3a2887e647 100644
--- a/ios/web/public/test/http_server.mm
+++ b/ios/web/public/test/http_server.mm
@@ -80,6 +80,12 @@ void HttpServer::InitHttpServer() {
// Note: This block is called from an arbitrary GCD thread.
id process_request =
^GCDWebServerResponse*(GCDWebServerDataRequest* request) {
+
+ // TODO(crbug.com/707764): Verify that the relaxation of the cross-thread
sdefresne 2017/04/03 14:18:16 I think that a correct fix would be to: 1. split
+ // access restriction is correct.
+ base::ScopedAllowCrossThreadRefCountAccess
+ allow_cross_thread_ref_count_access;
+
ResponseProvider::Request provider_request =
ResponseProviderRequestFromGCDWebServerRequest(request);
scoped_refptr<RefCountedResponseProviderWrapper>
@@ -225,6 +231,10 @@ void HttpServer::RemoveResponseProvider(ResponseProvider* response_provider) {
void HttpServer::RemoveAllResponseProviders() {
DCHECK([NSThread isMainThread]);
+ // TODO(crbug.com/707764): Verify that the relaxation of the cross-thread
sdefresne 2017/04/03 14:18:16 I think you can change this to: // Relax the cr
+ // access restriction is correct.
+ base::ScopedAllowCrossThreadRefCountAccess
+ allow_cross_thread_ref_count_access;
base::AutoLock autolock(provider_list_lock_);
providers_.clear();
}
« 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