OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/base_paths.h" | 5 #include "base/base_paths.h" |
6 | 6 |
7 #include <unistd.h> | 7 #include <unistd.h> |
8 | 8 |
9 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
10 #include "base/android/path_utils.h" | 10 #include "base/android/path_utils.h" |
(...skipping 19 matching lines...) Expand all Loading... | |
30 } | 30 } |
31 bin_dir[bin_dir_size] = 0; | 31 bin_dir[bin_dir_size] = 0; |
32 *result = FilePath(bin_dir); | 32 *result = FilePath(bin_dir); |
33 return true; | 33 return true; |
34 } | 34 } |
35 case base::FILE_MODULE: | 35 case base::FILE_MODULE: |
36 // dladdr didn't work in Android as only the file name was returned. | 36 // dladdr didn't work in Android as only the file name was returned. |
37 NOTIMPLEMENTED(); | 37 NOTIMPLEMENTED(); |
38 return false; | 38 return false; |
39 case base::DIR_MODULE: { | 39 case base::DIR_MODULE: { |
40 *result = FilePath(base::android::GetDataDirectory()).DirName() | 40 *result = FilePath(base::android::GetNativeLibraryDirectory()); |
Mark Mentovai
2012/07/02 18:10:16
LGTM
| |
41 .Append("lib"); | |
42 return true; | 41 return true; |
43 } | 42 } |
44 case base::DIR_SOURCE_ROOT: | 43 case base::DIR_SOURCE_ROOT: |
45 // This const is only used for tests. Files in this directory are pushed | 44 // This const is only used for tests. Files in this directory are pushed |
46 // to the device via test script. | 45 // to the device via test script. |
47 *result = FilePath(FILE_PATH_LITERAL("/data/local/tmp/")); | 46 *result = FilePath(FILE_PATH_LITERAL("/data/local/tmp/")); |
48 return true; | 47 return true; |
49 case base::DIR_CACHE: | 48 case base::DIR_CACHE: |
50 *result = FilePath(base::android::GetCacheDirectory()); | 49 *result = FilePath(base::android::GetCacheDirectory()); |
51 return true; | 50 return true; |
52 case base::DIR_ANDROID_APP_DATA: | 51 case base::DIR_ANDROID_APP_DATA: |
53 *result = FilePath(base::android::GetDataDirectory()); | 52 *result = FilePath(base::android::GetDataDirectory()); |
54 return true; | 53 return true; |
55 default: | 54 default: |
56 // Note: the path system expects this function to override the default | 55 // Note: the path system expects this function to override the default |
57 // behavior. So no need to log an error if we don't support a given | 56 // behavior. So no need to log an error if we don't support a given |
58 // path. The system will just use the default. | 57 // path. The system will just use the default. |
59 return false; | 58 return false; |
60 } | 59 } |
61 } | 60 } |
62 | 61 |
63 } // namespace base | 62 } // namespace base |
OLD | NEW |