blob: aa656c7b8200fcb979d998b3a90cfe4ee889be92 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/devtools/devtools_network_conditions.h"
#include "url/gurl.h"
DevToolsNetworkConditions::DevToolsNetworkConditions(
const std::vector<std::string>& domains)
: domains_(domains){
}
DevToolsNetworkConditions::~DevToolsNetworkConditions() {
}
bool DevToolsNetworkConditions::HasMatchingDomain(const GURL& url) const {
Domains::const_iterator domain = domains_.begin();
if (domain == domains_.end())
return true;
for (; domain != domains_.end(); ++domain) {
if (url.DomainIs(domain->data()))
return true;
}
return false;
}
bool DevToolsNetworkConditions::IsOffline() const {
return true;
}
|