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

Side by Side Diff: content/public/test/browser_test_utils.cc

Issue 504273002: Remove implicit conversions from scoped_refptr to T* in content/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/public/test/browser_test_utils.h" 5 #include "content/public/test/browser_test_utils.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/json/json_reader.h" 9 #include "base/json/json_reader.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after
711 NotificationService::AllSources()); 711 NotificationService::AllSources());
712 } 712 }
713 713
714 DOMMessageQueue::~DOMMessageQueue() {} 714 DOMMessageQueue::~DOMMessageQueue() {}
715 715
716 void DOMMessageQueue::Observe(int type, 716 void DOMMessageQueue::Observe(int type,
717 const NotificationSource& source, 717 const NotificationSource& source,
718 const NotificationDetails& details) { 718 const NotificationDetails& details) {
719 Details<DomOperationNotificationDetails> dom_op_details(details); 719 Details<DomOperationNotificationDetails> dom_op_details(details);
720 message_queue_.push(dom_op_details->json); 720 message_queue_.push(dom_op_details->json);
721 if (message_loop_runner_) 721 if (message_loop_runner_.get())
722 message_loop_runner_->Quit(); 722 message_loop_runner_->Quit();
723 } 723 }
724 724
725 void DOMMessageQueue::ClearQueue() { 725 void DOMMessageQueue::ClearQueue() {
726 message_queue_ = std::queue<std::string>(); 726 message_queue_ = std::queue<std::string>();
727 } 727 }
728 728
729 bool DOMMessageQueue::WaitForMessage(std::string* message) { 729 bool DOMMessageQueue::WaitForMessage(std::string* message) {
730 DCHECK(message); 730 DCHECK(message);
731 if (message_queue_.empty()) { 731 if (message_queue_.empty()) {
732 // This will be quit when a new message comes in. 732 // This will be quit when a new message comes in.
733 message_loop_runner_ = new MessageLoopRunner; 733 message_loop_runner_ = new MessageLoopRunner;
734 message_loop_runner_->Run(); 734 message_loop_runner_->Run();
735 } 735 }
736 // The queue should not be empty, unless we were quit because of a timeout. 736 // The queue should not be empty, unless we were quit because of a timeout.
737 if (message_queue_.empty()) 737 if (message_queue_.empty())
738 return false; 738 return false;
739 *message = message_queue_.front(); 739 *message = message_queue_.front();
740 message_queue_.pop(); 740 message_queue_.pop();
741 return true; 741 return true;
742 } 742 }
743 743
744 } // namespace content 744 } // namespace content
OLDNEW
« no previous file with comments | « content/public/renderer/video_encode_accelerator.cc ('k') | content/public/test/mock_blob_url_request_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698