OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 <sstream> | 5 #include <sstream> |
6 | 6 |
7 #include "chrome/test/automation/automation_proxy.h" | 7 #include "chrome/test/automation/automation_proxy.h" |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 | 395 |
396 if (!SendWithTimeout(new AutomationMsg_LastActiveBrowserWindow( | 396 if (!SendWithTimeout(new AutomationMsg_LastActiveBrowserWindow( |
397 0, &handle), command_execution_timeout_ms(), NULL)) { | 397 0, &handle), command_execution_timeout_ms(), NULL)) { |
398 DLOG(ERROR) << "GetLastActiveBrowserWindow did not complete in a timely fash
ion"; | 398 DLOG(ERROR) << "GetLastActiveBrowserWindow did not complete in a timely fash
ion"; |
399 return NULL; | 399 return NULL; |
400 } | 400 } |
401 | 401 |
402 return new BrowserProxy(this, tracker_.get(), handle); | 402 return new BrowserProxy(this, tracker_.get(), handle); |
403 } | 403 } |
404 | 404 |
| 405 #if defined(OS_POSIX) |
| 406 base::file_handle_mapping_vector AutomationProxy::fds_to_map() const { |
| 407 base::file_handle_mapping_vector map; |
| 408 int src_fd = -1, dest_fd = -1; |
| 409 channel_->GetClientFileDescriptorMapping(&src_fd, &dest_fd); |
| 410 if (src_fd > -1) |
| 411 map.push_back(std::make_pair(src_fd, dest_fd)); |
| 412 return map; |
| 413 } |
| 414 #endif // defined(OS_POSIX) |
| 415 |
405 bool AutomationProxy::Send(IPC::Message* message) { | 416 bool AutomationProxy::Send(IPC::Message* message) { |
406 return SendWithTimeout(message, base::kNoTimeout, NULL); | 417 return SendWithTimeout(message, base::kNoTimeout, NULL); |
407 } | 418 } |
408 | 419 |
409 bool AutomationProxy::SendWithTimeout(IPC::Message* message, int timeout, | 420 bool AutomationProxy::SendWithTimeout(IPC::Message* message, int timeout, |
410 bool* is_timeout) { | 421 bool* is_timeout) { |
411 if (is_timeout) | 422 if (is_timeout) |
412 *is_timeout = false; | 423 *is_timeout = false; |
413 | 424 |
414 if (channel_.get()) { | 425 if (channel_.get()) { |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
451 &handle)); | 462 &handle)); |
452 if (!succeeded) { | 463 if (!succeeded) { |
453 return NULL; | 464 return NULL; |
454 } | 465 } |
455 | 466 |
456 DCHECK(IsWindow(*external_tab_container)); | 467 DCHECK(IsWindow(*external_tab_container)); |
457 | 468 |
458 return new TabProxy(this, tracker_.get(), handle); | 469 return new TabProxy(this, tracker_.get(), handle); |
459 } | 470 } |
460 #endif // defined(OS_WIN) | 471 #endif // defined(OS_WIN) |
OLD | NEW |