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

Side by Side Diff: chrome/browser/chrome_to_mobile_service.cc

Issue 15987009: Update chrome/ to use WeakPtr<T>::get() instead of implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 | Annotate | Revision Log
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 "chrome/browser/chrome_to_mobile_service.h" 5 #include "chrome/browser/chrome_to_mobile_service.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/file_util.h" 9 #include "base/file_util.h"
10 #include "base/guid.h" 10 #include "base/guid.h"
(...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after
740 base::WeakPtr<Observer> observer; 740 base::WeakPtr<Observer> observer;
741 RequestObserverMap::iterator i = request_observer_map_.find(source); 741 RequestObserverMap::iterator i = request_observer_map_.find(source);
742 if (i != request_observer_map_.end()) { 742 if (i != request_observer_map_.end()) {
743 observer = i->second; 743 observer = i->second;
744 request_observer_map_.erase(i); 744 request_observer_map_.erase(i);
745 } 745 }
746 746
747 // Check if the observer is waiting on a second response (url or snapshot). 747 // Check if the observer is waiting on a second response (url or snapshot).
748 for (RequestObserverMap::iterator other = request_observer_map_.begin(); 748 for (RequestObserverMap::iterator other = request_observer_map_.begin();
749 observer.get() && (other != request_observer_map_.end()); ++other) { 749 observer.get() && (other != request_observer_map_.end()); ++other) {
750 if (other->second == observer) { 750 if (other->second.get() == observer.get()) {
751 // Delay reporting success until the second response is received. 751 // Delay reporting success until the second response is received.
752 if (success) 752 if (success)
753 return; 753 return;
754 754
755 // Report failure below and ignore the second response. 755 // Report failure below and ignore the second response.
756 request_observer_map_.erase(other); 756 request_observer_map_.erase(other);
757 break; 757 break;
758 } 758 }
759 } 759 }
760 760
761 if (observer.get()) 761 if (observer.get())
762 observer->OnSendComplete(success); 762 observer->OnSendComplete(success);
763 } 763 }
OLDNEW
« no previous file with comments | « chrome/browser/automation/testing_automation_provider.cc ('k') | chrome/browser/download/download_request_infobar_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698