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

Issue 3764012: cashew: support "usage requests allowed OTA only" policy (Closed)

Created:
10 years, 2 months ago by Vince Laviano
Modified:
9 years ago
CC:
chromium-os-reviews_chromium.org, Vince Laviano
Visibility:
Public.

Description

cashew: support "usage requests allowed OTA only" policy BUG=chromium-os:7769 TEST=Manual: connect to 3G and observe logs while unplugging/plugging ethernet Change-Id: I70498abe97b1eb85e3bd6cc8ae20ecda6f7650b9 Committed: http://chrome-svn/viewvc/chromeos?view=rev&revision=ab45a69

Patch Set 1 #

Total comments: 11

Patch Set 2 : ers review comments #

Total comments: 6

Patch Set 3 : jglasgow review comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+529 lines, -118 lines) Patch
M src/data_plan_provider.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/default_policy.h View 1 chunk +2 lines, -0 lines 0 comments Download
M src/default_policy.cc View 1 chunk +4 lines, -0 lines 0 comments Download
M src/device.cc View 3 chunks +11 lines, -11 lines 0 comments Download
M src/policy.h View 1 chunk +3 lines, -0 lines 0 comments Download
M src/service.h View 5 chunks +49 lines, -3 lines 0 comments Download
M src/service.cc View 1 2 13 chunks +186 lines, -62 lines 0 comments Download
M src/service_manager.h View 4 chunks +63 lines, -3 lines 0 comments Download
M src/service_manager.cc View 6 chunks +210 lines, -38 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
Vince Laviano
This CL extends cashew to support a policy of only sending usage requests over the ...
10 years, 2 months ago (2010-10-19 03:31:04 UTC) #1
Eric Shienbrood
Just one other question: What do you have against std::string::operator== ? http://codereview.chromium.org/3764012/diff/1/5 File src/service.cc (right): ...
10 years, 2 months ago (2010-10-19 20:14:16 UTC) #2
Vince Laviano
http://codereview.chromium.org/3764012/diff/1/5 File src/service.cc (right): http://codereview.chromium.org/3764012/diff/1/5#newcode101 src/service.cc:101: if (type.compare(kFlimflamServiceTypeEthernet) == 0) { On 2010/10/19 20:14:16, Eric ...
10 years, 2 months ago (2010-10-19 21:52:08 UTC) #3
Jason Glasgow
http://codereview.chromium.org/3764012/diff/6001/7006 File src/service.cc (right): http://codereview.chromium.org/3764012/diff/6001/7006#newcode338 src/service.cc:338: // we just stopped being the default service Why ...
10 years, 2 months ago (2010-10-19 22:56:49 UTC) #4
Vince Laviano
http://codereview.chromium.org/3764012/diff/6001/7006 File src/service.cc (right): http://codereview.chromium.org/3764012/diff/6001/7006#newcode338 src/service.cc:338: // we just stopped being the default service On ...
10 years, 2 months ago (2010-10-19 23:32:15 UTC) #5
Jason Glasgow
LGTM
10 years, 2 months ago (2010-10-19 23:36:00 UTC) #6
Eric Shienbrood
10 years, 2 months ago (2010-10-20 02:13:53 UTC) #7
LGTM

http://codereview.chromium.org/3764012/diff/1/5
File src/service.cc (right):

http://codereview.chromium.org/3764012/diff/1/5#newcode101
src/service.cc:101: if (type.compare(kFlimflamServiceTypeEthernet) == 0) {
On 2010/10/19 21:52:09, Vince Laviano wrote:
> On 2010/10/19 20:14:16, Eric Shienbrood wrote:
> > Why do this rather than just doing the simpler "if (type ==
> > kFlimflamServiceTypeEthernet)"?
> 
> Fixed. (Here and elsewhere in cashew)
> 
> The answer is that I started out using std::string::compare and then shifted
> over to using std::string::operator== in newer code. However, this is older
code
> that is being moved from being private to being public.
> 
> What do I have against std::string::operator==?
> 
> Nothing, but I'm not a big fan of operator overloading in general and so I
tend
> towards the alternatives when they are available.
> 
> I find it disconcerting that a + b can do just about anything (database
lookups,
> send people email, read the contents of the Library of Congress and become
> self-aware). It's easy for someone unfamiliar with a code base and with
> preconceptions about what a particular operator does to read past this and
have
> it totally escape them. They are more likely to notice and investigate an
> invocation of a.Add(b) to ensure that they understand what it's doing.

I agree, and that's why our style guide prohibits operator overloading in
classes we define. But like many features in C++, if you use it in a suitably
constrained way, it can enhance rather than detract from code comprehensibility.
And string comparison is probably the canonical example of an appropriate use of
operator overloading.

Powered by Google App Engine
This is Rietveld 408576698