OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 11 matching lines...) Expand all Loading... |
22 #include <Security/Security.h> | 22 #include <Security/Security.h> |
23 #include "macconversion.h" | 23 #include "macconversion.h" |
24 #endif | 24 #endif |
25 | 25 |
26 #ifdef WEBRTC_IOS | 26 #ifdef WEBRTC_IOS |
27 #include <CFNetwork/CFNetwork.h> | 27 #include <CFNetwork/CFNetwork.h> |
28 #include "macconversion.h" | 28 #include "macconversion.h" |
29 #endif | 29 #endif |
30 | 30 |
31 #include <map> | 31 #include <map> |
| 32 #include <memory> |
32 | 33 |
33 #include "webrtc/base/arraysize.h" | 34 #include "webrtc/base/arraysize.h" |
34 #include "webrtc/base/fileutils.h" | 35 #include "webrtc/base/fileutils.h" |
35 #include "webrtc/base/httpcommon.h" | 36 #include "webrtc/base/httpcommon.h" |
36 #include "webrtc/base/httpcommon-inl.h" | 37 #include "webrtc/base/httpcommon-inl.h" |
37 #include "webrtc/base/pathutils.h" | 38 #include "webrtc/base/pathutils.h" |
38 #include "webrtc/base/stringutils.h" | 39 #include "webrtc/base/stringutils.h" |
39 | 40 |
40 #if defined(WEBRTC_WIN) | 41 #if defined(WEBRTC_WIN) |
41 #define _TRY_WINHTTP 1 | 42 #define _TRY_WINHTTP 1 |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 #if USE_FIREFOX_PROFILES_INI | 424 #if USE_FIREFOX_PROFILES_INI |
424 // [Profile0] | 425 // [Profile0] |
425 // Name=default | 426 // Name=default |
426 // IsRelative=1 | 427 // IsRelative=1 |
427 // Path=Profiles/2de53ejb.default | 428 // Path=Profiles/2de53ejb.default |
428 // Default=1 | 429 // Default=1 |
429 | 430 |
430 // Note: we are looking for the first entry with "Default=1", or the last | 431 // Note: we are looking for the first entry with "Default=1", or the last |
431 // entry in the file | 432 // entry in the file |
432 path.SetFilename("profiles.ini"); | 433 path.SetFilename("profiles.ini"); |
433 scoped_ptr<FileStream> fs(Filesystem::OpenFile(path, "r")); | 434 std::unique_ptr<FileStream> fs(Filesystem::OpenFile(path, "r")); |
434 if (!fs) { | 435 if (!fs) { |
435 return false; | 436 return false; |
436 } | 437 } |
437 Pathname candidate; | 438 Pathname candidate; |
438 bool relative = true; | 439 bool relative = true; |
439 std::string line; | 440 std::string line; |
440 while (fs->ReadLine(&line) == SR_SUCCESS) { | 441 while (fs->ReadLine(&line) == SR_SUCCESS) { |
441 if (line.length() == 0) { | 442 if (line.length() == 0) { |
442 continue; | 443 continue; |
443 } | 444 } |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 delete it; | 489 delete it; |
489 | 490 |
490 #endif // !USE_FIREFOX_PROFILES_INI | 491 #endif // !USE_FIREFOX_PROFILES_INI |
491 | 492 |
492 return true; | 493 return true; |
493 } | 494 } |
494 | 495 |
495 bool ReadFirefoxPrefs(const Pathname& filename, | 496 bool ReadFirefoxPrefs(const Pathname& filename, |
496 const char * prefix, | 497 const char * prefix, |
497 StringMap* settings) { | 498 StringMap* settings) { |
498 scoped_ptr<FileStream> fs(Filesystem::OpenFile(filename, "r")); | 499 std::unique_ptr<FileStream> fs(Filesystem::OpenFile(filename, "r")); |
499 if (!fs) { | 500 if (!fs) { |
500 LOG(LS_ERROR) << "Failed to open file: " << filename.pathname(); | 501 LOG(LS_ERROR) << "Failed to open file: " << filename.pathname(); |
501 return false; | 502 return false; |
502 } | 503 } |
503 | 504 |
504 std::string line; | 505 std::string line; |
505 while (fs->ReadLine(&line) == SR_SUCCESS) { | 506 while (fs->ReadLine(&line) == SR_SUCCESS) { |
506 size_t prefix_len = strlen(prefix); | 507 size_t prefix_len = strlen(prefix); |
507 | 508 |
508 // Skip blank lines and too long lines. | 509 // Skip blank lines and too long lines. |
(...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1291 if (!result) { | 1292 if (!result) { |
1292 // Either auto detection is not supported or we simply didn't | 1293 // Either auto detection is not supported or we simply didn't |
1293 // find any proxy, reset type. | 1294 // find any proxy, reset type. |
1294 proxy->type = rtc::PROXY_NONE; | 1295 proxy->type = rtc::PROXY_NONE; |
1295 } | 1296 } |
1296 } | 1297 } |
1297 return result; | 1298 return result; |
1298 } | 1299 } |
1299 | 1300 |
1300 } // namespace rtc | 1301 } // namespace rtc |
OLD | NEW |