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

Unified Diff: webrtc/modules/utility/source/helpers_ios.mm

Issue 1206783002: Cleanup of iOS AudioDevice implementation (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Feedback from tkchin@ Created 5 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/utility/source/helpers_ios.mm
diff --git a/webrtc/test/testsupport/iosfileutils.mm b/webrtc/modules/utility/source/helpers_ios.mm
similarity index 54%
copy from webrtc/test/testsupport/iosfileutils.mm
copy to webrtc/modules/utility/source/helpers_ios.mm
index f3615ed6814b41a696fd04da166a96a59237c2a9..d7a991c76acf9ad4dc200409bfeb9ebf8222d45a 100644
--- a/webrtc/test/testsupport/iosfileutils.mm
+++ b/webrtc/modules/utility/source/helpers_ios.mm
@@ -1,5 +1,5 @@
/*
- * Copyright 2015 The WebRTC Project Authors. All rights reserved.
+ * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
@@ -10,18 +10,16 @@
#if defined(WEBRTC_IOS)
-#if !defined(__has_feature) || !__has_feature(objc_arc)
-#error "This file requires ARC support."
-#endif
-
+#import <AVFoundation/AVFoundation.h>
tkchin_webrtc 2015/07/08 19:41:14 Don't think you need AVFoundation here anymore.
henrika_webrtc 2015/07/09 12:58:02 Done.
#import <Foundation/Foundation.h>
-#include <string.h>
+#include <pthread.h>
tkchin_webrtc 2015/07/08 19:41:14 ditto no pthread bits here
henrika_webrtc 2015/07/09 12:58:02 Done.
#include "webrtc/base/checks.h"
-#include "webrtc/typedefs.h"
+#include "webrtc/base/logging.h"
+#include "webrtc/modules/utility/interface/helpers_ios.h"
namespace webrtc {
-namespace test {
+namespace ios {
// TODO(henrika): move to shared location.
// See https://code.google.com/p/webrtc/issues/detail?id=4773 for details.
@@ -39,22 +37,23 @@ std::string StdStringFromNSString(NSString* nsString) {
[charData length]);
}
-// For iOS, resource files are added to the application bundle in the root
-// and not in separate folders as is the case for other platforms. This method
-// therefore removes any prepended folders and uses only the actual file name.
-std::string IOSResourcePath(std::string name, std::string extension) {
- @autoreleasepool {
- NSString* path = NSStringFromStdString(name);
- NSString* fileName = path.lastPathComponent;
- NSString* fileType = NSStringFromStdString(extension);
- // Get full pathname for the resource identified by the name and extension.
- NSString* pathString = [[NSBundle mainBundle] pathForResource:fileName
- ofType:fileType];
- return StdStringFromNSString(pathString);
+bool CheckAndLogError(BOOL success, NSError* error) {
+ if (!success) {
+ NSString* msg =
+ [NSString stringWithFormat:@"Error: %ld, %@", (long)error.code,
+ error.localizedDescription];
+ LOG(LS_ERROR) << StdStringFromNSString(msg);
+ return false;
}
+ return true;
+}
+
+std::string GetCurrentThreadDescription() {
+ NSString* name = [NSString stringWithFormat:@"%@", [NSThread currentThread]];
+ return StdStringFromNSString(name);
}
-} // namespace test
+} // namespace ios
} // namespace webrtc
#endif // defined(WEBRTC_IOS)

Powered by Google App Engine
This is Rietveld 408576698