| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |