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

Side by Side Diff: net/proxy/proxy_resolver_script_data.cc

Issue 9078003: Poll PAC scripts for content changes. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: fix dcheck reached on bot Created 8 years, 11 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 | « net/proxy/proxy_resolver_script_data.h ('k') | net/proxy/proxy_service.h » ('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 (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "net/proxy/proxy_resolver_script_data.h" 5 #include "net/proxy/proxy_resolver_script_data.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 9
10 namespace net { 10 namespace net {
(...skipping 27 matching lines...) Expand all
38 const string16& ProxyResolverScriptData::utf16() const { 38 const string16& ProxyResolverScriptData::utf16() const {
39 DCHECK_EQ(TYPE_SCRIPT_CONTENTS, type_); 39 DCHECK_EQ(TYPE_SCRIPT_CONTENTS, type_);
40 return utf16_; 40 return utf16_;
41 } 41 }
42 42
43 const GURL& ProxyResolverScriptData::url() const { 43 const GURL& ProxyResolverScriptData::url() const {
44 DCHECK_EQ(TYPE_SCRIPT_URL, type_); 44 DCHECK_EQ(TYPE_SCRIPT_URL, type_);
45 return url_; 45 return url_;
46 } 46 }
47 47
48 bool ProxyResolverScriptData::Equals(
49 const ProxyResolverScriptData* other) const {
50 if (type() != other->type())
51 return false;
52
53 switch (type()) {
54 case TYPE_SCRIPT_CONTENTS:
55 return utf16() == other->utf16();
56 case TYPE_SCRIPT_URL:
57 return url() == other->url();
58 case TYPE_AUTO_DETECT:
59 return true;
60 }
61
62 return false; // Shouldn't be reached.
63 }
64
48 ProxyResolverScriptData::ProxyResolverScriptData(Type type, 65 ProxyResolverScriptData::ProxyResolverScriptData(Type type,
49 const GURL& url, 66 const GURL& url,
50 const string16& utf16) 67 const string16& utf16)
51 : type_(type), 68 : type_(type),
52 url_(url), 69 url_(url),
53 utf16_(utf16) { 70 utf16_(utf16) {
54 } 71 }
55 72
56 ProxyResolverScriptData::~ProxyResolverScriptData() {} 73 ProxyResolverScriptData::~ProxyResolverScriptData() {}
57 74
58 } // namespace net 75 } // namespace net
OLDNEW
« no previous file with comments | « net/proxy/proxy_resolver_script_data.h ('k') | net/proxy/proxy_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698