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

Side by Side Diff: ipc/attachment_broker.cc

Issue 1554443003: Stop linking in the old Mojo EDK. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge and fix new flaky test Created 4 years, 11 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
« no previous file with comments | « ipc/attachment_broker.h ('k') | ipc/attachment_broker_mac_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "ipc/attachment_broker.h" 5 #include "ipc/attachment_broker.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 *out_attachment = *it; 42 *out_attachment = *it;
43 attachments_.erase(it); 43 attachments_.erase(it);
44 return true; 44 return true;
45 } 45 }
46 } 46 }
47 return false; 47 return false;
48 } 48 }
49 49
50 void AttachmentBroker::AddObserver( 50 void AttachmentBroker::AddObserver(
51 AttachmentBroker::Observer* observer, 51 AttachmentBroker::Observer* observer,
52 const scoped_refptr<base::SequencedTaskRunner>& runner) { 52 const scoped_refptr<base::TaskRunner>& runner) {
53 base::AutoLock auto_lock(*get_lock()); 53 base::AutoLock auto_lock(*get_lock());
54 auto it = std::find_if(observers_.begin(), observers_.end(), 54 auto it = std::find_if(observers_.begin(), observers_.end(),
55 [observer](const ObserverInfo& info) { 55 [observer](const ObserverInfo& info) {
56 return info.observer == observer; 56 return info.observer == observer;
57 }); 57 });
58 if (it == observers_.end()) { 58 if (it == observers_.end()) {
59 ObserverInfo info; 59 ObserverInfo info;
60 info.observer = observer; 60 info.observer = observer;
61 info.runner = runner; 61 info.runner = runner;
62 info.unique_id = ++last_unique_id_; 62 info.unique_id = ++last_unique_id_;
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 observer = it->observer; 123 observer = it->observer;
124 } 124 }
125 125
126 observer->ReceivedBrokerableAttachmentWithId(id); 126 observer->ReceivedBrokerableAttachmentWithId(id);
127 } 127 }
128 128
129 AttachmentBroker::ObserverInfo::ObserverInfo() {} 129 AttachmentBroker::ObserverInfo::ObserverInfo() {}
130 AttachmentBroker::ObserverInfo::~ObserverInfo() {} 130 AttachmentBroker::ObserverInfo::~ObserverInfo() {}
131 131
132 } // namespace IPC 132 } // namespace IPC
OLDNEW
« no previous file with comments | « ipc/attachment_broker.h ('k') | ipc/attachment_broker_mac_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698