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

Side by Side Diff: talk/app/webrtc/fakeportallocatorfactory.h

Issue 1414313003: Reland of Adding the ability to change ICE servers through SetConfiguration. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Adding "override" to applicable methods to fix compile warning. Created 5 years, 1 month 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 | « no previous file | talk/app/webrtc/peerconnection.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * libjingle 2 * libjingle
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright notice, 8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 rtc::RefCountedObject<FakePortAllocatorFactory>* allocator = 42 rtc::RefCountedObject<FakePortAllocatorFactory>* allocator =
43 new rtc::RefCountedObject<FakePortAllocatorFactory>(); 43 new rtc::RefCountedObject<FakePortAllocatorFactory>();
44 return allocator; 44 return allocator;
45 } 45 }
46 46
47 virtual cricket::PortAllocator* CreatePortAllocator( 47 virtual cricket::PortAllocator* CreatePortAllocator(
48 const std::vector<StunConfiguration>& stun_configurations, 48 const std::vector<StunConfiguration>& stun_configurations,
49 const std::vector<TurnConfiguration>& turn_configurations) { 49 const std::vector<TurnConfiguration>& turn_configurations) {
50 stun_configs_ = stun_configurations; 50 stun_configs_ = stun_configurations;
51 turn_configs_ = turn_configurations; 51 turn_configs_ = turn_configurations;
52 return new cricket::FakePortAllocator(rtc::Thread::Current(), NULL); 52 last_created_allocator_ =
53 new cricket::FakePortAllocator(rtc::Thread::Current(), nullptr);
54 return last_created_allocator_;
53 } 55 }
54 56
55 const std::vector<StunConfiguration>& stun_configs() const { 57 const std::vector<StunConfiguration>& stun_configs() const {
56 return stun_configs_; 58 return stun_configs_;
57 } 59 }
58 60
59 const std::vector<TurnConfiguration>& turn_configs() const { 61 const std::vector<TurnConfiguration>& turn_configs() const {
60 return turn_configs_; 62 return turn_configs_;
61 } 63 }
62 64
63 void SetNetworkIgnoreMask(int network_ignore_mask) {} 65 void SetNetworkIgnoreMask(int network_ignore_mask) {}
64 66
67 // Up to caller to ensure this isn't called after the allocator has been
68 // destroyed.
69 cricket::FakePortAllocator* last_created_allocator() {
70 return last_created_allocator_;
71 }
72
65 protected: 73 protected:
66 FakePortAllocatorFactory() {} 74 FakePortAllocatorFactory() {}
67 ~FakePortAllocatorFactory() {} 75 ~FakePortAllocatorFactory() {}
68 76
69 private: 77 private:
70 std::vector<PortAllocatorFactoryInterface::StunConfiguration> stun_configs_; 78 std::vector<PortAllocatorFactoryInterface::StunConfiguration> stun_configs_;
71 std::vector<PortAllocatorFactoryInterface::TurnConfiguration> turn_configs_; 79 std::vector<PortAllocatorFactoryInterface::TurnConfiguration> turn_configs_;
80 cricket::FakePortAllocator* last_created_allocator_ = nullptr;
72 }; 81 };
73 82
74 } // namespace webrtc 83 } // namespace webrtc
75 84
76 #endif // TALK_APP_WEBRTC_FAKEPORTALLOCATORFACTORY_H_ 85 #endif // TALK_APP_WEBRTC_FAKEPORTALLOCATORFACTORY_H_
OLDNEW
« no previous file with comments | « no previous file | talk/app/webrtc/peerconnection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698