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_provider_observers.h" | 5 #include "chrome/browser/automation/automation_provider_observers.h" |
6 | 6 |
7 #include <deque> | 7 #include <deque> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
620 NOTREACHED(); | 620 NOTREACHED(); |
621 } | 621 } |
622 // There may be a reply message waiting for this event, so check. | 622 // There may be a reply message waiting for this event, so check. |
623 MaybeSendResult(); | 623 MaybeSendResult(); |
624 } | 624 } |
625 | 625 |
626 void ExtensionTestResultNotificationObserver::MaybeSendResult() { | 626 void ExtensionTestResultNotificationObserver::MaybeSendResult() { |
627 if (!automation_) | 627 if (!automation_) |
628 return; | 628 return; |
629 | 629 |
630 if (results_.size() > 0) { | 630 if (!results_.empty()) { |
631 // This release method should return the automation's current | 631 // This release method should return the automation's current |
632 // reply message, or NULL if there is no current one. If it is not | 632 // reply message, or NULL if there is no current one. If it is not |
633 // NULL, we are stating that we will handle this reply message. | 633 // NULL, we are stating that we will handle this reply message. |
634 IPC::Message* reply_message = automation_->reply_message_release(); | 634 IPC::Message* reply_message = automation_->reply_message_release(); |
635 // Send the result back if we have a reply message. | 635 // Send the result back if we have a reply message. |
636 if (reply_message) { | 636 if (reply_message) { |
637 AutomationMsg_WaitForExtensionTestResult::WriteReplyParams( | 637 AutomationMsg_WaitForExtensionTestResult::WriteReplyParams( |
638 reply_message, results_.front(), messages_.front()); | 638 reply_message, results_.front(), messages_.front()); |
639 results_.pop_front(); | 639 results_.pop_front(); |
640 messages_.pop_front(); | 640 messages_.pop_front(); |
(...skipping 1438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2079 NewRunnableMethod( | 2079 NewRunnableMethod( |
2080 this, | 2080 this, |
2081 &WaitForProcessLauncherThreadToGoIdleObserver::RunOnUIThread)); | 2081 &WaitForProcessLauncherThreadToGoIdleObserver::RunOnUIThread)); |
2082 } | 2082 } |
2083 | 2083 |
2084 void WaitForProcessLauncherThreadToGoIdleObserver::RunOnUIThread() { | 2084 void WaitForProcessLauncherThreadToGoIdleObserver::RunOnUIThread() { |
2085 if (automation_) | 2085 if (automation_) |
2086 automation_->Send(reply_message_.release()); | 2086 automation_->Send(reply_message_.release()); |
2087 Release(); | 2087 Release(); |
2088 } | 2088 } |
OLD | NEW |