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

Side by Side Diff: chrome/browser/automation/automation_util.cc

Issue 6901084: Use new APIs in base/values.h: Value::GetAsNumber and DictionaryValue::GetNumber. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase, 2010->2011 Created 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_history_api.cc » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/browser/automation/automation_util.h" 5 #include "chrome/browser/automation/automation_util.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/synchronization/waitable_event.h" 10 #include "base/synchronization/waitable_event.h"
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 if (cookie_dict->HasKey("mac_key")) 296 if (cookie_dict->HasKey("mac_key"))
297 cookie_dict->GetString("mac_key", &mac_key); 297 cookie_dict->GetString("mac_key", &mac_key);
298 if (cookie_dict->HasKey("mac_algorithm")) 298 if (cookie_dict->HasKey("mac_algorithm"))
299 cookie_dict->GetString("mac_algorithm", &mac_algorithm); 299 cookie_dict->GetString("mac_algorithm", &mac_algorithm);
300 if (cookie_dict->HasKey("secure") && 300 if (cookie_dict->HasKey("secure") &&
301 !cookie_dict->GetBoolean("secure", &secure)) { 301 !cookie_dict->GetBoolean("secure", &secure)) {
302 reply.SendError("optional 'secure' invalid"); 302 reply.SendError("optional 'secure' invalid");
303 return; 303 return;
304 } 304 }
305 if (cookie_dict->HasKey("expiry")) { 305 if (cookie_dict->HasKey("expiry")) {
306 int expiry_int; 306 if (!cookie_dict->GetDouble("expiry", &expiry)) {
307 if (cookie_dict->GetInteger("expiry", &expiry_int)) {
308 expiry = expiry_int;
309 } else if (!cookie_dict->GetDouble("expiry", &expiry)) {
310 reply.SendError("optional 'expiry' invalid"); 307 reply.SendError("optional 'expiry' invalid");
311 return; 308 return;
312 } 309 }
313 } 310 }
314 if (cookie_dict->HasKey("http_only") && 311 if (cookie_dict->HasKey("http_only") &&
315 !cookie_dict->GetBoolean("http_only", &http_only)) { 312 !cookie_dict->GetBoolean("http_only", &http_only)) {
316 reply.SendError("optional 'http_only' invalid"); 313 reply.SendError("optional 'http_only' invalid");
317 return; 314 return;
318 } 315 }
319 316
(...skipping 24 matching lines...) Expand all
344 event.Wait(); 341 event.Wait();
345 342
346 if (!success) { 343 if (!success) {
347 reply.SendError("Could not set the cookie"); 344 reply.SendError("Could not set the cookie");
348 return; 345 return;
349 } 346 }
350 reply.SendSuccess(NULL); 347 reply.SendSuccess(NULL);
351 } 348 }
352 349
353 } // namespace automation_util 350 } // namespace automation_util
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_history_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698