| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/test/chromedriver/window_commands.h" | 5 #include "chrome/test/chromedriver/window_commands.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <list> | 9 #include <list> |
| 10 #include <string> | 10 #include <string> |
| 11 #include <utility> |
| 11 | 12 |
| 12 #include "base/callback.h" | 13 #include "base/callback.h" |
| 13 #include "base/strings/string_number_conversions.h" | 14 #include "base/strings/string_number_conversions.h" |
| 14 #include "base/strings/stringprintf.h" | 15 #include "base/strings/stringprintf.h" |
| 15 #include "base/threading/platform_thread.h" | 16 #include "base/threading/platform_thread.h" |
| 16 #include "base/time/time.h" | 17 #include "base/time/time.h" |
| 17 #include "base/values.h" | 18 #include "base/values.h" |
| 18 #include "chrome/test/chromedriver/basic_types.h" | 19 #include "chrome/test/chromedriver/basic_types.h" |
| 19 #include "chrome/test/chromedriver/chrome/automation_extension.h" | 20 #include "chrome/test/chromedriver/chrome/automation_extension.h" |
| 20 #include "chrome/test/chromedriver/chrome/browser_info.h" | 21 #include "chrome/test/chromedriver/chrome/browser_info.h" |
| (...skipping 875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 896 Timeout* timeout) { | 897 Timeout* timeout) { |
| 897 std::list<Cookie> cookies; | 898 std::list<Cookie> cookies; |
| 898 Status status = GetVisibleCookies(web_view, &cookies); | 899 Status status = GetVisibleCookies(web_view, &cookies); |
| 899 if (status.IsError()) | 900 if (status.IsError()) |
| 900 return status; | 901 return status; |
| 901 std::unique_ptr<base::ListValue> cookie_list(new base::ListValue()); | 902 std::unique_ptr<base::ListValue> cookie_list(new base::ListValue()); |
| 902 for (std::list<Cookie>::const_iterator it = cookies.begin(); | 903 for (std::list<Cookie>::const_iterator it = cookies.begin(); |
| 903 it != cookies.end(); ++it) { | 904 it != cookies.end(); ++it) { |
| 904 cookie_list->Append(CreateDictionaryFrom(*it)); | 905 cookie_list->Append(CreateDictionaryFrom(*it)); |
| 905 } | 906 } |
| 906 value->reset(cookie_list.release()); | 907 *value = std::move(cookie_list); |
| 907 return Status(kOk); | 908 return Status(kOk); |
| 908 } | 909 } |
| 909 | 910 |
| 910 Status ExecuteAddCookie(Session* session, | 911 Status ExecuteAddCookie(Session* session, |
| 911 WebView* web_view, | 912 WebView* web_view, |
| 912 const base::DictionaryValue& params, | 913 const base::DictionaryValue& params, |
| 913 std::unique_ptr<base::Value>* value, | 914 std::unique_ptr<base::Value>* value, |
| 914 Timeout* timeout) { | 915 Timeout* timeout) { |
| 915 const base::DictionaryValue* cookie; | 916 const base::DictionaryValue* cookie; |
| 916 if (!params.GetDictionary("cookie", &cookie)) | 917 if (!params.GetDictionary("cookie", &cookie)) |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1077 return status; | 1078 return status; |
| 1078 } | 1079 } |
| 1079 | 1080 |
| 1080 Status ExecuteTakeHeapSnapshot(Session* session, | 1081 Status ExecuteTakeHeapSnapshot(Session* session, |
| 1081 WebView* web_view, | 1082 WebView* web_view, |
| 1082 const base::DictionaryValue& params, | 1083 const base::DictionaryValue& params, |
| 1083 std::unique_ptr<base::Value>* value, | 1084 std::unique_ptr<base::Value>* value, |
| 1084 Timeout* timeout) { | 1085 Timeout* timeout) { |
| 1085 return web_view->TakeHeapSnapshot(value); | 1086 return web_view->TakeHeapSnapshot(value); |
| 1086 } | 1087 } |
| OLD | NEW |