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

Side by Side Diff: third_party/WebKit/Source/web/tests/sim/SimNetwork.cpp

Issue 2896443003: Replace remaining ASSERT with DCHECK/_EQ as appropriate (Closed)
Patch Set: actually fix WorkerBackingthread Created 3 years, 7 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 | « third_party/WebKit/Source/web/WebDevToolsAgentImpl.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "web/tests/sim/SimNetwork.h" 5 #include "web/tests/sim/SimNetwork.h"
6 6
7 #include "public/platform/Platform.h" 7 #include "public/platform/Platform.h"
8 #include "public/platform/WebURLError.h" 8 #include "public/platform/WebURLError.h"
9 #include "public/platform/WebURLLoader.h" 9 #include "public/platform/WebURLLoader.h"
10 #include "public/platform/WebURLLoaderClient.h" 10 #include "public/platform/WebURLLoaderClient.h"
11 #include "public/platform/WebURLLoaderMockFactory.h" 11 #include "public/platform/WebURLLoaderMockFactory.h"
12 #include "public/platform/WebURLResponse.h" 12 #include "public/platform/WebURLResponse.h"
13 #include "web/tests/sim/SimRequest.h" 13 #include "web/tests/sim/SimRequest.h"
14 14
15 namespace blink { 15 namespace blink {
16 16
17 static SimNetwork* g_network = nullptr; 17 static SimNetwork* g_network = nullptr;
18 18
19 SimNetwork::SimNetwork() : current_request_(nullptr) { 19 SimNetwork::SimNetwork() : current_request_(nullptr) {
20 Platform::Current()->GetURLLoaderMockFactory()->SetLoaderDelegate(this); 20 Platform::Current()->GetURLLoaderMockFactory()->SetLoaderDelegate(this);
21 ASSERT(!g_network); 21 DCHECK(!g_network);
22 g_network = this; 22 g_network = this;
23 } 23 }
24 24
25 SimNetwork::~SimNetwork() { 25 SimNetwork::~SimNetwork() {
26 Platform::Current()->GetURLLoaderMockFactory()->SetLoaderDelegate(nullptr); 26 Platform::Current()->GetURLLoaderMockFactory()->SetLoaderDelegate(nullptr);
27 Platform::Current() 27 Platform::Current()
28 ->GetURLLoaderMockFactory() 28 ->GetURLLoaderMockFactory()
29 ->UnregisterAllURLsAndClearMemoryCache(); 29 ->UnregisterAllURLsAndClearMemoryCache();
30 g_network = nullptr; 30 g_network = nullptr;
31 } 31 }
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 87
88 void SimNetwork::AddRequest(SimRequest& request) { 88 void SimNetwork::AddRequest(SimRequest& request) {
89 requests_.insert(request.Url(), &request); 89 requests_.insert(request.Url(), &request);
90 } 90 }
91 91
92 void SimNetwork::RemoveRequest(SimRequest& request) { 92 void SimNetwork::RemoveRequest(SimRequest& request) {
93 requests_.erase(request.Url()); 93 requests_.erase(request.Url());
94 } 94 }
95 95
96 } // namespace blink 96 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebDevToolsAgentImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698