diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-07 19:20:34 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-07 19:20:34 +0000 |
commit | 2dec8ec385e65c80571c5723dc572264a934b7c9 (patch) | |
tree | f30b887d1fa77930cc7b9bbc1a0c6a13b7437255 /content/browser | |
parent | 60e28106a326d40d9ba117d18be0abcd954c8832 (diff) | |
download | chromium_src-2dec8ec385e65c80571c5723dc572264a934b7c9.zip chromium_src-2dec8ec385e65c80571c5723dc572264a934b7c9.tar.gz chromium_src-2dec8ec385e65c80571c5723dc572264a934b7c9.tar.bz2 |
Use base namespace for FilePath in content/browser
Review URL: https://codereview.chromium.org/12213066
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@181349 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser')
160 files changed, 933 insertions, 866 deletions
diff --git a/content/browser/accessibility/browser_accessibility_state_impl_win.cc b/content/browser/accessibility/browser_accessibility_state_impl_win.cc index f65e0ef..77a6332 100644 --- a/content/browser/accessibility/browser_accessibility_state_impl_win.cc +++ b/content/browser/accessibility/browser_accessibility_state_impl_win.cc @@ -57,7 +57,7 @@ void BrowserAccessibilityStateImpl::UpdatePlatformSpecificHistograms() { for (size_t i = 0; i < module_count; i++) { TCHAR filename[MAX_PATH]; GetModuleFileName(modules[i], filename, sizeof(filename)); - string16 module_name(FilePath(filename).BaseName().value()); + string16 module_name(base::FilePath(filename).BaseName().value()); if (LowerCaseEqualsASCII(module_name, "fsdomsrv.dll")) jaws = true; if (LowerCaseEqualsASCII(module_name, "vbufbackend_gecko_ia2.dll")) diff --git a/content/browser/accessibility/dump_accessibility_tree_browsertest.cc b/content/browser/accessibility/dump_accessibility_tree_browsertest.cc index 170f6a2..9b47dfb 100644 --- a/content/browser/accessibility/dump_accessibility_tree_browsertest.cc +++ b/content/browser/accessibility/dump_accessibility_tree_browsertest.cc @@ -108,12 +108,13 @@ class DumpAccessibilityTreeTest : public ContentBrowserTest { } } - void RunTest(const FilePath::CharType* file_path); + void RunTest(const base::FilePath::CharType* file_path); DumpAccessibilityTreeHelper helper_; }; -void DumpAccessibilityTreeTest::RunTest(const FilePath::CharType* file_path) { +void DumpAccessibilityTreeTest::RunTest( + const base::FilePath::CharType* file_path) { NavigateToURL(shell(), GURL("about:blank")); RenderWidgetHostViewPort* host_view = static_cast<RenderWidgetHostViewPort*>( shell()->web_contents()->GetRenderWidgetHostView()); @@ -124,13 +125,14 @@ void DumpAccessibilityTreeTest::RunTest(const FilePath::CharType* file_path) { view_host->SetAccessibilityMode(AccessibilityModeComplete); // Setup test paths. - FilePath dir_test_data; + base::FilePath dir_test_data; ASSERT_TRUE(PathService::Get(DIR_TEST_DATA, &dir_test_data)); - FilePath test_path(dir_test_data.Append(FILE_PATH_LITERAL("accessibility"))); + base::FilePath test_path( + dir_test_data.Append(FILE_PATH_LITERAL("accessibility"))); ASSERT_TRUE(file_util::PathExists(test_path)) << test_path.LossyDisplayName(); - FilePath html_file = test_path.Append(FilePath(file_path)); + base::FilePath html_file = test_path.Append(base::FilePath(file_path)); // Output the test path to help anyone who encounters a failure and needs // to know where to look. printf("Testing: %s\n", html_file.MaybeAsASCII().c_str()); @@ -146,8 +148,8 @@ void DumpAccessibilityTreeTest::RunTest(const FilePath::CharType* file_path) { // Read the expected file. std::string expected_contents_raw; - FilePath expected_file = - FilePath(html_file.RemoveExtension().value() + + base::FilePath expected_file = + base::FilePath(html_file.RemoveExtension().value() + helper_.GetExpectedFileSuffix()); file_util::ReadFileToString( expected_file, @@ -215,9 +217,9 @@ void DumpAccessibilityTreeTest::RunTest(const FilePath::CharType* file_path) { } if (!file_util::PathExists(expected_file)) { - FilePath actual_file = - FilePath(html_file.RemoveExtension().value() + - helper_.GetActualFileSuffix()); + base::FilePath actual_file = + base::FilePath(html_file.RemoveExtension().value() + + helper_.GetActualFileSuffix()); EXPECT_TRUE(file_util::WriteFile( actual_file, actual_contents.c_str(), actual_contents.size())); diff --git a/content/browser/accessibility/dump_accessibility_tree_helper.h b/content/browser/accessibility/dump_accessibility_tree_helper.h index 7e4d36c..9428237 100644 --- a/content/browser/accessibility/dump_accessibility_tree_helper.h +++ b/content/browser/accessibility/dump_accessibility_tree_helper.h @@ -50,8 +50,8 @@ class DumpAccessibilityTreeHelper { // HTML test: test-file.html // Expected: test-file-expected-mac.txt. // Auto-generated: test-file-actual-mac.txt - const FilePath::StringType GetActualFileSuffix() const; - const FilePath::StringType GetExpectedFileSuffix() const; + const base::FilePath::StringType GetActualFileSuffix() const; + const base::FilePath::StringType GetExpectedFileSuffix() const; // A platform-specific string that indicates a given line in a file // is an allow-empty, allow or deny filter. Example: diff --git a/content/browser/accessibility/dump_accessibility_tree_helper_mac.mm b/content/browser/accessibility/dump_accessibility_tree_helper_mac.mm index f5ba910..895c7e7 100644 --- a/content/browser/accessibility/dump_accessibility_tree_helper_mac.mm +++ b/content/browser/accessibility/dump_accessibility_tree_helper_mac.mm @@ -112,12 +112,14 @@ string16 DumpAccessibilityTreeHelper::ToString(BrowserAccessibility* node, return ASCIIToUTF16(prefix) + FinishLine() + ASCIIToUTF16("\n"); } -const FilePath::StringType DumpAccessibilityTreeHelper::GetActualFileSuffix() +const base::FilePath::StringType +DumpAccessibilityTreeHelper::GetActualFileSuffix() const { return FILE_PATH_LITERAL("-actual-mac.txt"); } -const FilePath::StringType DumpAccessibilityTreeHelper::GetExpectedFileSuffix() +const base::FilePath::StringType +DumpAccessibilityTreeHelper::GetExpectedFileSuffix() const { return FILE_PATH_LITERAL("-expected-mac.txt"); } diff --git a/content/browser/accessibility/dump_accessibility_tree_helper_win.cc b/content/browser/accessibility/dump_accessibility_tree_helper_win.cc index 4c5e2c6..229bf35 100644 --- a/content/browser/accessibility/dump_accessibility_tree_helper_win.cc +++ b/content/browser/accessibility/dump_accessibility_tree_helper_win.cc @@ -160,13 +160,13 @@ string16 DumpAccessibilityTreeHelper::ToString( return UTF8ToUTF16(prefix) + FinishLine() + ASCIIToUTF16("\n"); } -const FilePath::StringType DumpAccessibilityTreeHelper::GetActualFileSuffix() - const { +const base::FilePath::StringType +DumpAccessibilityTreeHelper::GetActualFileSuffix() const { return FILE_PATH_LITERAL("-actual-win.txt"); } -const FilePath::StringType DumpAccessibilityTreeHelper::GetExpectedFileSuffix() - const { +const base::FilePath::StringType +DumpAccessibilityTreeHelper::GetExpectedFileSuffix() const { return FILE_PATH_LITERAL("-expected-win.txt"); } diff --git a/content/browser/android/tracing_intent_handler.cc b/content/browser/android/tracing_intent_handler.cc index 2b44a46..5935a78 100644 --- a/content/browser/android/tracing_intent_handler.cc +++ b/content/browser/android/tracing_intent_handler.cc @@ -14,7 +14,7 @@ namespace content { TracingIntentHandler* g_trace_intent_handler = NULL; -TracingIntentHandler::TracingIntentHandler(const FilePath& path) +TracingIntentHandler::TracingIntentHandler(const base::FilePath& path) : TraceSubscriberStdio(path) { TraceController::GetInstance()->BeginTracing(this, std::string("-test*")); } @@ -37,7 +37,7 @@ static void BeginTracing(JNIEnv* env, jclass clazz, jstring jspath) { std::string path(base::android::ConvertJavaStringToUTF8(env, jspath)); if (g_trace_intent_handler != NULL) return; - g_trace_intent_handler = new TracingIntentHandler(FilePath(path)); + g_trace_intent_handler = new TracingIntentHandler(base::FilePath(path)); } static void EndTracing(JNIEnv* env, jclass clazz) { diff --git a/content/browser/android/tracing_intent_handler.h b/content/browser/android/tracing_intent_handler.h index 1ea4b6e..f916300 100644 --- a/content/browser/android/tracing_intent_handler.h +++ b/content/browser/android/tracing_intent_handler.h @@ -18,7 +18,7 @@ bool RegisterTracingIntentHandler(JNIEnv* env); class TracingIntentHandler : public TraceSubscriberStdio { public: - explicit TracingIntentHandler(const FilePath& path); + explicit TracingIntentHandler(const base::FilePath& path); virtual ~TracingIntentHandler(); // TraceSubscriber implementation diff --git a/content/browser/appcache/appcache_browsertest.cc b/content/browser/appcache/appcache_browsertest.cc index 030178f..72ad4d0 100644 --- a/content/browser/appcache/appcache_browsertest.cc +++ b/content/browser/appcache/appcache_browsertest.cc @@ -9,8 +9,8 @@ namespace content { class AppCacheLayoutTest : public InProcessBrowserLayoutTest { public: AppCacheLayoutTest() : InProcessBrowserLayoutTest( - FilePath().AppendASCII("http").AppendASCII("tests"), - FilePath().AppendASCII("appcache"), + base::FilePath().AppendASCII("http").AppendASCII("tests"), + base::FilePath().AppendASCII("appcache"), -1) { } diff --git a/content/browser/appcache/chrome_appcache_service.cc b/content/browser/appcache/chrome_appcache_service.cc index d918fe6..b3bfd0f 100644 --- a/content/browser/appcache/chrome_appcache_service.cc +++ b/content/browser/appcache/chrome_appcache_service.cc @@ -23,7 +23,7 @@ ChromeAppCacheService::ChromeAppCacheService( } void ChromeAppCacheService::InitializeOnIOThread( - const FilePath& cache_path, + const base::FilePath& cache_path, ResourceContext* resource_context, net::URLRequestContextGetter* request_context_getter, scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy) { diff --git a/content/browser/appcache/chrome_appcache_service_unittest.cc b/content/browser/appcache/chrome_appcache_service_unittest.cc index 7567e4f..0c8a7f4 100644 --- a/content/browser/appcache/chrome_appcache_service_unittest.cc +++ b/content/browser/appcache/chrome_appcache_service_unittest.cc @@ -24,7 +24,7 @@ using appcache::AppCacheTestHelper; namespace content { namespace { -const FilePath::CharType kTestingAppCacheDirname[] = +const base::FilePath::CharType kTestingAppCacheDirname[] = FILE_PATH_LITERAL("Application Cache"); // Examples of a protected and an unprotected origin, to be used througout the @@ -76,7 +76,7 @@ class ChromeAppCacheServiceTest : public testing::Test { protected: scoped_refptr<ChromeAppCacheService> CreateAppCacheService( - const FilePath& appcache_path, + const base::FilePath& appcache_path, bool init_storage); void InsertDataIntoAppCache(ChromeAppCacheService* appcache_service); @@ -96,7 +96,7 @@ class ChromeAppCacheServiceTest : public testing::Test { scoped_refptr<ChromeAppCacheService> ChromeAppCacheServiceTest::CreateAppCacheService( - const FilePath& appcache_path, + const base::FilePath& appcache_path, bool init_storage) { scoped_refptr<ChromeAppCacheService> appcache_service = new ChromeAppCacheService(NULL); @@ -147,7 +147,8 @@ void ChromeAppCacheServiceTest::InsertDataIntoAppCache( TEST_F(ChromeAppCacheServiceTest, KeepOnDestruction) { ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); - FilePath appcache_path = temp_dir_.path().Append(kTestingAppCacheDirname); + base::FilePath appcache_path = + temp_dir_.path().Append(kTestingAppCacheDirname); // Create a ChromeAppCacheService and insert data into it scoped_refptr<ChromeAppCacheService> appcache_service = @@ -183,7 +184,8 @@ TEST_F(ChromeAppCacheServiceTest, KeepOnDestruction) { TEST_F(ChromeAppCacheServiceTest, SaveSessionState) { ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); - FilePath appcache_path = temp_dir_.path().Append(kTestingAppCacheDirname); + base::FilePath appcache_path = + temp_dir_.path().Append(kTestingAppCacheDirname); // Create a ChromeAppCacheService and insert data into it scoped_refptr<ChromeAppCacheService> appcache_service = diff --git a/content/browser/browser_child_process_host_impl.cc b/content/browser/browser_child_process_host_impl.cc index c751830..cd6167a 100644 --- a/content/browser/browser_child_process_host_impl.cc +++ b/content/browser/browser_child_process_host_impl.cc @@ -102,7 +102,7 @@ void BrowserChildProcessHostImpl::TerminateAll() { void BrowserChildProcessHostImpl::Launch( #if defined(OS_WIN) - const FilePath& exposed_dir, + const base::FilePath& exposed_dir, #elif defined(OS_POSIX) bool use_zygote, const base::EnvironmentVector& environ, diff --git a/content/browser/browser_child_process_host_impl.h b/content/browser/browser_child_process_host_impl.h index 317a808..efbf78e 100644 --- a/content/browser/browser_child_process_host_impl.h +++ b/content/browser/browser_child_process_host_impl.h @@ -39,7 +39,7 @@ class CONTENT_EXPORT BrowserChildProcessHostImpl virtual bool Send(IPC::Message* message) OVERRIDE; virtual void Launch( #if defined(OS_WIN) - const FilePath& exposed_dir, + const base::FilePath& exposed_dir, #elif defined(OS_POSIX) bool use_zygote, const base::EnvironmentVector& environ, diff --git a/content/browser/browser_context.cc b/content/browser/browser_context.cc index 1b72aec..3e3f570 100644 --- a/content/browser/browser_context.cc +++ b/content/browser/browser_context.cc @@ -106,7 +106,7 @@ void BrowserContext::AsyncObliterateStoragePartition( // static void BrowserContext::GarbageCollectStoragePartitions( BrowserContext* browser_context, - scoped_ptr<base::hash_set<FilePath> > active_paths, + scoped_ptr<base::hash_set<base::FilePath> > active_paths, const base::Closure& done) { GetStoragePartitionMap(browser_context)->GarbageCollect( active_paths.Pass(), done); @@ -151,7 +151,7 @@ fileapi::ExternalMountPoints* BrowserContext::GetMountPoints( mount_points)); // Add Downloads mount point. - FilePath home_path; + base::FilePath home_path; if (PathService::Get(base::DIR_HOME, &home_path)) { mount_points->RegisterFileSystem( "Downloads", diff --git a/content/browser/browser_plugin/browser_plugin_host_browsertest.cc b/content/browser/browser_plugin/browser_plugin_host_browsertest.cc index 3824c35..c998ebf 100644 --- a/content/browser/browser_plugin/browser_plugin_host_browsertest.cc +++ b/content/browser/browser_plugin/browser_plugin_host_browsertest.cc @@ -467,7 +467,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, EmbedderChangedAfterSwap) { net::TestServer https_server( net::TestServer::TYPE_HTTPS, net::TestServer::kLocalhost, - FilePath(FILE_PATH_LITERAL("content/test/data"))); + base::FilePath(FILE_PATH_LITERAL("content/test/data"))); ASSERT_TRUE(https_server.Start()); // 1. Load an embedder page with one guest in it. diff --git a/content/browser/child_process_launcher.cc b/content/browser/child_process_launcher.cc index 49ebb22..a8e68cf 100644 --- a/content/browser/child_process_launcher.cc +++ b/content/browser/child_process_launcher.cc @@ -67,7 +67,7 @@ class ChildProcessLauncher::Context void Launch( #if defined(OS_WIN) - const FilePath& exposed_dir, + const base::FilePath& exposed_dir, #elif defined(OS_ANDROID) int ipcfd, #elif defined(OS_POSIX) @@ -153,7 +153,7 @@ class ChildProcessLauncher::Context BrowserThread::ID client_thread_id, int child_process_id, #if defined(OS_WIN) - const FilePath& exposed_dir, + const base::FilePath& exposed_dir, #elif defined(OS_ANDROID) int ipcfd, #elif defined(OS_POSIX) @@ -379,7 +379,7 @@ class ChildProcessLauncher::Context ChildProcessLauncher::ChildProcessLauncher( #if defined(OS_WIN) - const FilePath& exposed_dir, + const base::FilePath& exposed_dir, #elif defined(OS_POSIX) bool use_zygote, const base::EnvironmentVector& environ, diff --git a/content/browser/child_process_launcher.h b/content/browser/child_process_launcher.h index 9ee3d41..641edd8 100644 --- a/content/browser/child_process_launcher.h +++ b/content/browser/child_process_launcher.h @@ -36,7 +36,7 @@ class CONTENT_EXPORT ChildProcessLauncher { // Takes ownership of cmd_line. ChildProcessLauncher( #if defined(OS_WIN) - const FilePath& exposed_dir, + const base::FilePath& exposed_dir, #elif defined(OS_POSIX) bool use_zygote, const base::EnvironmentVector& environ, diff --git a/content/browser/child_process_security_policy_impl.cc b/content/browser/child_process_security_policy_impl.cc index b8981ce..e705fa6 100644 --- a/content/browser/child_process_security_policy_impl.cc +++ b/content/browser/child_process_security_policy_impl.cc @@ -80,21 +80,21 @@ class ChildProcessSecurityPolicyImpl::SecurityState { } // Grant certain permissions to a file. - void GrantPermissionsForFile(const FilePath& file, int permissions) { - FilePath stripped = file.StripTrailingSeparators(); + void GrantPermissionsForFile(const base::FilePath& file, int permissions) { + base::FilePath stripped = file.StripTrailingSeparators(); file_permissions_[stripped] |= permissions; UMA_HISTOGRAM_COUNTS("ChildProcessSecurityPolicy.FilePermissionPathLength", stripped.value().size()); } // Grant navigation to a file but not the file:// scheme in general. - void GrantRequestOfSpecificFile(const FilePath &file) { + void GrantRequestOfSpecificFile(const base::FilePath &file) { request_file_set_.insert(file.StripTrailingSeparators()); } // Revokes all permissions granted to a file. - void RevokeAllPermissionsForFile(const FilePath& file) { - FilePath stripped = file.StripTrailingSeparators(); + void RevokeAllPermissionsForFile(const base::FilePath& file) { + base::FilePath stripped = file.StripTrailingSeparators(); file_permissions_.erase(stripped); request_file_set_.erase(stripped); } @@ -139,7 +139,7 @@ class ChildProcessSecurityPolicyImpl::SecurityState { // file:// URLs are more granular. The child may have been given // permission to a specific file but not the file:// scheme in general. if (url.SchemeIs(chrome::kFileScheme)) { - FilePath path; + base::FilePath path; if (net::FileURLToFilePath(url, &path)) return request_file_set_.find(path) != request_file_set_.end(); } @@ -148,18 +148,18 @@ class ChildProcessSecurityPolicyImpl::SecurityState { } // Determine if the certain permissions have been granted to a file. - bool HasPermissionsForFile(const FilePath& file, int permissions) { + bool HasPermissionsForFile(const base::FilePath& file, int permissions) { if (!permissions || file.empty() || !file.IsAbsolute()) return false; - FilePath current_path = file.StripTrailingSeparators(); - FilePath last_path; + base::FilePath current_path = file.StripTrailingSeparators(); + base::FilePath last_path; int skip = 0; while (current_path != last_path) { - FilePath base_name = current_path.BaseName(); - if (base_name.value() == FilePath::kParentDirectory) { + base::FilePath base_name = current_path.BaseName(); + if (base_name.value() == base::FilePath::kParentDirectory) { ++skip; } else if (skip > 0) { - if (base_name.value() != FilePath::kCurrentDirectory) + if (base_name.value() != base::FilePath::kCurrentDirectory) --skip; } else { if (file_permissions_.find(current_path) != file_permissions_.end()) @@ -228,9 +228,9 @@ class ChildProcessSecurityPolicyImpl::SecurityState { typedef std::map<std::string, bool> SchemeMap; typedef int FilePermissionFlags; // bit-set of PlatformFileFlags - typedef std::map<FilePath, FilePermissionFlags> FileMap; + typedef std::map<base::FilePath, FilePermissionFlags> FileMap; typedef std::map<std::string, FilePermissionFlags> FileSystemMap; - typedef std::set<FilePath> FileSet; + typedef std::set<base::FilePath> FileSet; // Maps URL schemes to whether permission has been granted or revoked: // |true| means the scheme has been granted. @@ -406,24 +406,24 @@ void ChildProcessSecurityPolicyImpl::GrantRequestSpecificFileURL( // When the child process has been commanded to request a file:// URL, // then we grant it the capability for that URL only. - FilePath path; + base::FilePath path; if (net::FileURLToFilePath(url, &path)) - state->second->GrantRequestOfSpecificFile(path); + state->second->GrantRequestOfSpecificFile(path); } } void ChildProcessSecurityPolicyImpl::GrantReadFile(int child_id, - const FilePath& file) { + const base::FilePath& file) { GrantPermissionsForFile(child_id, file, kReadFilePermissions); } void ChildProcessSecurityPolicyImpl::GrantReadDirectory( - int child_id, const FilePath& directory) { + int child_id, const base::FilePath& directory) { GrantPermissionsForFile(child_id, directory, kEnumerateDirectoryPermissions); } void ChildProcessSecurityPolicyImpl::GrantPermissionsForFile( - int child_id, const FilePath& file, int permissions) { + int child_id, const base::FilePath& file, int permissions) { base::AutoLock lock(lock_); SecurityStateMap::iterator state = security_state_.find(child_id); @@ -434,7 +434,7 @@ void ChildProcessSecurityPolicyImpl::GrantPermissionsForFile( } void ChildProcessSecurityPolicyImpl::RevokeAllPermissionsForFile( - int child_id, const FilePath& file) { + int child_id, const base::FilePath& file) { base::AutoLock lock(lock_); SecurityStateMap::iterator state = security_state_.find(child_id); @@ -575,12 +575,12 @@ bool ChildProcessSecurityPolicyImpl::CanRequestURL( } bool ChildProcessSecurityPolicyImpl::CanReadFile(int child_id, - const FilePath& file) { + const base::FilePath& file) { return HasPermissionsForFile(child_id, file, kReadFilePermissions); } bool ChildProcessSecurityPolicyImpl::CanReadDirectory( - int child_id, const FilePath& directory) { + int child_id, const base::FilePath& directory) { return HasPermissionsForFile(child_id, directory, kEnumerateDirectoryPermissions); @@ -602,7 +602,7 @@ bool ChildProcessSecurityPolicyImpl::CanReadWriteFileSystem( } bool ChildProcessSecurityPolicyImpl::HasPermissionsForFile( - int child_id, const FilePath& file, int permissions) { + int child_id, const base::FilePath& file, int permissions) { base::AutoLock lock(lock_); bool result = ChildProcessHasPermissionsForFile(child_id, file, permissions); if (!result) { @@ -648,7 +648,7 @@ void ChildProcessSecurityPolicyImpl::AddChild(int child_id) { } bool ChildProcessSecurityPolicyImpl::ChildProcessHasPermissionsForFile( - int child_id, const FilePath& file, int permissions) { + int child_id, const base::FilePath& file, int permissions) { SecurityStateMap::iterator state = security_state_.find(child_id); if (state == security_state_.end()) return false; diff --git a/content/browser/child_process_security_policy_unittest.cc b/content/browser/child_process_security_policy_unittest.cc index e98b841..7f0d75d 100644 --- a/content/browser/child_process_security_policy_unittest.cc +++ b/content/browser/child_process_security_policy_unittest.cc @@ -300,16 +300,21 @@ TEST_F(ChildProcessSecurityPolicyTest, CanReadFiles) { p->Add(kRendererID); - EXPECT_FALSE(p->CanReadFile(kRendererID, FilePath(TEST_PATH("/etc/passwd")))); - p->GrantReadFile(kRendererID, FilePath(TEST_PATH("/etc/passwd"))); - EXPECT_TRUE(p->CanReadFile(kRendererID, FilePath(TEST_PATH("/etc/passwd")))); - EXPECT_FALSE(p->CanReadFile(kRendererID, FilePath(TEST_PATH("/etc/shadow")))); + EXPECT_FALSE(p->CanReadFile(kRendererID, + base::FilePath(TEST_PATH("/etc/passwd")))); + p->GrantReadFile(kRendererID, base::FilePath(TEST_PATH("/etc/passwd"))); + EXPECT_TRUE(p->CanReadFile(kRendererID, + base::FilePath(TEST_PATH("/etc/passwd")))); + EXPECT_FALSE(p->CanReadFile(kRendererID, + base::FilePath(TEST_PATH("/etc/shadow")))); p->Remove(kRendererID); p->Add(kRendererID); - EXPECT_FALSE(p->CanReadFile(kRendererID, FilePath(TEST_PATH("/etc/passwd")))); - EXPECT_FALSE(p->CanReadFile(kRendererID, FilePath(TEST_PATH("/etc/shadow")))); + EXPECT_FALSE(p->CanReadFile(kRendererID, + base::FilePath(TEST_PATH("/etc/passwd")))); + EXPECT_FALSE(p->CanReadFile(kRendererID, + base::FilePath(TEST_PATH("/etc/shadow")))); p->Remove(kRendererID); } @@ -320,40 +325,49 @@ TEST_F(ChildProcessSecurityPolicyTest, CanReadDirectories) { p->Add(kRendererID); - EXPECT_FALSE(p->CanReadDirectory(kRendererID, FilePath(TEST_PATH("/etc/")))); - p->GrantReadDirectory(kRendererID, FilePath(TEST_PATH("/etc/"))); - EXPECT_TRUE(p->CanReadDirectory(kRendererID, FilePath(TEST_PATH("/etc/")))); - EXPECT_TRUE(p->CanReadFile(kRendererID, FilePath(TEST_PATH("/etc/passwd")))); + EXPECT_FALSE(p->CanReadDirectory(kRendererID, + base::FilePath(TEST_PATH("/etc/")))); + p->GrantReadDirectory(kRendererID, + base::FilePath(TEST_PATH("/etc/"))); + EXPECT_TRUE(p->CanReadDirectory(kRendererID, + base::FilePath(TEST_PATH("/etc/")))); + EXPECT_TRUE(p->CanReadFile(kRendererID, + base::FilePath(TEST_PATH("/etc/passwd")))); p->Remove(kRendererID); p->Add(kRendererID); - EXPECT_FALSE(p->CanReadDirectory(kRendererID, FilePath(TEST_PATH("/etc/")))); - EXPECT_FALSE(p->CanReadFile(kRendererID, FilePath(TEST_PATH("/etc/passwd")))); + EXPECT_FALSE(p->CanReadDirectory(kRendererID, + base::FilePath(TEST_PATH("/etc/")))); + EXPECT_FALSE(p->CanReadFile(kRendererID, + base::FilePath(TEST_PATH("/etc/passwd")))); // Just granting read permission as a file doesn't imply reading as a // directory. - p->GrantReadFile(kRendererID, FilePath(TEST_PATH("/etc/"))); - EXPECT_TRUE(p->CanReadFile(kRendererID, FilePath(TEST_PATH("/etc/passwd")))); - EXPECT_FALSE(p->CanReadDirectory(kRendererID, FilePath(TEST_PATH("/etc/")))); + p->GrantReadFile(kRendererID, base::FilePath(TEST_PATH("/etc/"))); + EXPECT_TRUE(p->CanReadFile(kRendererID, + base::FilePath(TEST_PATH("/etc/passwd")))); + EXPECT_FALSE(p->CanReadDirectory(kRendererID, + base::FilePath(TEST_PATH("/etc/")))); p->Remove(kRendererID); } TEST_F(ChildProcessSecurityPolicyTest, FilePermissions) { - FilePath granted_file = FilePath(TEST_PATH("/home/joe")); - FilePath sibling_file = FilePath(TEST_PATH("/home/bob")); - FilePath child_file = FilePath(TEST_PATH("/home/joe/file")); - FilePath parent_file = FilePath(TEST_PATH("/home")); - FilePath parent_slash_file = FilePath(TEST_PATH("/home/")); - FilePath child_traversal1 = FilePath(TEST_PATH("/home/joe/././file")); - FilePath child_traversal2 = FilePath( + base::FilePath granted_file = FilePath(TEST_PATH("/home/joe")); + base::FilePath sibling_file = FilePath(TEST_PATH("/home/bob")); + base::FilePath child_file = FilePath(TEST_PATH("/home/joe/file")); + base::FilePath parent_file = FilePath(TEST_PATH("/home")); + base::FilePath parent_slash_file = FilePath(TEST_PATH("/home/")); + base::FilePath child_traversal1 = FilePath(TEST_PATH("/home/joe/././file")); + base::FilePath child_traversal2 = FilePath( TEST_PATH("/home/joe/file/../otherfile")); - FilePath evil_traversal1 = FilePath(TEST_PATH("/home/joe/../../etc/passwd")); - FilePath evil_traversal2 = FilePath( + base::FilePath evil_traversal1 = + FilePath(TEST_PATH("/home/joe/../../etc/passwd")); + base::FilePath evil_traversal2 = FilePath( TEST_PATH("/home/joe/./.././../etc/passwd")); - FilePath self_traversal = FilePath(TEST_PATH("/home/joe/../joe/file")); - FilePath relative_file = FilePath(FILE_PATH_LITERAL("home/joe")); + base::FilePath self_traversal = FilePath(TEST_PATH("/home/joe/../joe/file")); + base::FilePath relative_file = FilePath(FILE_PATH_LITERAL("home/joe")); ChildProcessSecurityPolicyImpl* p = ChildProcessSecurityPolicyImpl::GetInstance(); @@ -510,7 +524,7 @@ TEST_F(ChildProcessSecurityPolicyTest, RemoveRace) { ChildProcessSecurityPolicyImpl::GetInstance(); GURL url("file:///etc/passwd"); - FilePath file(TEST_PATH("/etc/passwd")); + base::FilePath file(TEST_PATH("/etc/passwd")); p->Add(kRendererID); diff --git a/content/browser/devtools/devtools_http_handler_impl.cc b/content/browser/devtools/devtools_http_handler_impl.cc index 36506a1..5856188 100644 --- a/content/browser/devtools/devtools_http_handler_impl.cc +++ b/content/browser/devtools/devtools_http_handler_impl.cc @@ -338,9 +338,9 @@ void DevToolsHttpHandlerImpl::OnHttpRequest( std::string filename = PathWithoutParams(info.path.substr(10)); std::string mime_type = GetMimeType(filename); - FilePath frontend_dir = delegate_->GetDebugFrontendDir(); + base::FilePath frontend_dir = delegate_->GetDebugFrontendDir(); if (!frontend_dir.empty()) { - FilePath path = frontend_dir.AppendASCII(filename); + base::FilePath path = frontend_dir.AppendASCII(filename); std::string data; file_util::ReadFileToString(path, &data); server_->Send200(connection_id, data, mime_type); diff --git a/content/browser/devtools/devtools_http_handler_unittest.cc b/content/browser/devtools/devtools_http_handler_unittest.cc index 0e2e7bb..0396ff8 100644 --- a/content/browser/devtools/devtools_http_handler_unittest.cc +++ b/content/browser/devtools/devtools_http_handler_unittest.cc @@ -58,7 +58,9 @@ class DummyDelegate : public DevToolsHttpHandlerDelegate { public: virtual std::string GetDiscoveryPageHTML() OVERRIDE { return ""; } virtual bool BundlesFrontendResources() OVERRIDE { return true; } - virtual FilePath GetDebugFrontendDir() OVERRIDE { return FilePath(); } + virtual base::FilePath GetDebugFrontendDir() OVERRIDE { + return base::FilePath(); + } virtual std::string GetPageThumbnailData(const GURL& url) { return ""; } virtual RenderViewHost* CreateNewTarget() { return NULL; } virtual TargetType GetTargetType(RenderViewHost*) { return kTargetTypeTab; } diff --git a/content/browser/dom_storage/dom_storage_context_impl.cc b/content/browser/dom_storage/dom_storage_context_impl.cc index e298c7d..381d67da 100644 --- a/content/browser/dom_storage/dom_storage_context_impl.cc +++ b/content/browser/dom_storage/dom_storage_context_impl.cc @@ -66,7 +66,7 @@ void GetSessionStorageUsageHelper( } // namespace DOMStorageContextImpl::DOMStorageContextImpl( - const FilePath& data_path, + const base::FilePath& data_path, quota::SpecialStoragePolicy* special_storage_policy) { base::SequencedWorkerPool* worker_pool = BrowserThread::GetBlockingPool(); context_ = new dom_storage::DomStorageContext( diff --git a/content/browser/download/base_file.cc b/content/browser/download/base_file.cc index 1682723..b5ded45 100644 --- a/content/browser/download/base_file.cc +++ b/content/browser/download/base_file.cc @@ -25,7 +25,7 @@ namespace content { // This will initialize the entire array to zero. const unsigned char BaseFile::kEmptySha256Hash[] = { 0 }; -BaseFile::BaseFile(const FilePath& full_path, +BaseFile::BaseFile(const base::FilePath& full_path, const GURL& source_url, const GURL& referrer_url, int64 received_bytes, @@ -63,7 +63,7 @@ BaseFile::~BaseFile() { } DownloadInterruptReason BaseFile::Initialize( - const FilePath& default_directory) { + const base::FilePath& default_directory) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); DCHECK(!detached_); @@ -73,8 +73,8 @@ DownloadInterruptReason BaseFile::Initialize( } if (full_path_.empty()) { - FilePath initial_directory(default_directory); - FilePath temp_file; + base::FilePath initial_directory(default_directory); + base::FilePath temp_file; if (initial_directory.empty()) { initial_directory = GetContentClient()->browser()->GetDefaultDownloadDirectory(); @@ -148,7 +148,7 @@ DownloadInterruptReason BaseFile::AppendDataToFile(const char* data, return DOWNLOAD_INTERRUPT_REASON_NONE; } -DownloadInterruptReason BaseFile::Rename(const FilePath& new_path) { +DownloadInterruptReason BaseFile::Rename(const base::FilePath& new_path) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); DownloadInterruptReason rename_result = DOWNLOAD_INTERRUPT_REASON_NONE; diff --git a/content/browser/download/base_file.h b/content/browser/download/base_file.h index f10f043..9f6d4343 100644 --- a/content/browser/download/base_file.h +++ b/content/browser/download/base_file.h @@ -34,7 +34,7 @@ class CONTENT_EXPORT BaseFile { public: // May be constructed on any thread. All other routines (including // destruction) must occur on the FILE thread. - BaseFile(const FilePath& full_path, + BaseFile(const base::FilePath& full_path, const GURL& source_url, const GURL& referrer_url, int64 received_bytes, @@ -50,7 +50,7 @@ class CONTENT_EXPORT BaseFile { // |default_directory| and |full_path()| are empty, then a temporary file will // be created in the default download location as determined by // ContentBrowserClient. - DownloadInterruptReason Initialize(const FilePath& default_directory); + DownloadInterruptReason Initialize(const base::FilePath& default_directory); // Write a new chunk of data to the file. Returns a DownloadInterruptReason // indicating the result of the operation. @@ -58,7 +58,7 @@ class CONTENT_EXPORT BaseFile { // Rename the download file. Returns a DownloadInterruptReason indicating the // result of the operation. - virtual DownloadInterruptReason Rename(const FilePath& full_path); + virtual DownloadInterruptReason Rename(const base::FilePath& full_path); // Detach the file so it is not deleted on destruction. virtual void Detach(); @@ -76,7 +76,7 @@ class CONTENT_EXPORT BaseFile { // Calculate and return the current speed in bytes per second. int64 CurrentSpeed() const; - FilePath full_path() const { return full_path_; } + base::FilePath full_path() const { return full_path_; } bool in_progress() const { return file_stream_.get() != NULL; } int64 bytes_so_far() const { return bytes_so_far_; } @@ -114,7 +114,7 @@ class CONTENT_EXPORT BaseFile { // security descriptor / permissions on the file to match the defaults for the // new directory. DownloadInterruptReason MoveFileAndAdjustPermissions( - const FilePath& new_path); + const base::FilePath& new_path); // Split out from CurrentSpeed to enable testing. int64 CurrentSpeedAtTime(base::TimeTicks current_time) const; @@ -137,7 +137,7 @@ class CONTENT_EXPORT BaseFile { static const unsigned char kEmptySha256Hash[kSha256HashLen]; // Full path to the file including the file name. - FilePath full_path_; + base::FilePath full_path_; // Source URL for the file being downloaded. GURL source_url_; diff --git a/content/browser/download/base_file_posix.cc b/content/browser/download/base_file_posix.cc index da654d0..bd351ad 100644 --- a/content/browser/download/base_file_posix.cc +++ b/content/browser/download/base_file_posix.cc @@ -10,7 +10,7 @@ namespace content { DownloadInterruptReason BaseFile::MoveFileAndAdjustPermissions( - const FilePath& new_path) { + const base::FilePath& new_path) { // Similarly, on Unix, we're moving a temp file created with permissions 600 // to |new_path|. Here, we try to fix up the destination file with appropriate // permissions. diff --git a/content/browser/download/base_file_unittest.cc b/content/browser/download/base_file_unittest.cc index 26fbf81..799076d 100644 --- a/content/browser/download/base_file_unittest.cc +++ b/content/browser/download/base_file_unittest.cc @@ -49,7 +49,7 @@ class BaseFileTest : public testing::Test { virtual void SetUp() { ResetHash(); ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); - base_file_.reset(new BaseFile(FilePath(), + base_file_.reset(new BaseFile(base::FilePath(), GURL(), GURL(), 0, @@ -66,7 +66,7 @@ class BaseFileTest : public testing::Test { base_file_->bytes_so_far()); } - FilePath full_path = base_file_->full_path(); + base::FilePath full_path = base_file_->full_path(); if (!expected_data_.empty() && !expected_error_) { // Make sure the data has been properly written to disk. @@ -100,7 +100,7 @@ class BaseFileTest : public testing::Test { } void MakeFileWithHash() { - base_file_.reset(new BaseFile(FilePath(), + base_file_.reset(new BaseFile(base::FilePath(), GURL(), GURL(), 0, @@ -138,9 +138,9 @@ class BaseFileTest : public testing::Test { // Helper functions. // Create a file. Returns the complete file path. - FilePath CreateTestFile() { - FilePath file_name; - BaseFile file(FilePath(), + base::FilePath CreateTestFile() { + base::FilePath file_name; + BaseFile file(base::FilePath(), GURL(), GURL(), 0, @@ -152,7 +152,7 @@ class BaseFileTest : public testing::Test { EXPECT_EQ(DOWNLOAD_INTERRUPT_REASON_NONE, file.Initialize(temp_dir_.path())); file_name = file.full_path(); - EXPECT_NE(FilePath::StringType(), file_name.value()); + EXPECT_NE(base::FilePath::StringType(), file_name.value()); EXPECT_EQ(DOWNLOAD_INTERRUPT_REASON_NONE, file.AppendDataToFile(kTestData4, kTestDataLength4)); @@ -164,8 +164,8 @@ class BaseFileTest : public testing::Test { } // Create a file with the specified file name. - void CreateFileWithName(const FilePath& file_name) { - EXPECT_NE(FilePath::StringType(), file_name.value()); + void CreateFileWithName(const base::FilePath& file_name) { + EXPECT_NE(base::FilePath::StringType(), file_name.value()); BaseFile duplicate_file(file_name, GURL(), GURL(), @@ -233,7 +233,7 @@ const unsigned char BaseFileTest::kEmptySha256Hash[] = { 0 }; // on all its accessors. This is actually a case that rarely happens // in production, where we would at least Initialize it. TEST_F(BaseFileTest, CreateDestroy) { - EXPECT_EQ(FilePath().value(), base_file_->full_path().value()); + EXPECT_EQ(base::FilePath().value(), base_file_->full_path().value()); } // Cancel the download explicitly. @@ -242,7 +242,7 @@ TEST_F(BaseFileTest, Cancel) { EXPECT_TRUE(file_util::PathExists(base_file_->full_path())); base_file_->Cancel(); EXPECT_FALSE(file_util::PathExists(base_file_->full_path())); - EXPECT_NE(FilePath().value(), base_file_->full_path().value()); + EXPECT_NE(base::FilePath().value(), base_file_->full_path().value()); } // Write data to the file and detach it, so it doesn't get deleted @@ -283,9 +283,9 @@ TEST_F(BaseFileTest, WriteWithHashAndDetach) { TEST_F(BaseFileTest, WriteThenRenameAndDetach) { ASSERT_TRUE(InitializeFile()); - FilePath initial_path(base_file_->full_path()); + base::FilePath initial_path(base_file_->full_path()); EXPECT_TRUE(file_util::PathExists(initial_path)); - FilePath new_path(temp_dir_.path().AppendASCII("NewFile")); + base::FilePath new_path(temp_dir_.path().AppendASCII("NewFile")); EXPECT_FALSE(file_util::PathExists(new_path)); ASSERT_TRUE(AppendDataToFile(kTestData1)); @@ -389,8 +389,8 @@ TEST_F(BaseFileTest, MultipleWritesInterruptedWithHash) { // Finish the file. base_file_->Finish(); - FilePath new_file_path(temp_dir_.path().Append( - FilePath(FILE_PATH_LITERAL("second_file")))); + base::FilePath new_file_path(temp_dir_.path().Append( + base::FilePath(FILE_PATH_LITERAL("second_file")))); ASSERT_TRUE(file_util::CopyFile(base_file_->full_path(), new_file_path)); @@ -404,7 +404,7 @@ TEST_F(BaseFileTest, MultipleWritesInterruptedWithHash) { scoped_ptr<net::FileStream>(), net::BoundNetLog()); ASSERT_EQ(DOWNLOAD_INTERRUPT_REASON_NONE, - second_file.Initialize(FilePath())); + second_file.Initialize(base::FilePath())); std::string data(kTestData3); EXPECT_EQ(DOWNLOAD_INTERRUPT_REASON_NONE, second_file.AppendDataToFile(data.data(), data.size())); @@ -421,9 +421,9 @@ TEST_F(BaseFileTest, MultipleWritesInterruptedWithHash) { TEST_F(BaseFileTest, WriteThenRename) { ASSERT_TRUE(InitializeFile()); - FilePath initial_path(base_file_->full_path()); + base::FilePath initial_path(base_file_->full_path()); EXPECT_TRUE(file_util::PathExists(initial_path)); - FilePath new_path(temp_dir_.path().AppendASCII("NewFile")); + base::FilePath new_path(temp_dir_.path().AppendASCII("NewFile")); EXPECT_FALSE(file_util::PathExists(new_path)); ASSERT_TRUE(AppendDataToFile(kTestData1)); @@ -440,9 +440,9 @@ TEST_F(BaseFileTest, WriteThenRename) { TEST_F(BaseFileTest, RenameWhileInProgress) { ASSERT_TRUE(InitializeFile()); - FilePath initial_path(base_file_->full_path()); + base::FilePath initial_path(base_file_->full_path()); EXPECT_TRUE(file_util::PathExists(initial_path)); - FilePath new_path(temp_dir_.path().AppendASCII("NewFile")); + base::FilePath new_path(temp_dir_.path().AppendASCII("NewFile")); EXPECT_FALSE(file_util::PathExists(new_path)); ASSERT_TRUE(AppendDataToFile(kTestData1)); @@ -463,10 +463,10 @@ TEST_F(BaseFileTest, RenameWithError) { // TestDir is a subdirectory in |temp_dir_| that we will make read-only so // that the rename will fail. - FilePath test_dir(temp_dir_.path().AppendASCII("TestDir")); + base::FilePath test_dir(temp_dir_.path().AppendASCII("TestDir")); ASSERT_TRUE(file_util::CreateDirectory(test_dir)); - FilePath new_path(test_dir.AppendASCII("TestFile")); + base::FilePath new_path(test_dir.AppendASCII("TestFile")); EXPECT_FALSE(file_util::PathExists(new_path)); { @@ -481,7 +481,7 @@ TEST_F(BaseFileTest, RenameWithError) { // Write data to the file multiple times. TEST_F(BaseFileTest, MultipleWritesWithError) { - FilePath path; + base::FilePath path; ASSERT_TRUE(file_util::CreateTemporaryFile(&path)); // Create a new file stream. scoped_ptr takes ownership and passes it to // BaseFile; we use the pointer anyway and rely on the BaseFile not @@ -540,7 +540,7 @@ TEST_F(BaseFileTest, DuplicateBaseFile) { // Create a file and append to it. TEST_F(BaseFileTest, AppendToBaseFile) { // Create a new file. - FilePath existing_file_name = CreateTestFile(); + base::FilePath existing_file_name = CreateTestFile(); set_expected_data(kTestData4); @@ -556,8 +556,8 @@ TEST_F(BaseFileTest, AppendToBaseFile) { ASSERT_TRUE(InitializeFile()); - const FilePath file_name = base_file_->full_path(); - EXPECT_NE(FilePath::StringType(), file_name.value()); + const base::FilePath file_name = base_file_->full_path(); + EXPECT_NE(base::FilePath::StringType(), file_name.value()); // Write into the file. EXPECT_TRUE(AppendDataToFile(kTestData1)); @@ -570,7 +570,7 @@ TEST_F(BaseFileTest, AppendToBaseFile) { // Create a read-only file and attempt to write to it. TEST_F(BaseFileTest, ReadonlyBaseFile) { // Create a new file. - FilePath readonly_file_name = CreateTestFile(); + base::FilePath readonly_file_name = CreateTestFile(); // Restore permissions to the file when we are done with this test. file_util::PermissionRestorer restore_permissions(readonly_file_name); @@ -592,8 +592,8 @@ TEST_F(BaseFileTest, ReadonlyBaseFile) { set_expected_error(DOWNLOAD_INTERRUPT_REASON_FILE_ACCESS_DENIED); EXPECT_FALSE(InitializeFile()); - const FilePath file_name = base_file_->full_path(); - EXPECT_NE(FilePath::StringType(), file_name.value()); + const base::FilePath file_name = base_file_->full_path(); + EXPECT_NE(base::FilePath::StringType(), file_name.value()); // Write into the file. set_expected_error(DOWNLOAD_INTERRUPT_REASON_FILE_FAILED); @@ -662,7 +662,7 @@ TEST_F(BaseFileTest, CreatedInDefaultDirectory) { // to be expanded into a path with long names. Thus temp_dir.path() might not // be a string-wise match to base_file_->full_path().DirName() even though // they are in the same directory. - FilePath temp_file; + base::FilePath temp_file; ASSERT_TRUE(file_util::CreateTemporaryFileInDir(temp_dir_.path(), &temp_file)); ASSERT_FALSE(temp_file.empty()); diff --git a/content/browser/download/base_file_win.cc b/content/browser/download/base_file_win.cc index 8f312bb..3f0d9d3 100644 --- a/content/browser/download/base_file_win.cc +++ b/content/browser/download/base_file_win.cc @@ -290,12 +290,12 @@ DownloadInterruptReason MapScanAndSaveErrorCodeToInterruptReason( // gets the correct default security descriptor in the new path. // Returns a network error, or net::OK for success. DownloadInterruptReason BaseFile::MoveFileAndAdjustPermissions( - const FilePath& new_path) { + const base::FilePath& new_path) { base::ThreadRestrictions::AssertIOAllowed(); // The parameters to SHFileOperation must be terminated with 2 NULL chars. - FilePath::StringType source = full_path_.value(); - FilePath::StringType target = new_path.value(); + base::FilePath::StringType source = full_path_.value(); + base::FilePath::StringType target = new_path.value(); source.append(1, L'\0'); target.append(1, L'\0'); diff --git a/content/browser/download/download_browsertest.cc b/content/browser/download/download_browsertest.cc index 1d0bae7..bfae37f 100644 --- a/content/browser/download/download_browsertest.cc +++ b/content/browser/download/download_browsertest.cc @@ -79,7 +79,7 @@ class DownloadFileWithDelay : public DownloadFileImpl { public: DownloadFileWithDelay( scoped_ptr<DownloadSaveInfo> save_info, - const FilePath& default_download_directory, + const base::FilePath& default_download_directory, const GURL& url, const GURL& referrer_url, bool calculate_hash, @@ -95,10 +95,10 @@ class DownloadFileWithDelay : public DownloadFileImpl { // storing it in the factory that produced this object for later // retrieval. virtual void RenameAndUniquify( - const FilePath& full_path, + const base::FilePath& full_path, const RenameCompletionCallback& callback) OVERRIDE; virtual void RenameAndAnnotate( - const FilePath& full_path, + const base::FilePath& full_path, const RenameCompletionCallback& callback) OVERRIDE; private: @@ -106,7 +106,7 @@ class DownloadFileWithDelay : public DownloadFileImpl { DownloadFileWithDelayFactory* factory, const RenameCompletionCallback& original_callback, DownloadInterruptReason reason, - const FilePath& path); + const base::FilePath& path); // This variable may only be read on the FILE thread, and may only be // indirected through (e.g. methods on DownloadFileWithDelayFactory called) @@ -127,7 +127,7 @@ class DownloadFileWithDelayFactory : public DownloadFileFactory { // DownloadFileFactory interface. virtual DownloadFile* CreateFile( scoped_ptr<DownloadSaveInfo> save_info, - const FilePath& default_download_directory, + const base::FilePath& default_download_directory, const GURL& url, const GURL& referrer_url, bool calculate_hash, @@ -151,7 +151,7 @@ class DownloadFileWithDelayFactory : public DownloadFileFactory { DownloadFileWithDelay::DownloadFileWithDelay( scoped_ptr<DownloadSaveInfo> save_info, - const FilePath& default_download_directory, + const base::FilePath& default_download_directory, const GURL& url, const GURL& referrer_url, bool calculate_hash, @@ -169,7 +169,8 @@ DownloadFileWithDelay::DownloadFileWithDelay( DownloadFileWithDelay::~DownloadFileWithDelay() {} void DownloadFileWithDelay::RenameAndUniquify( - const FilePath& full_path, const RenameCompletionCallback& callback) { + const base::FilePath& full_path, + const RenameCompletionCallback& callback) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); DownloadFileImpl::RenameAndUniquify( full_path, base::Bind(DownloadFileWithDelay::RenameCallbackWrapper, @@ -177,7 +178,7 @@ void DownloadFileWithDelay::RenameAndUniquify( } void DownloadFileWithDelay::RenameAndAnnotate( - const FilePath& full_path, const RenameCompletionCallback& callback) { + const base::FilePath& full_path, const RenameCompletionCallback& callback) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); DownloadFileImpl::RenameAndAnnotate( full_path, base::Bind(DownloadFileWithDelay::RenameCallbackWrapper, @@ -189,7 +190,7 @@ void DownloadFileWithDelay::RenameCallbackWrapper( DownloadFileWithDelayFactory* factory, const RenameCompletionCallback& original_callback, DownloadInterruptReason reason, - const FilePath& path) { + const base::FilePath& path) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); factory->AddRenameCallback(base::Bind(original_callback, reason, path)); } @@ -201,7 +202,7 @@ DownloadFileWithDelayFactory::~DownloadFileWithDelayFactory() {} DownloadFile* DownloadFileWithDelayFactory::CreateFile( scoped_ptr<DownloadSaveInfo> save_info, - const FilePath& default_download_directory, + const base::FilePath& default_download_directory, const GURL& url, const GURL& referrer_url, bool calculate_hash, @@ -245,7 +246,7 @@ class CountingDownloadFile : public DownloadFileImpl { public: CountingDownloadFile( scoped_ptr<DownloadSaveInfo> save_info, - const FilePath& default_downloads_directory, + const base::FilePath& default_downloads_directory, const GURL& url, const GURL& referrer_url, bool calculate_hash, @@ -300,7 +301,7 @@ class CountingDownloadFileFactory : public DownloadFileFactory { // DownloadFileFactory interface. virtual DownloadFile* CreateFile( scoped_ptr<DownloadSaveInfo> save_info, - const FilePath& default_downloads_directory, + const base::FilePath& default_downloads_directory, const GURL& url, const GURL& referrer_url, bool calculate_hash, @@ -393,7 +394,7 @@ class DownloadContentTest : public ContentBrowserTest { BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, base::Bind(&URLRequestSlowDownloadJob::AddUrlHandler)); - FilePath mock_base(GetTestFilePath("download", "")); + base::FilePath mock_base(GetTestFilePath("download", "")); BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, base::Bind(&URLRequestMockHTTPJob::AddUrlHandler, mock_base)); @@ -449,7 +450,7 @@ class DownloadContentTest : public ContentBrowserTest { // Checks that |path| is has |file_size| bytes, and matches the |value| // string. - bool VerifyFile(const FilePath& path, + bool VerifyFile(const base::FilePath& path, const std::string& value, const int64 file_size) { std::string file_contents; @@ -531,7 +532,7 @@ IN_PROC_BROWSER_TEST_F(DownloadContentTest, MultiDownload) { DownloadItem* download1 = downloads[0]; // The only download. // Start the second download and wait until it's done. - FilePath file(FILE_PATH_LITERAL("download-test.lib")); + base::FilePath file(FILE_PATH_LITERAL("download-test.lib")); GURL url(URLRequestMockHTTPJob::GetMockUrl(file)); // Download the file and wait. DownloadAndWait(shell(), url, DownloadItem::COMPLETE); @@ -559,13 +560,13 @@ IN_PROC_BROWSER_TEST_F(DownloadContentTest, MultiDownload) { // Verify that the files have the expected data and size. // |file1| should be full of '*'s, and |file2| should be the same as the // source file. - FilePath file1(download1->GetFullPath()); + base::FilePath file1(download1->GetFullPath()); size_t file_size1 = URLRequestSlowDownloadJob::kFirstDownloadSize + URLRequestSlowDownloadJob::kSecondDownloadSize; std::string expected_contents(file_size1, '*'); ASSERT_TRUE(VerifyFile(file1, expected_contents, file_size1)); - FilePath file2(download2->GetFullPath()); + base::FilePath file2(download2->GetFullPath()); ASSERT_TRUE(file_util::ContentsEqual( file2, GetTestFilePath("download", "download-test.lib"))); } @@ -581,7 +582,7 @@ IN_PROC_BROWSER_TEST_F(DownloadContentTest, CancelAtFinalRename) { scoped_ptr<DownloadFileFactory>(file_factory).Pass()); // Create a download - FilePath file(FILE_PATH_LITERAL("download-test.lib")); + base::FilePath file(FILE_PATH_LITERAL("download-test.lib")); NavigateToURL(shell(), URLRequestMockHTTPJob::GetMockUrl(file)); // Wait until the first (intermediate file) rename and execute the callback. @@ -630,7 +631,7 @@ IN_PROC_BROWSER_TEST_F(DownloadContentTest, CancelAtRelease) { scoped_ptr<DownloadFileFactory>(file_factory).Pass()); // Create a download - FilePath file(FILE_PATH_LITERAL("download-test.lib")); + base::FilePath file(FILE_PATH_LITERAL("download-test.lib")); NavigateToURL(shell(), URLRequestMockHTTPJob::GetMockUrl(file)); // Wait until the first (intermediate file) rename and execute the callback. @@ -726,7 +727,7 @@ IN_PROC_BROWSER_TEST_F(DownloadContentTest, ShutdownAtRelease) { scoped_ptr<DownloadFileFactory>(file_factory).Pass()); // Create a download - FilePath file(FILE_PATH_LITERAL("download-test.lib")); + base::FilePath file(FILE_PATH_LITERAL("download-test.lib")); NavigateToURL(shell(), URLRequestMockHTTPJob::GetMockUrl(file)); // Wait until the first (intermediate file) rename and execute the callback. diff --git a/content/browser/download/download_file.h b/content/browser/download/download_file.h index 9f1a2a6..d52f190 100644 --- a/content/browser/download/download_file.h +++ b/content/browser/download/download_file.h @@ -34,7 +34,8 @@ class CONTENT_EXPORT DownloadFile { // was done to. On a failed rename, |reason| will contain the // error. typedef base::Callback<void(DownloadInterruptReason reason, - const FilePath& path)> RenameCompletionCallback; + const base::FilePath& path)> + RenameCompletionCallback; virtual ~DownloadFile() {} @@ -46,13 +47,13 @@ class CONTENT_EXPORT DownloadFile { // Rename the download file to |full_path|. If that file exists // |full_path| will be uniquified by suffixing " (<number>)" to the // file name before the extension. - virtual void RenameAndUniquify(const FilePath& full_path, + virtual void RenameAndUniquify(const base::FilePath& full_path, const RenameCompletionCallback& callback) = 0; // Rename the download file to |full_path| and annotate it with // "Mark of the Web" information about its source. No uniquification // will be performed. - virtual void RenameAndAnnotate(const FilePath& full_path, + virtual void RenameAndAnnotate(const base::FilePath& full_path, const RenameCompletionCallback& callback) = 0; // Detach the file so it is not deleted on destruction. @@ -61,7 +62,7 @@ class CONTENT_EXPORT DownloadFile { // Abort the download and automatically close the file. virtual void Cancel() = 0; - virtual FilePath FullPath() const = 0; + virtual base::FilePath FullPath() const = 0; virtual bool InProgress() const = 0; virtual int64 BytesSoFar() const = 0; virtual int64 CurrentSpeed() const = 0; diff --git a/content/browser/download/download_file_factory.cc b/content/browser/download/download_file_factory.cc index aff2ade..a7fe7b8 100644 --- a/content/browser/download/download_file_factory.cc +++ b/content/browser/download/download_file_factory.cc @@ -13,7 +13,7 @@ DownloadFileFactory::~DownloadFileFactory() {} DownloadFile* DownloadFileFactory::CreateFile( scoped_ptr<DownloadSaveInfo> save_info, - const FilePath& default_downloads_directory, + const base::FilePath& default_downloads_directory, const GURL& url, const GURL& referrer_url, bool calculate_hash, diff --git a/content/browser/download/download_file_factory.h b/content/browser/download/download_file_factory.h index 77d5b68d..7ff9468 100644 --- a/content/browser/download/download_file_factory.h +++ b/content/browser/download/download_file_factory.h @@ -30,7 +30,7 @@ class CONTENT_EXPORT DownloadFileFactory { virtual DownloadFile* CreateFile( scoped_ptr<DownloadSaveInfo> save_info, - const FilePath& default_downloads_directory, + const base::FilePath& default_downloads_directory, const GURL& url, const GURL& referrer_url, bool calculate_hash, diff --git a/content/browser/download/download_file_impl.cc b/content/browser/download/download_file_impl.cc index 0498e1c..259d571 100644 --- a/content/browser/download/download_file_impl.cc +++ b/content/browser/download/download_file_impl.cc @@ -29,7 +29,7 @@ int DownloadFile::number_active_objects_ = 0; DownloadFileImpl::DownloadFileImpl( scoped_ptr<DownloadSaveInfo> save_info, - const FilePath& default_download_directory, + const base::FilePath& default_download_directory, const GURL& url, const GURL& referrer_url, bool calculate_hash, @@ -99,10 +99,11 @@ DownloadInterruptReason DownloadFileImpl::AppendDataToFile( } void DownloadFileImpl::RenameAndUniquify( - const FilePath& full_path, const RenameCompletionCallback& callback) { + const base::FilePath& full_path, + const RenameCompletionCallback& callback) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); - FilePath new_path(full_path); + base::FilePath new_path(full_path); int uniquifier = file_util::GetUniquePathNumber(new_path, FILE_PATH_LITERAL("")); @@ -129,10 +130,11 @@ void DownloadFileImpl::RenameAndUniquify( } void DownloadFileImpl::RenameAndAnnotate( - const FilePath& full_path, const RenameCompletionCallback& callback) { + const base::FilePath& full_path, + const RenameCompletionCallback& callback) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); - FilePath new_path(full_path); + base::FilePath new_path(full_path); DownloadInterruptReason reason = DOWNLOAD_INTERRUPT_REASON_NONE; // Short circuit null rename. @@ -173,7 +175,7 @@ void DownloadFileImpl::Cancel() { file_.Cancel(); } -FilePath DownloadFileImpl::FullPath() const { +base::FilePath DownloadFileImpl::FullPath() const { return file_.full_path(); } diff --git a/content/browser/download/download_file_impl.h b/content/browser/download/download_file_impl.h index e32df90..3be1d0f 100644 --- a/content/browser/download/download_file_impl.h +++ b/content/browser/download/download_file_impl.h @@ -36,7 +36,7 @@ class CONTENT_EXPORT DownloadFileImpl : virtual public DownloadFile { // DownloadDestinationObserver. DownloadFileImpl( scoped_ptr<DownloadSaveInfo> save_info, - const FilePath& default_downloads_directory, + const base::FilePath& default_downloads_directory, const GURL& url, const GURL& referrer_url, bool calculate_hash, @@ -50,14 +50,14 @@ class CONTENT_EXPORT DownloadFileImpl : virtual public DownloadFile { // DownloadFile functions. virtual void Initialize(const InitializeCallback& callback) OVERRIDE; virtual void RenameAndUniquify( - const FilePath& full_path, + const base::FilePath& full_path, const RenameCompletionCallback& callback) OVERRIDE; virtual void RenameAndAnnotate( - const FilePath& full_path, + const base::FilePath& full_path, const RenameCompletionCallback& callback) OVERRIDE; virtual void Detach() OVERRIDE; virtual void Cancel() OVERRIDE; - virtual FilePath FullPath() const OVERRIDE; + virtual base::FilePath FullPath() const OVERRIDE; virtual bool InProgress() const OVERRIDE; virtual int64 BytesSoFar() const OVERRIDE; virtual int64 CurrentSpeed() const OVERRIDE; @@ -81,7 +81,7 @@ class CONTENT_EXPORT DownloadFileImpl : virtual public DownloadFile { BaseFile file_; // The default directory for creating the download file. - FilePath default_download_directory_; + base::FilePath default_download_directory_; // The stream through which data comes. // TODO(rdsmith): Move this into BaseFile; requires using the same diff --git a/content/browser/download/download_file_unittest.cc b/content/browser/download/download_file_unittest.cc index 99165f3..c76ca65 100644 --- a/content/browser/download/download_file_unittest.cc +++ b/content/browser/download/download_file_unittest.cc @@ -133,7 +133,7 @@ class DownloadFileTest : public testing::Test { download_file_.reset( new DownloadFileImpl( save_info.Pass(), - FilePath(), + base::FilePath(), GURL(), // Source GURL(), // Referrer calculate_hash, @@ -246,12 +246,12 @@ class DownloadFileTest : public testing::Test { } DownloadInterruptReason RenameAndUniquify( - const FilePath& full_path, - FilePath* result_path_p) { + const base::FilePath& full_path, + base::FilePath* result_path_p) { base::WeakPtrFactory<DownloadFileTest> weak_ptr_factory(this); DownloadInterruptReason result_reason(DOWNLOAD_INTERRUPT_REASON_NONE); bool callback_was_called(false); - FilePath result_path; + base::FilePath result_path; download_file_->RenameAndUniquify( full_path, base::Bind(&DownloadFileTest::SetRenameResult, @@ -265,12 +265,12 @@ class DownloadFileTest : public testing::Test { } DownloadInterruptReason RenameAndAnnotate( - const FilePath& full_path, - FilePath* result_path_p) { + const base::FilePath& full_path, + base::FilePath* result_path_p) { base::WeakPtrFactory<DownloadFileTest> weak_ptr_factory(this); DownloadInterruptReason result_reason(DOWNLOAD_INTERRUPT_REASON_NONE); bool callback_was_called(false); - FilePath result_path; + base::FilePath result_path; download_file_->RenameAndAnnotate( full_path, base::Bind(&DownloadFileTest::SetRenameResult, @@ -307,9 +307,9 @@ class DownloadFileTest : public testing::Test { private: void SetRenameResult(bool* called_p, DownloadInterruptReason* reason_p, - FilePath* result_path_p, + base::FilePath* result_path_p, DownloadInterruptReason reason, - const FilePath& result_path) { + const base::FilePath& result_path) { if (called_p) *called_p = true; if (reason_p) @@ -342,19 +342,19 @@ const int DownloadFileTest::kDummyRequestId = 67; // has, and after it's closed. TEST_F(DownloadFileTest, RenameFileFinal) { ASSERT_TRUE(CreateDownloadFile(0, true)); - FilePath initial_path(download_file_->FullPath()); + base::FilePath initial_path(download_file_->FullPath()); EXPECT_TRUE(file_util::PathExists(initial_path)); - FilePath path_1(initial_path.InsertBeforeExtensionASCII("_1")); - FilePath path_2(initial_path.InsertBeforeExtensionASCII("_2")); - FilePath path_3(initial_path.InsertBeforeExtensionASCII("_3")); - FilePath path_4(initial_path.InsertBeforeExtensionASCII("_4")); - FilePath path_5(initial_path.InsertBeforeExtensionASCII("_5")); - FilePath output_path; + base::FilePath path_1(initial_path.InsertBeforeExtensionASCII("_1")); + base::FilePath path_2(initial_path.InsertBeforeExtensionASCII("_2")); + base::FilePath path_3(initial_path.InsertBeforeExtensionASCII("_3")); + base::FilePath path_4(initial_path.InsertBeforeExtensionASCII("_4")); + base::FilePath path_5(initial_path.InsertBeforeExtensionASCII("_5")); + base::FilePath output_path; // Rename the file before downloading any data. EXPECT_EQ(DOWNLOAD_INTERRUPT_REASON_NONE, RenameAndUniquify(path_1, &output_path)); - FilePath renamed_path = download_file_->FullPath(); + base::FilePath renamed_path = download_file_->FullPath(); EXPECT_EQ(path_1, renamed_path); EXPECT_EQ(path_1, output_path); @@ -437,10 +437,10 @@ TEST_F(DownloadFileTest, RenameFileFinal) { // and there's a file where we're aiming. TEST_F(DownloadFileTest, RenameUniquifies) { ASSERT_TRUE(CreateDownloadFile(0, true)); - FilePath initial_path(download_file_->FullPath()); + base::FilePath initial_path(download_file_->FullPath()); EXPECT_TRUE(file_util::PathExists(initial_path)); - FilePath path_1(initial_path.InsertBeforeExtensionASCII("_1")); - FilePath path_1_suffixed(path_1.InsertBeforeExtensionASCII(" (1)")); + base::FilePath path_1(initial_path.InsertBeforeExtensionASCII("_1")); + base::FilePath path_1_suffixed(path_1.InsertBeforeExtensionASCII(" (1)")); ASSERT_FALSE(file_util::PathExists(path_1)); static const char file_data[] = "xyzzy"; @@ -459,15 +459,17 @@ TEST_F(DownloadFileTest, RenameUniquifies) { // Test to make sure we get the proper error on failure. TEST_F(DownloadFileTest, RenameError) { ASSERT_TRUE(CreateDownloadFile(0, true)); - FilePath initial_path(download_file_->FullPath()); + base::FilePath initial_path(download_file_->FullPath()); // Create a subdirectory. - FilePath tempdir(initial_path.DirName().Append(FILE_PATH_LITERAL("tempdir"))); + base::FilePath tempdir( + initial_path.DirName().Append(FILE_PATH_LITERAL("tempdir"))); ASSERT_TRUE(file_util::CreateDirectory(tempdir)); - FilePath target_path(tempdir.Append(initial_path.BaseName())); + base::FilePath target_path(tempdir.Append(initial_path.BaseName())); // Targets - FilePath target_path_suffixed(target_path.InsertBeforeExtensionASCII(" (1)")); + base::FilePath target_path_suffixed( + target_path.InsertBeforeExtensionASCII(" (1)")); ASSERT_FALSE(file_util::PathExists(target_path)); ASSERT_FALSE(file_util::PathExists(target_path_suffixed)); @@ -491,7 +493,7 @@ TEST_F(DownloadFileTest, RenameError) { // Various tests of the StreamActive method. TEST_F(DownloadFileTest, StreamEmptySuccess) { ASSERT_TRUE(CreateDownloadFile(0, true)); - FilePath initial_path(download_file_->FullPath()); + base::FilePath initial_path(download_file_->FullPath()); EXPECT_TRUE(file_util::PathExists(initial_path)); // Test that calling the sink_callback_ on an empty stream shouldn't @@ -509,7 +511,7 @@ TEST_F(DownloadFileTest, StreamEmptySuccess) { TEST_F(DownloadFileTest, StreamEmptyError) { ASSERT_TRUE(CreateDownloadFile(0, true)); - FilePath initial_path(download_file_->FullPath()); + base::FilePath initial_path(download_file_->FullPath()); EXPECT_TRUE(file_util::PathExists(initial_path)); // Finish the download in error and make sure we see it on the @@ -536,7 +538,7 @@ TEST_F(DownloadFileTest, StreamEmptyError) { TEST_F(DownloadFileTest, StreamNonEmptySuccess) { ASSERT_TRUE(CreateDownloadFile(0, true)); - FilePath initial_path(download_file_->FullPath()); + base::FilePath initial_path(download_file_->FullPath()); EXPECT_TRUE(file_util::PathExists(initial_path)); const char* chunks1[] = { kTestData1, kTestData2 }; @@ -552,7 +554,7 @@ TEST_F(DownloadFileTest, StreamNonEmptySuccess) { TEST_F(DownloadFileTest, StreamNonEmptyError) { ASSERT_TRUE(CreateDownloadFile(0, true)); - FilePath initial_path(download_file_->FullPath()); + base::FilePath initial_path(download_file_->FullPath()); EXPECT_TRUE(file_util::PathExists(initial_path)); const char* chunks1[] = { kTestData1, kTestData2 }; diff --git a/content/browser/download/download_item_impl.cc b/content/browser/download/download_item_impl.cc index 085b7b7..4b2c6ea 100644 --- a/content/browser/download/download_item_impl.cc +++ b/content/browser/download/download_item_impl.cc @@ -57,7 +57,7 @@ namespace content { namespace { -void DeleteDownloadedFile(const FilePath& path) { +void DeleteDownloadedFile(const base::FilePath& path) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); // Make sure we only delete files. @@ -112,8 +112,8 @@ const int DownloadItemImpl::kMaxAutoResumeAttempts = 5; // Constructor for reading from the history service. DownloadItemImpl::DownloadItemImpl(DownloadItemImplDelegate* delegate, DownloadId download_id, - const FilePath& current_path, - const FilePath& target_path, + const base::FilePath& current_path, + const base::FilePath& target_path, const std::vector<GURL>& url_chain, const GURL& referrer_url, const base::Time& start_time, @@ -218,7 +218,7 @@ DownloadItemImpl::DownloadItemImpl( // Constructing for the "Save Page As..." feature: DownloadItemImpl::DownloadItemImpl(DownloadItemImplDelegate* delegate, - const FilePath& path, + const base::FilePath& path, const GURL& url, DownloadId download_id, const std::string& mime_type, @@ -552,28 +552,28 @@ bool DownloadItemImpl::IsSavePackageDownload() const { return is_save_package_download_; } -const FilePath& DownloadItemImpl::GetFullPath() const { +const base::FilePath& DownloadItemImpl::GetFullPath() const { return current_path_; } -const FilePath& DownloadItemImpl::GetTargetFilePath() const { +const base::FilePath& DownloadItemImpl::GetTargetFilePath() const { return target_path_; } -const FilePath& DownloadItemImpl::GetForcedFilePath() const { +const base::FilePath& DownloadItemImpl::GetForcedFilePath() const { // TODO(asanka): Get rid of GetForcedFilePath(). We should instead just // require that clients respect GetTargetFilePath() if it is already set. return forced_file_path_; } // TODO(asanka): Get rid of GetUserVerifiedFilePath(). http://crbug.com/134237. -FilePath DownloadItemImpl::GetUserVerifiedFilePath() const { +base::FilePath DownloadItemImpl::GetUserVerifiedFilePath() const { return (IsDangerous() || danger_type_ == DOWNLOAD_DANGER_TYPE_USER_VALIDATED) ? GetFullPath() : GetTargetFilePath(); } -FilePath DownloadItemImpl::GetFileNameToReportUser() const { +base::FilePath DownloadItemImpl::GetFileNameToReportUser() const { if (!display_name_.empty()) return display_name_; return target_path_.BaseName(); @@ -727,7 +727,7 @@ void DownloadItemImpl::SetOpened(bool opened) { opened_ = opened; } -void DownloadItemImpl::SetDisplayName(const FilePath& name) { +void DownloadItemImpl::SetDisplayName(const base::FilePath& name) { display_name_ = name; } @@ -1132,7 +1132,7 @@ void DownloadItemImpl::OnDownloadFileInitialized( // The target path might be set and the full path empty if we failed // the intermediate rename--re-do file name determination in this case. // TODO(rdsmith,asanka): Clean up this logic. - target_path_ = FilePath(); + target_path_ = base::FilePath(); delegate_->DetermineDownloadTarget( this, base::Bind(&DownloadItemImpl::OnDownloadTargetDetermined, @@ -1142,10 +1142,10 @@ void DownloadItemImpl::OnDownloadFileInitialized( // Called by delegate_ when the download target path has been // determined. void DownloadItemImpl::OnDownloadTargetDetermined( - const FilePath& target_path, + const base::FilePath& target_path, TargetDisposition disposition, DownloadDangerType danger_type, - const FilePath& intermediate_path) { + const base::FilePath& intermediate_path) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); // If the |target_path| is empty, then we consider this download to be @@ -1196,7 +1196,7 @@ void DownloadItemImpl::OnDownloadTargetDetermined( void DownloadItemImpl::OnDownloadRenamedToIntermediateName( DownloadInterruptReason reason, - const FilePath& full_path) { + const base::FilePath& full_path) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); VLOG(20) << __FUNCTION__ << " download=" << DebugString(true); if (DOWNLOAD_INTERRUPT_REASON_NONE != reason) @@ -1278,7 +1278,7 @@ void DownloadItemImpl::OnDownloadCompleting() { void DownloadItemImpl::OnDownloadRenamedToFinalName( DownloadInterruptReason reason, - const FilePath& full_path) { + const base::FilePath& full_path) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK(!is_save_package_download_); @@ -1531,7 +1531,7 @@ void DownloadItemImpl::SetDangerType(DownloadDangerType danger_type) { danger_type_ = danger_type; } -void DownloadItemImpl::SetFullPath(const FilePath& new_path) { +void DownloadItemImpl::SetFullPath(const base::FilePath& new_path) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); VLOG(20) << __FUNCTION__ << "()" << " new_path = \"" << new_path.value() << "\"" diff --git a/content/browser/download/download_item_impl.h b/content/browser/download/download_item_impl.h index c0756d6..ad3ef6d 100644 --- a/content/browser/download/download_item_impl.h +++ b/content/browser/download/download_item_impl.h @@ -53,8 +53,8 @@ class CONTENT_EXPORT DownloadItemImpl // |bound_net_log| is constructed externally for our use. DownloadItemImpl(DownloadItemImplDelegate* delegate, DownloadId download_id, - const FilePath& current_path, - const FilePath& target_path, + const base::FilePath& current_path, + const base::FilePath& target_path, const std::vector<GURL>& url_chain, const GURL& referrer_url, const base::Time& start_time, @@ -76,7 +76,7 @@ class CONTENT_EXPORT DownloadItemImpl // Constructing for the "Save Page As..." feature: // |bound_net_log| is constructed externally for our use. DownloadItemImpl(DownloadItemImplDelegate* delegate, - const FilePath& path, + const base::FilePath& path, const GURL& url, DownloadId download_id, const std::string& mime_type, @@ -122,11 +122,11 @@ class CONTENT_EXPORT DownloadItemImpl virtual const std::string& GetLastModifiedTime() const OVERRIDE; virtual const std::string& GetETag() const OVERRIDE; virtual bool IsSavePackageDownload() const OVERRIDE; - virtual const FilePath& GetFullPath() const OVERRIDE; - virtual const FilePath& GetTargetFilePath() const OVERRIDE; - virtual const FilePath& GetForcedFilePath() const OVERRIDE; - virtual FilePath GetUserVerifiedFilePath() const OVERRIDE; - virtual FilePath GetFileNameToReportUser() const OVERRIDE; + virtual const base::FilePath& GetFullPath() const OVERRIDE; + virtual const base::FilePath& GetTargetFilePath() const OVERRIDE; + virtual const base::FilePath& GetForcedFilePath() const OVERRIDE; + virtual base::FilePath GetUserVerifiedFilePath() const OVERRIDE; + virtual base::FilePath GetFileNameToReportUser() const OVERRIDE; virtual TargetDisposition GetTargetDisposition() const OVERRIDE; virtual const std::string& GetHash() const OVERRIDE; virtual const std::string& GetHashState() const OVERRIDE; @@ -153,7 +153,7 @@ class CONTENT_EXPORT DownloadItemImpl virtual void SetOpenWhenComplete(bool open) OVERRIDE; virtual void SetIsTemporary(bool temporary) OVERRIDE; virtual void SetOpened(bool opened) OVERRIDE; - virtual void SetDisplayName(const FilePath& name) OVERRIDE; + virtual void SetDisplayName(const base::FilePath& name) OVERRIDE; virtual std::string DebugString(bool verbose) const OVERRIDE; // All remaining public interfaces virtual to allow for DownloadItemImpl @@ -261,16 +261,16 @@ class CONTENT_EXPORT DownloadItemImpl // |target_path| as determined by the caller. |intermediate_path| is the path // to use to store the download until OnDownloadCompleting() is called. virtual void OnDownloadTargetDetermined( - const FilePath& target_path, + const base::FilePath& target_path, TargetDisposition disposition, DownloadDangerType danger_type, - const FilePath& intermediate_path); + const base::FilePath& intermediate_path); // Callback from file thread when we initialize the DownloadFile. void OnDownloadFileInitialized(DownloadInterruptReason result); void OnDownloadRenamedToIntermediateName( - DownloadInterruptReason reason, const FilePath& full_path); + DownloadInterruptReason reason, const base::FilePath& full_path); // If all pre-requisites have been met, complete download processing, i.e. do // internal cleanup, file rename, and potentially auto-open. (Dangerous @@ -283,7 +283,7 @@ class CONTENT_EXPORT DownloadItemImpl void OnDownloadCompleting(); void OnDownloadRenamedToFinalName(DownloadInterruptReason reason, - const FilePath& full_path); + const base::FilePath& full_path); // Called if the embedder took over opening a download, to indicate that // the download has been opened. @@ -312,7 +312,7 @@ class CONTENT_EXPORT DownloadItemImpl // Set the |danger_type_| and invoke obserers if necessary. void SetDangerType(DownloadDangerType danger_type); - void SetFullPath(const FilePath& new_path); + void SetFullPath(const base::FilePath& new_path); void AutoResumeIfValid(); @@ -338,18 +338,18 @@ class CONTENT_EXPORT DownloadItemImpl // Display name for the download. If this is empty, then the display name is // considered to be |target_path_.BaseName()|. - FilePath display_name_; + base::FilePath display_name_; // Full path to the downloaded or downloading file. This is the path to the // physical file, if one exists. The final target path is specified by // |target_path_|. |current_path_| can be empty if the in-progress path hasn't // been determined. - FilePath current_path_; + base::FilePath current_path_; // Target path of an in-progress download. We may be downloading to a // temporary or intermediate file (specified by |current_path_|. Once the // download completes, we will rename the file to |target_path_|. - FilePath target_path_; + base::FilePath target_path_; // Whether the target should be overwritten, uniquified or prompted for. TargetDisposition target_disposition_; @@ -367,7 +367,7 @@ class CONTENT_EXPORT DownloadItemImpl // If non-empty, contains an externally supplied path that should be used as // the target path. - FilePath forced_file_path_; + base::FilePath forced_file_path_; // Page transition that triggerred the download. PageTransition transition_type_; diff --git a/content/browser/download/download_item_impl_delegate.cc b/content/browser/download/download_item_impl_delegate.cc index 02175ca..996cc4f 100644 --- a/content/browser/download/download_item_impl_delegate.cc +++ b/content/browser/download/download_item_impl_delegate.cc @@ -30,7 +30,7 @@ void DownloadItemImplDelegate::Detach() { void DownloadItemImplDelegate::DetermineDownloadTarget( DownloadItemImpl* download, const DownloadTargetCallback& callback) { // TODO(rdsmith/asanka): Do something useful if forced file path is null. - FilePath target_path(download->GetForcedFilePath()); + base::FilePath target_path(download->GetForcedFilePath()); callback.Run(target_path, DownloadItem::TARGET_DISPOSITION_OVERWRITE, DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, @@ -49,7 +49,7 @@ bool DownloadItemImplDelegate::ShouldOpenDownload( } bool DownloadItemImplDelegate::ShouldOpenFileBasedOnExtension( - const FilePath& path) { + const base::FilePath& path) { return false; } diff --git a/content/browser/download/download_item_impl_delegate.h b/content/browser/download/download_item_impl_delegate.h index b6eebac..63b4717 100644 --- a/content/browser/download/download_item_impl_delegate.h +++ b/content/browser/download/download_item_impl_delegate.h @@ -23,10 +23,10 @@ class BrowserContext; class CONTENT_EXPORT DownloadItemImplDelegate { public: typedef base::Callback<void( - const FilePath&, // Target path + const base::FilePath&, // Target path DownloadItem::TargetDisposition, // overwrite/uniquify target DownloadDangerType, - const FilePath& // Intermediate file path + const base::FilePath& // Intermediate file path )> DownloadTargetCallback; // The boolean argument indicates whether or not the download was @@ -58,7 +58,7 @@ class CONTENT_EXPORT DownloadItemImplDelegate { DownloadItemImpl* download, const ShouldOpenDownloadCallback& callback); // Tests if a file type should be opened automatically. - virtual bool ShouldOpenFileBasedOnExtension(const FilePath& path); + virtual bool ShouldOpenFileBasedOnExtension(const base::FilePath& path); // Checks whether a downloaded file still exists and updates the // file's state if the file is already removed. diff --git a/content/browser/download/download_item_impl_unittest.cc b/content/browser/download/download_item_impl_unittest.cc index 8542880..939c517 100644 --- a/content/browser/download/download_item_impl_unittest.cc +++ b/content/browser/download/download_item_impl_unittest.cc @@ -35,7 +35,7 @@ namespace { const int kDownloadChunkSize = 1000; const int kDownloadSpeed = 1000; const int kDummyDBHandle = 10; -const FilePath::CharType kDummyPath[] = FILE_PATH_LITERAL("/testpath"); +const base::FilePath::CharType kDummyPath[] = FILE_PATH_LITERAL("/testpath"); } // namespace @@ -57,7 +57,7 @@ class MockDelegate : public DownloadItemImplDelegate { bool(DownloadItemImpl*, const base::Closure&)); MOCK_METHOD2(ShouldOpenDownload, bool(DownloadItemImpl*, const ShouldOpenDownloadCallback&)); - MOCK_METHOD1(ShouldOpenFileBasedOnExtension, bool(const FilePath&)); + MOCK_METHOD1(ShouldOpenFileBasedOnExtension, bool(const base::FilePath&)); MOCK_METHOD1(CheckForFileRemoval, void(DownloadItemImpl*)); virtual void ResumeInterruptedDownload( @@ -283,8 +283,9 @@ class DownloadItemTest : public testing::Test { DownloadItemImplDelegate::DownloadTargetCallback callback; MockDownloadFile* download_file = AddDownloadFileToDownloadItem(item, &callback); - FilePath target_path(kDummyPath); - FilePath intermediate_path(target_path.InsertBeforeExtensionASCII("x")); + base::FilePath target_path(kDummyPath); + base::FilePath intermediate_path( + target_path.InsertBeforeExtensionASCII("x")); EXPECT_CALL(*download_file, RenameAndUniquify(intermediate_path, _)) .WillOnce(ScheduleRenameCallback(DOWNLOAD_INTERRUPT_REASON_NONE, intermediate_path)); @@ -564,9 +565,10 @@ TEST_F(DownloadItemTest, NotificationAfterOnDownloadTargetDetermined) { MockDownloadFile* download_file = AddDownloadFileToDownloadItem(item, &callback); MockObserver observer(item); - FilePath target_path(kDummyPath); - FilePath intermediate_path(target_path.InsertBeforeExtensionASCII("x")); - FilePath new_intermediate_path(target_path.InsertBeforeExtensionASCII("y")); + base::FilePath target_path(kDummyPath); + base::FilePath intermediate_path(target_path.InsertBeforeExtensionASCII("x")); + base::FilePath new_intermediate_path( + target_path.InsertBeforeExtensionASCII("y")); EXPECT_CALL(*download_file, RenameAndUniquify(intermediate_path, _)) .WillOnce(ScheduleRenameCallback(DOWNLOAD_INTERRUPT_REASON_NONE, new_intermediate_path)); @@ -614,8 +616,8 @@ TEST_F(DownloadItemTest, DisplayName) { DownloadItemImplDelegate::DownloadTargetCallback callback; MockDownloadFile* download_file = AddDownloadFileToDownloadItem(item, &callback); - FilePath target_path(FilePath(kDummyPath).AppendASCII("foo.bar")); - FilePath intermediate_path(target_path.InsertBeforeExtensionASCII("x")); + base::FilePath target_path(base::FilePath(kDummyPath).AppendASCII("foo.bar")); + base::FilePath intermediate_path(target_path.InsertBeforeExtensionASCII("x")); EXPECT_EQ(FILE_PATH_LITERAL(""), item->GetFileNameToReportUser().value()); EXPECT_CALL(*download_file, RenameAndUniquify(_, _)) @@ -627,7 +629,7 @@ TEST_F(DownloadItemTest, DisplayName) { RunAllPendingInMessageLoops(); EXPECT_EQ(FILE_PATH_LITERAL("foo.bar"), item->GetFileNameToReportUser().value()); - item->SetDisplayName(FilePath(FILE_PATH_LITERAL("new.name"))); + item->SetDisplayName(base::FilePath(FILE_PATH_LITERAL("new.name"))); EXPECT_EQ(FILE_PATH_LITERAL("new.name"), item->GetFileNameToReportUser().value()); CleanupItem(item, download_file, DownloadItem::IN_PROGRESS); @@ -653,9 +655,10 @@ TEST_F(DownloadItemTest, CallbackAfterRename) { DownloadItemImplDelegate::DownloadTargetCallback callback; MockDownloadFile* download_file = AddDownloadFileToDownloadItem(item, &callback); - FilePath final_path(FilePath(kDummyPath).AppendASCII("foo.bar")); - FilePath intermediate_path(final_path.InsertBeforeExtensionASCII("x")); - FilePath new_intermediate_path(final_path.InsertBeforeExtensionASCII("y")); + base::FilePath final_path(base::FilePath(kDummyPath).AppendASCII("foo.bar")); + base::FilePath intermediate_path(final_path.InsertBeforeExtensionASCII("x")); + base::FilePath new_intermediate_path( + final_path.InsertBeforeExtensionASCII("y")); EXPECT_CALL(*download_file, RenameAndUniquify(intermediate_path, _)) .WillOnce(ScheduleRenameCallback(DOWNLOAD_INTERRUPT_REASON_NONE, new_intermediate_path)); @@ -688,9 +691,10 @@ TEST_F(DownloadItemTest, CallbackAfterInterruptedRename) { DownloadItemImplDelegate::DownloadTargetCallback callback; MockDownloadFile* download_file = AddDownloadFileToDownloadItem(item, &callback); - FilePath final_path(FilePath(kDummyPath).AppendASCII("foo.bar")); - FilePath intermediate_path(final_path.InsertBeforeExtensionASCII("x")); - FilePath new_intermediate_path(final_path.InsertBeforeExtensionASCII("y")); + base::FilePath final_path(base::FilePath(kDummyPath).AppendASCII("foo.bar")); + base::FilePath intermediate_path(final_path.InsertBeforeExtensionASCII("x")); + base::FilePath new_intermediate_path( + final_path.InsertBeforeExtensionASCII("y")); EXPECT_CALL(*download_file, RenameAndUniquify(intermediate_path, _)) .WillOnce(ScheduleRenameCallback(DOWNLOAD_INTERRUPT_REASON_FILE_FAILED, new_intermediate_path)); @@ -837,7 +841,7 @@ TEST_F(DownloadItemTest, EnabledActionsForNormalDownload) { // Complete EXPECT_CALL(*download_file, RenameAndAnnotate(_, _)) .WillOnce(ScheduleRenameCallback(DOWNLOAD_INTERRUPT_REASON_NONE, - FilePath(kDummyPath))); + base::FilePath(kDummyPath))); EXPECT_CALL(*mock_delegate(), ShouldCompleteDownload(item, _)) .WillOnce(Return(true)); EXPECT_CALL(*download_file, Detach()); @@ -866,7 +870,7 @@ TEST_F(DownloadItemTest, EnabledActionsForTemporaryDownload) { .WillOnce(Return(true)); EXPECT_CALL(*download_file, RenameAndAnnotate(_, _)) .WillOnce(ScheduleRenameCallback(DOWNLOAD_INTERRUPT_REASON_NONE, - FilePath(kDummyPath))); + base::FilePath(kDummyPath))); EXPECT_CALL(*download_file, Detach()); item->DestinationObserverAsWeakPtr()->DestinationCompleted(""); RunAllPendingInMessageLoops(); @@ -921,9 +925,9 @@ TEST_F(DownloadItemTest, CompleteDelegate_ReturnTrue) { EXPECT_FALSE(item->IsDangerous()); // Make sure the download can complete. - EXPECT_CALL(*download_file, RenameAndAnnotate(FilePath(kDummyPath), _)) + EXPECT_CALL(*download_file, RenameAndAnnotate(base::FilePath(kDummyPath), _)) .WillOnce(ScheduleRenameCallback(DOWNLOAD_INTERRUPT_REASON_NONE, - FilePath(kDummyPath))); + base::FilePath(kDummyPath))); EXPECT_CALL(*mock_delegate(), ShouldOpenDownload(item, _)) .WillOnce(Return(true)); EXPECT_CALL(*download_file, Detach()); @@ -956,9 +960,9 @@ TEST_F(DownloadItemTest, CompleteDelegate_BlockOnce) { EXPECT_FALSE(item->IsDangerous()); // Make sure the download can complete. - EXPECT_CALL(*download_file, RenameAndAnnotate(FilePath(kDummyPath), _)) + EXPECT_CALL(*download_file, RenameAndAnnotate(base::FilePath(kDummyPath), _)) .WillOnce(ScheduleRenameCallback(DOWNLOAD_INTERRUPT_REASON_NONE, - FilePath(kDummyPath))); + base::FilePath(kDummyPath))); EXPECT_CALL(*mock_delegate(), ShouldOpenDownload(item, _)) .WillOnce(Return(true)); EXPECT_CALL(*download_file, Detach()); @@ -994,9 +998,9 @@ TEST_F(DownloadItemTest, CompleteDelegate_SetDanger) { EXPECT_TRUE(item->IsDangerous()); // Make sure the download doesn't complete until we've validated it. - EXPECT_CALL(*download_file, RenameAndAnnotate(FilePath(kDummyPath), _)) + EXPECT_CALL(*download_file, RenameAndAnnotate(base::FilePath(kDummyPath), _)) .WillOnce(ScheduleRenameCallback(DOWNLOAD_INTERRUPT_REASON_NONE, - FilePath(kDummyPath))); + base::FilePath(kDummyPath))); EXPECT_CALL(*mock_delegate(), ShouldOpenDownload(item, _)) .WillOnce(Return(true)); EXPECT_CALL(*download_file, Detach()); @@ -1042,9 +1046,9 @@ TEST_F(DownloadItemTest, CompleteDelegate_BlockTwice) { EXPECT_FALSE(item->IsDangerous()); // Make sure the download can complete. - EXPECT_CALL(*download_file, RenameAndAnnotate(FilePath(kDummyPath), _)) + EXPECT_CALL(*download_file, RenameAndAnnotate(base::FilePath(kDummyPath), _)) .WillOnce(ScheduleRenameCallback(DOWNLOAD_INTERRUPT_REASON_NONE, - FilePath(kDummyPath))); + base::FilePath(kDummyPath))); EXPECT_CALL(*mock_delegate(), ShouldOpenDownload(item, _)) .WillOnce(Return(true)); EXPECT_CALL(*download_file, Detach()); diff --git a/content/browser/download/download_manager_impl.cc b/content/browser/download/download_manager_impl.cc index 8975b4d..2441a74 100644 --- a/content/browser/download/download_manager_impl.cc +++ b/content/browser/download/download_manager_impl.cc @@ -168,8 +168,8 @@ class DownloadItemFactoryImpl : public DownloadItemFactory { virtual DownloadItemImpl* CreatePersistedItem( DownloadItemImplDelegate* delegate, DownloadId download_id, - const FilePath& current_path, - const FilePath& target_path, + const base::FilePath& current_path, + const base::FilePath& target_path, const std::vector<GURL>& url_chain, const GURL& referrer_url, const base::Time& start_time, @@ -208,7 +208,7 @@ class DownloadItemFactoryImpl : public DownloadItemFactory { virtual DownloadItemImpl* CreateSavePageItem( DownloadItemImplDelegate* delegate, - const FilePath& path, + const base::FilePath& path, const GURL& url, DownloadId download_id, const std::string& mime_type, @@ -255,7 +255,7 @@ void DownloadManagerImpl::DetermineDownloadTarget( // type. If the types ever diverge, gasket code will need to // be written here. if (!delegate_ || !delegate_->DetermineDownloadTarget(item, callback)) { - FilePath target_path = item->GetForcedFilePath(); + base::FilePath target_path = item->GetForcedFilePath(); // TODO(asanka): Determine a useful path if |target_path| is empty. callback.Run(target_path, DownloadItem::TARGET_DISPOSITION_OVERWRITE, @@ -275,7 +275,8 @@ bool DownloadManagerImpl::ShouldCompleteDownload( return false; } -bool DownloadManagerImpl::ShouldOpenFileBasedOnExtension(const FilePath& path) { +bool DownloadManagerImpl::ShouldOpenFileBasedOnExtension( + const base::FilePath& path) { if (!delegate_) return false; @@ -366,10 +367,10 @@ DownloadItem* DownloadManagerImpl::StartDownload( scoped_ptr<ByteStreamReader> stream) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - FilePath default_download_directory; + base::FilePath default_download_directory; if (delegate_) { - FilePath website_save_directory; // Unused - bool skip_dir_check = false; // Unused + base::FilePath website_save_directory; // Unused + bool skip_dir_check = false; // Unused delegate_->GetSaveDir(GetBrowserContext(), &website_save_directory, &default_download_directory, &skip_dir_check); } @@ -454,7 +455,7 @@ DownloadItemImpl* DownloadManagerImpl::GetOrCreateDownloadItem( } DownloadItemImpl* DownloadManagerImpl::CreateSavePackageDownloadItem( - const FilePath& main_file_path, + const base::FilePath& main_file_path, const GURL& page_url, const std::string& mime_type, DownloadItem::Observer* observer) { @@ -596,8 +597,8 @@ void DownloadManagerImpl::RemoveObserver(Observer* observer) { } DownloadItem* DownloadManagerImpl::CreateDownloadItem( - const FilePath& current_path, - const FilePath& target_path, + const base::FilePath& current_path, + const base::FilePath& target_path, const std::vector<GURL>& url_chain, const GURL& referrer_url, const base::Time& start_time, diff --git a/content/browser/download/download_manager_impl.h b/content/browser/download/download_manager_impl.h index e924a95..ebd58f8 100644 --- a/content/browser/download/download_manager_impl.h +++ b/content/browser/download/download_manager_impl.h @@ -42,7 +42,7 @@ class CONTENT_EXPORT DownloadManagerImpl : public DownloadManager, // Must be called on the UI thread. Note that the DownloadManager // retains ownership. virtual DownloadItemImpl* CreateSavePackageDownloadItem( - const FilePath& main_file_path, + const base::FilePath& main_file_path, const GURL& page_url, const std::string& mime_type, DownloadItem::Observer* observer); @@ -68,8 +68,8 @@ class CONTENT_EXPORT DownloadManagerImpl : public DownloadManager, virtual void AddObserver(Observer* observer) OVERRIDE; virtual void RemoveObserver(Observer* observer) OVERRIDE; virtual content::DownloadItem* CreateDownloadItem( - const FilePath& current_path, - const FilePath& target_path, + const base::FilePath& current_path, + const base::FilePath& target_path, const std::vector<GURL>& url_chain, const GURL& referrer_url, const base::Time& start_time, @@ -128,7 +128,8 @@ class CONTENT_EXPORT DownloadManagerImpl : public DownloadManager, DownloadItemImpl* item, const DownloadTargetCallback& callback) OVERRIDE; virtual bool ShouldCompleteDownload( DownloadItemImpl* item, const base::Closure& complete_callback) OVERRIDE; - virtual bool ShouldOpenFileBasedOnExtension(const FilePath& path) OVERRIDE; + virtual bool ShouldOpenFileBasedOnExtension( + const base::FilePath& path) OVERRIDE; virtual bool ShouldOpenDownload( DownloadItemImpl* item, const ShouldOpenDownloadCallback& callback) OVERRIDE; diff --git a/content/browser/download/download_manager_impl_unittest.cc b/content/browser/download/download_manager_impl_unittest.cc index 517173c..41912e4 100644 --- a/content/browser/download/download_manager_impl_unittest.cc +++ b/content/browser/download/download_manager_impl_unittest.cc @@ -68,8 +68,8 @@ class MockDownloadItemImpl : public DownloadItemImpl { : DownloadItemImpl( delegate, content::DownloadId(), - FilePath(), - FilePath(), + base::FilePath(), + base::FilePath(), std::vector<GURL>(), GURL(), base::Time(), @@ -84,8 +84,8 @@ class MockDownloadItemImpl : public DownloadItemImpl { virtual ~MockDownloadItemImpl() {} MOCK_METHOD4(OnDownloadTargetDetermined, - void(const FilePath&, TargetDisposition, - DownloadDangerType, const FilePath&)); + void(const base::FilePath&, TargetDisposition, + DownloadDangerType, const base::FilePath&)); MOCK_METHOD1(AddObserver, void(DownloadItem::Observer*)); MOCK_METHOD1(RemoveObserver, void(DownloadItem::Observer*)); MOCK_METHOD0(UpdateObservers, void()); @@ -120,8 +120,8 @@ class MockDownloadItemImpl : public DownloadItemImpl { MOCK_CONST_METHOD0(IsCancelled, bool()); MOCK_CONST_METHOD0(IsInterrupted, bool()); MOCK_CONST_METHOD0(IsComplete, bool()); - MOCK_CONST_METHOD0(GetFullPath, const FilePath&()); - MOCK_CONST_METHOD0(GetTargetFilePath, const FilePath&()); + MOCK_CONST_METHOD0(GetFullPath, const base::FilePath&()); + MOCK_CONST_METHOD0(GetTargetFilePath, const base::FilePath&()); MOCK_CONST_METHOD0(GetTargetDisposition, TargetDisposition()); MOCK_METHOD1(OnContentCheckCompleted, void(DownloadDangerType)); MOCK_CONST_METHOD0(GetState, DownloadState()); @@ -152,7 +152,7 @@ class MockDownloadItemImpl : public DownloadItemImpl { MOCK_CONST_METHOD0(GetDangerType, DownloadDangerType()); MOCK_CONST_METHOD0(IsDangerous, bool()); MOCK_METHOD0(GetAutoOpened, bool()); - MOCK_CONST_METHOD0(GetForcedFilePath, const FilePath&()); + MOCK_CONST_METHOD0(GetForcedFilePath, const base::FilePath&()); MOCK_CONST_METHOD0(HasUserGesture, bool()); MOCK_CONST_METHOD0(GetTransitionType, PageTransition()); MOCK_CONST_METHOD0(IsTemporary, bool()); @@ -164,9 +164,9 @@ class MockDownloadItemImpl : public DownloadItemImpl { MOCK_CONST_METHOD0(GetLastReason, DownloadInterruptReason()); MOCK_CONST_METHOD0(GetBrowserContext, BrowserContext*()); MOCK_CONST_METHOD0(GetWebContents, WebContents*()); - MOCK_CONST_METHOD0(GetFileNameToReportUser, FilePath()); - MOCK_METHOD1(SetDisplayName, void(const FilePath&)); - MOCK_CONST_METHOD0(GetUserVerifiedFilePath, FilePath()); + MOCK_CONST_METHOD0(GetFileNameToReportUser, base::FilePath()); + MOCK_METHOD1(SetDisplayName, void(const base::FilePath&)); + MOCK_CONST_METHOD0(GetUserVerifiedFilePath, base::FilePath()); // May be called when vlog is on. virtual std::string DebugString(bool verbose) const OVERRIDE { return ""; } }; @@ -182,16 +182,16 @@ class MockDownloadManagerDelegate : public DownloadManagerDelegate { bool(DownloadItem* item, const DownloadTargetCallback&)); MOCK_METHOD0(GetAlternativeWebContentsToNotifyForDownload, WebContents*()); - MOCK_METHOD1(ShouldOpenFileBasedOnExtension, bool(const FilePath&)); + MOCK_METHOD1(ShouldOpenFileBasedOnExtension, bool(const base::FilePath&)); MOCK_METHOD2(ShouldCompleteDownload, bool(DownloadItem*, const base::Closure&)); MOCK_METHOD2(ShouldOpenDownload, bool(DownloadItem*, const DownloadOpenDelayedCallback&)); MOCK_METHOD0(GenerateFileHash, bool()); MOCK_METHOD4(GetSaveDir, void(BrowserContext*, - FilePath*, FilePath*, bool*)); + base::FilePath*, base::FilePath*, bool*)); MOCK_METHOD5(ChooseSavePath, void( - WebContents*, const FilePath&, const FilePath::StringType&, + WebContents*, const base::FilePath&, const base::FilePath::StringType&, bool, const SavePackagePathPickedCallback&)); }; @@ -225,8 +225,8 @@ class MockDownloadItemFactory virtual DownloadItemImpl* CreatePersistedItem( DownloadItemImplDelegate* delegate, DownloadId download_id, - const FilePath& current_path, - const FilePath& target_path, + const base::FilePath& current_path, + const base::FilePath& target_path, const std::vector<GURL>& url_chain, const GURL& referrer_url, const base::Time& start_time, @@ -244,7 +244,7 @@ class MockDownloadItemFactory const net::BoundNetLog& bound_net_log) OVERRIDE; virtual DownloadItemImpl* CreateSavePageItem( DownloadItemImplDelegate* delegate, - const FilePath& path, + const base::FilePath& path, const GURL& url, DownloadId download_id, const std::string& mime_type, @@ -286,8 +286,8 @@ void MockDownloadItemFactory::RemoveItem(int id) { DownloadItemImpl* MockDownloadItemFactory::CreatePersistedItem( DownloadItemImplDelegate* delegate, DownloadId download_id, - const FilePath& current_path, - const FilePath& target_path, + const base::FilePath& current_path, + const base::FilePath& target_path, const std::vector<GURL>& url_chain, const GURL& referrer_url, const base::Time& start_time, @@ -335,7 +335,7 @@ DownloadItemImpl* MockDownloadItemFactory::CreateActiveItem( DownloadItemImpl* MockDownloadItemFactory::CreateSavePageItem( DownloadItemImplDelegate* delegate, - const FilePath& path, + const base::FilePath& path, const GURL& url, DownloadId download_id, const std::string& mime_type, @@ -362,7 +362,7 @@ class MockDownloadFileFactory // Overridden method from DownloadFileFactory MOCK_METHOD8(MockCreateFile, DownloadFile*( const DownloadSaveInfo&, - const FilePath&, + const base::FilePath&, const GURL&, const GURL&, bool, ByteStreamReader*, const net::BoundNetLog&, @@ -370,7 +370,7 @@ class MockDownloadFileFactory virtual DownloadFile* CreateFile( scoped_ptr<DownloadSaveInfo> save_info, - const FilePath& default_download_directory, + const base::FilePath& default_download_directory, const GURL& url, const GURL& referrer_url, bool calculate_hash, @@ -388,21 +388,21 @@ class MockBrowserContext : public BrowserContext { MockBrowserContext() {} ~MockBrowserContext() {} - MOCK_METHOD0(GetPath, FilePath()); + MOCK_METHOD0(GetPath, base::FilePath()); MOCK_CONST_METHOD0(IsOffTheRecord, bool()); MOCK_METHOD0(GetRequestContext, net::URLRequestContextGetter*()); MOCK_METHOD1(GetRequestContextForRenderProcess, net::URLRequestContextGetter*(int renderer_child_id)); MOCK_METHOD2(GetRequestContextForStoragePartition, net::URLRequestContextGetter*( - const FilePath& partition_path, bool in_memory)); + const base::FilePath& partition_path, bool in_memory)); MOCK_METHOD0(GetMediaRequestContext, net::URLRequestContextGetter*()); MOCK_METHOD1(GetMediaRequestContextForRenderProcess, net::URLRequestContextGetter*(int renderer_child_id)); MOCK_METHOD2(GetMediaRequestContextForStoragePartition, net::URLRequestContextGetter*( - const FilePath& partition_path, bool in_memory)); + const base::FilePath& partition_path, bool in_memory)); MOCK_METHOD0(GetResourceContext, ResourceContext*()); MOCK_METHOD0(GetDownloadManagerDelegate, DownloadManagerDelegate*()); MOCK_METHOD0(GetGeolocationPermissionContext, @@ -535,10 +535,10 @@ class DownloadManagerTest : public testing::Test { } void DownloadTargetDeterminedCallback( - const FilePath& target_path, + const base::FilePath& target_path, DownloadItem::TargetDisposition disposition, DownloadDangerType danger_type, - const FilePath& intermediate_path) { + const base::FilePath& intermediate_path) { callback_called_ = true; target_path_ = target_path; target_disposition_ = disposition; @@ -575,10 +575,10 @@ class DownloadManagerTest : public testing::Test { // Target detetermined callback. bool callback_called_; - FilePath target_path_; + base::FilePath target_path_; DownloadItem::TargetDisposition target_disposition_; DownloadDangerType danger_type_; - FilePath intermediate_path_; + base::FilePath intermediate_path_; private: MessageLoopForUI message_loop_; @@ -598,7 +598,7 @@ TEST_F(DownloadManagerTest, StartDownload) { scoped_ptr<DownloadCreateInfo> info(new DownloadCreateInfo); scoped_ptr<ByteStreamReader> stream; int32 local_id(5); // Random value - FilePath download_path(FILE_PATH_LITERAL("download/path")); + base::FilePath download_path(FILE_PATH_LITERAL("download/path")); EXPECT_FALSE(download_manager_->GetDownload(local_id)); @@ -639,7 +639,7 @@ TEST_F(DownloadManagerTest, DetermineDownloadTarget_False) { // Put a mock we have a handle to on the download manager. MockDownloadItemImpl& item(AddItemToManager()); - FilePath path(FILE_PATH_LITERAL("random_filepath.txt")); + base::FilePath path(FILE_PATH_LITERAL("random_filepath.txt")); EXPECT_CALL(GetMockDownloadManagerDelegate(), DetermineDownloadTarget(&item, _)) .WillOnce(Return(false)); diff --git a/content/browser/download/download_net_log_parameters.cc b/content/browser/download/download_net_log_parameters.cc index 8d8e403..a987864 100644 --- a/content/browser/download/download_net_log_parameters.cc +++ b/content/browser/download/download_net_log_parameters.cc @@ -72,8 +72,8 @@ base::Value* ItemCheckedNetLogCallback( return dict; } -base::Value* ItemRenamedNetLogCallback(const FilePath* old_filename, - const FilePath* new_filename, +base::Value* ItemRenamedNetLogCallback(const base::FilePath* old_filename, + const base::FilePath* new_filename, net::NetLog::LogLevel log_level) { DictionaryValue* dict = new DictionaryValue(); @@ -146,7 +146,7 @@ base::Value* ItemCanceledNetLogCallback(int64 bytes_so_far, return dict; } -base::Value* FileOpenedNetLogCallback(const FilePath* file_name, +base::Value* FileOpenedNetLogCallback(const base::FilePath* file_name, int64 start_offset, net::NetLog::LogLevel log_level) { DictionaryValue* dict = new DictionaryValue(); @@ -168,8 +168,8 @@ base::Value* FileStreamDrainedNetLogCallback(size_t stream_size, return dict; } -base::Value* FileRenamedNetLogCallback(const FilePath* old_filename, - const FilePath* new_filename, +base::Value* FileRenamedNetLogCallback(const base::FilePath* old_filename, + const base::FilePath* new_filename, net::NetLog::LogLevel log_level) { DictionaryValue* dict = new DictionaryValue(); diff --git a/content/browser/download/drag_download_file.cc b/content/browser/download/drag_download_file.cc index c1ea02e..d87a7e0 100644 --- a/content/browser/download/drag_download_file.cc +++ b/content/browser/download/drag_download_file.cc @@ -55,7 +55,7 @@ class DragDownloadFile::DragDownloadFileUI : public DownloadItem::Observer { } void InitiateDownload(scoped_ptr<net::FileStream> file_stream, - const FilePath& file_path) { + const base::FilePath& file_path) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DownloadManager* download_manager = BrowserContext::GetDownloadManager(web_contents_->GetBrowserContext()); @@ -146,7 +146,7 @@ class DragDownloadFile::DragDownloadFileUI : public DownloadItem::Observer { DISALLOW_COPY_AND_ASSIGN(DragDownloadFileUI); }; -DragDownloadFile::DragDownloadFile(const FilePath& file_path, +DragDownloadFile::DragDownloadFile(const base::FilePath& file_path, scoped_ptr<net::FileStream> file_stream, const GURL& url, const Referrer& referrer, diff --git a/content/browser/download/drag_download_file.h b/content/browser/download/drag_download_file.h index 35c41c8b..32c8afe 100644 --- a/content/browser/download/drag_download_file.h +++ b/content/browser/download/drag_download_file.h @@ -40,7 +40,7 @@ class CONTENT_EXPORT DragDownloadFile : public ui::DownloadFileProvider { // download into a file stream that has already been created, so only the UI // thread is involved. |file_stream| must be null on windows but non-null on // posix systems. |file_path| is an absolute path on all systems. - DragDownloadFile(const FilePath& file_path, + DragDownloadFile(const base::FilePath& file_path, scoped_ptr<net::FileStream> file_stream, const GURL& url, const Referrer& referrer, @@ -61,7 +61,7 @@ class CONTENT_EXPORT DragDownloadFile : public ui::DownloadFileProvider { void DownloadCompleted(bool is_successful); void CheckThread(); - FilePath file_path_; + base::FilePath file_path_; scoped_ptr<net::FileStream> file_stream_; MessageLoop* drag_message_loop_; State state_; diff --git a/content/browser/download/drag_download_file_browsertest.cc b/content/browser/download/drag_download_file_browsertest.cc index 58e9014..83daf02 100644 --- a/content/browser/download/drag_download_file_browsertest.cc +++ b/content/browser/download/drag_download_file_browsertest.cc @@ -37,7 +37,7 @@ class MockDownloadFileObserver : public ui::DownloadFileObserver { public: MockDownloadFileObserver() {} - MOCK_METHOD1(OnDownloadCompleted, void(const FilePath& file_path)); + MOCK_METHOD1(OnDownloadCompleted, void(const base::FilePath& file_path)); MOCK_METHOD0(OnDownloadAborted, void()); private: @@ -72,13 +72,13 @@ class DragDownloadFileTest : public ContentBrowserTest { } void SetUpServer() { - FilePath mock_base(GetTestFilePath("download", "")); + base::FilePath mock_base(GetTestFilePath("download", "")); BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, base::Bind(&URLRequestMockHTTPJob::AddUrlHandler, mock_base)); } - const FilePath& downloads_directory() const { + const base::FilePath& downloads_directory() const { return downloads_directory_.path(); } @@ -89,9 +89,9 @@ class DragDownloadFileTest : public ContentBrowserTest { }; IN_PROC_BROWSER_TEST_F(DragDownloadFileTest, DragDownloadFileTest_NetError) { - FilePath name(downloads_directory().AppendASCII( + base::FilePath name(downloads_directory().AppendASCII( "DragDownloadFileTest_NetError.txt")); - GURL url(URLRequestMockHTTPJob::GetMockUrl(FilePath(FILE_PATH_LITERAL( + GURL url(URLRequestMockHTTPJob::GetMockUrl(base::FilePath(FILE_PATH_LITERAL( "download-test.lib")))); Referrer referrer; std::string referrer_encoding; @@ -109,9 +109,9 @@ IN_PROC_BROWSER_TEST_F(DragDownloadFileTest, DragDownloadFileTest_NetError) { } IN_PROC_BROWSER_TEST_F(DragDownloadFileTest, DragDownloadFileTest_Complete) { - FilePath name(downloads_directory().AppendASCII( + base::FilePath name(downloads_directory().AppendASCII( "DragDownloadFileTest_Complete.txt")); - GURL url(URLRequestMockHTTPJob::GetMockUrl(FilePath(FILE_PATH_LITERAL( + GURL url(URLRequestMockHTTPJob::GetMockUrl(base::FilePath(FILE_PATH_LITERAL( "download-test.lib")))); Referrer referrer; std::string referrer_encoding; diff --git a/content/browser/download/drag_download_util.cc b/content/browser/download/drag_download_util.cc index f9ca5fe..d275702 100644 --- a/content/browser/download/drag_download_util.cc +++ b/content/browser/download/drag_download_util.cc @@ -25,7 +25,7 @@ namespace content { bool ParseDownloadMetadata(const string16& metadata, string16* mime_type, - FilePath* file_name, + base::FilePath* file_name, GURL* url) { const char16 separator = L':'; @@ -47,9 +47,9 @@ bool ParseDownloadMetadata(const string16& metadata, string16 file_name_str = metadata.substr( mime_type_end_pos + 1, file_name_end_pos - mime_type_end_pos - 1); #if defined(OS_WIN) - *file_name = FilePath(file_name_str); + *file_name = base::FilePath(file_name_str); #else - *file_name = FilePath(UTF16ToUTF8(file_name_str)); + *file_name = base::FilePath(UTF16ToUTF8(file_name_str)); #endif } if (url) @@ -58,13 +58,14 @@ bool ParseDownloadMetadata(const string16& metadata, return true; } -FileStream* CreateFileStreamForDrop(FilePath* file_path, net::NetLog* net_log) { +FileStream* CreateFileStreamForDrop(base::FilePath* file_path, + net::NetLog* net_log) { DCHECK(file_path && !file_path->empty()); scoped_ptr<FileStream> file_stream(new FileStream(net_log)); const int kMaxSeq = 99; for (int seq = 0; seq <= kMaxSeq; seq++) { - FilePath new_file_path; + base::FilePath new_file_path; if (seq == 0) { new_file_path = *file_path; } else { @@ -97,7 +98,8 @@ PromiseFileFinalizer::PromiseFileFinalizer( : drag_file_downloader_(drag_file_downloader) { } -void PromiseFileFinalizer::OnDownloadCompleted(const FilePath& file_path) { +void PromiseFileFinalizer::OnDownloadCompleted( + const base::FilePath& file_path) { BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, base::Bind(&PromiseFileFinalizer::Cleanup, this)); diff --git a/content/browser/download/file_metadata_linux.cc b/content/browser/download/file_metadata_linux.cc index 8f7001b..9c9318d 100644 --- a/content/browser/download/file_metadata_linux.cc +++ b/content/browser/download/file_metadata_linux.cc @@ -27,7 +27,7 @@ static void SetExtendedFileAttribute(const char* path, const char* name, } } -void AddOriginMetadataToFile(const FilePath& file, const GURL& source, +void AddOriginMetadataToFile(const base::FilePath& file, const GURL& source, const GURL& referrer) { DCHECK(file_util::PathIsWritable(file)); if (source.is_valid()) { diff --git a/content/browser/download/file_metadata_mac.mm b/content/browser/download/file_metadata_mac.mm index 8a60f44..d16edf2 100644 --- a/content/browser/download/file_metadata_mac.mm +++ b/content/browser/download/file_metadata_mac.mm @@ -35,7 +35,7 @@ namespace content { // There is no documented API to set metadata on a file directly as of the // 10.5 SDK. The MDSetItemAttribute function does exist to perform this task, // but it's undocumented. -void AddOriginMetadataToFile(const FilePath& file, const GURL& source, +void AddOriginMetadataToFile(const base::FilePath& file, const GURL& source, const GURL& referrer) { // There's no declaration for MDItemSetAttribute in any known public SDK. // It exists in the 10.4 and 10.5 runtimes. To play it safe, do the lookup diff --git a/content/browser/download/file_metadata_unittest_linux.cc b/content/browser/download/file_metadata_unittest_linux.cc index 4759dfa..5a58e1a 100644 --- a/content/browser/download/file_metadata_unittest_linux.cc +++ b/content/browser/download/file_metadata_unittest_linux.cc @@ -32,7 +32,7 @@ class FileMetadataLinuxTest : public testing::Test { : source_url_("http://www.source.com"), referrer_url_("http://www.referrer.com") {} - const FilePath& test_file() const { + const base::FilePath& test_file() const { return test_file_; } @@ -105,7 +105,7 @@ class FileMetadataLinuxTest : public testing::Test { private: base::ScopedTempDir temp_dir_; - FilePath test_file_; + base::FilePath test_file_; GURL source_url_; GURL referrer_url_; bool is_xattr_supported_; diff --git a/content/browser/download/mhtml_generation_browsertest.cc b/content/browser/download/mhtml_generation_browsertest.cc index 75f7aaf..534a530 100644 --- a/content/browser/download/mhtml_generation_browsertest.cc +++ b/content/browser/download/mhtml_generation_browsertest.cc @@ -21,7 +21,7 @@ class MHTMLGenerationTest : public ContentBrowserTest { public: MHTMLGenerationTest() : mhtml_generated_(false), file_size_(0) {} - void MHTMLGenerated(const FilePath& path, int64 size) { + void MHTMLGenerated(const base::FilePath& path, int64 size) { mhtml_generated_ = true; file_size_ = size; MessageLoopForUI::current()->Quit(); @@ -50,7 +50,7 @@ class MHTMLGenerationTest : public ContentBrowserTest { IN_PROC_BROWSER_TEST_F(MHTMLGenerationTest, GenerateMHTML) { ASSERT_TRUE(test_server()->Start()); - FilePath path(temp_dir_.path()); + base::FilePath path(temp_dir_.path()); path = path.Append(FILE_PATH_LITERAL("test.mht")); NavigateToURL(shell(), test_server()->GetURL("files/simple_page.html")); diff --git a/content/browser/download/mhtml_generation_manager.cc b/content/browser/download/mhtml_generation_manager.cc index 8559ced..d6a0d47 100644 --- a/content/browser/download/mhtml_generation_manager.cc +++ b/content/browser/download/mhtml_generation_manager.cc @@ -38,7 +38,7 @@ MHTMLGenerationManager::~MHTMLGenerationManager() { void MHTMLGenerationManager::GenerateMHTML( WebContents* web_contents, - const FilePath& file, + const base::FilePath& file, const GenerateMHTMLCallback& callback) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); static int id_counter = 0; @@ -63,7 +63,7 @@ void MHTMLGenerationManager::MHTMLGenerated(int job_id, int64 mhtml_data_size) { } void MHTMLGenerationManager::CreateFile( - int job_id, const FilePath& file_path, + int job_id, const base::FilePath& file_path, base::ProcessHandle renderer_process) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); base::PlatformFile browser_file = base::CreatePlatformFile(file_path, diff --git a/content/browser/download/mock_download_file.h b/content/browser/download/mock_download_file.h index 51f47d5..39d4804 100644 --- a/content/browser/download/mock_download_file.h +++ b/content/browser/download/mock_download_file.h @@ -28,17 +28,18 @@ class MockDownloadFile : virtual public DownloadFile { MOCK_METHOD1(Initialize, void(const InitializeCallback&)); MOCK_METHOD2(AppendDataToFile, DownloadInterruptReason( const char* data, size_t data_len)); - MOCK_METHOD1(Rename, DownloadInterruptReason(const FilePath& full_path)); + MOCK_METHOD1(Rename, DownloadInterruptReason( + const base::FilePath& full_path)); MOCK_METHOD2(RenameAndUniquify, - void(const FilePath& full_path, + void(const base::FilePath& full_path, const RenameCompletionCallback& callback)); MOCK_METHOD2(RenameAndAnnotate, - void(const FilePath& full_path, + void(const base::FilePath& full_path, const RenameCompletionCallback& callback)); MOCK_METHOD0(Detach, void()); MOCK_METHOD0(Cancel, void()); MOCK_METHOD0(Finish, void()); - MOCK_CONST_METHOD0(FullPath, FilePath()); + MOCK_CONST_METHOD0(FullPath, base::FilePath()); MOCK_CONST_METHOD0(InProgress, bool()); MOCK_CONST_METHOD0(BytesSoFar, int64()); MOCK_CONST_METHOD0(CurrentSpeed, int64()); diff --git a/content/browser/download/save_file.cc b/content/browser/download/save_file.cc index 854470b..3e7f7bd 100644 --- a/content/browser/download/save_file.cc +++ b/content/browser/download/save_file.cc @@ -15,7 +15,7 @@ namespace content { // Unfortunately, as it is, constructors of SaveFile don't always // have access to the SavePackage at this point. SaveFile::SaveFile(const SaveFileCreateInfo* info, bool calculate_hash) - : file_(FilePath(), + : file_(base::FilePath(), info->url, GURL(), 0, @@ -35,7 +35,7 @@ SaveFile::~SaveFile() { } DownloadInterruptReason SaveFile::Initialize() { - return file_.Initialize(FilePath()); + return file_.Initialize(base::FilePath()); } DownloadInterruptReason SaveFile::AppendDataToFile(const char* data, @@ -43,7 +43,7 @@ DownloadInterruptReason SaveFile::AppendDataToFile(const char* data, return file_.AppendDataToFile(data, data_len); } -DownloadInterruptReason SaveFile::Rename(const FilePath& full_path) { +DownloadInterruptReason SaveFile::Rename(const base::FilePath& full_path) { return file_.Rename(full_path); } @@ -63,7 +63,7 @@ void SaveFile::AnnotateWithSourceInformation() { file_.AnnotateWithSourceInformation(); } -FilePath SaveFile::FullPath() const { +base::FilePath SaveFile::FullPath() const { return file_.full_path(); } diff --git a/content/browser/download/save_file.h b/content/browser/download/save_file.h index 13b6f9d..0b2ec06 100644 --- a/content/browser/download/save_file.h +++ b/content/browser/download/save_file.h @@ -27,12 +27,12 @@ class SaveFile { // BaseFile delegated functions. DownloadInterruptReason Initialize(); DownloadInterruptReason AppendDataToFile(const char* data, size_t data_len); - DownloadInterruptReason Rename(const FilePath& full_path); + DownloadInterruptReason Rename(const base::FilePath& full_path); void Detach(); void Cancel(); void Finish(); void AnnotateWithSourceInformation(); - FilePath FullPath() const; + base::FilePath FullPath() const; bool InProgress() const; int64 BytesSoFar() const; bool GetHash(std::string* hash); diff --git a/content/browser/download/save_file_manager.cc b/content/browser/download/save_file_manager.cc index d6bc162..94fc4c3 100644 --- a/content/browser/download/save_file_manager.cc +++ b/content/browser/download/save_file_manager.cc @@ -118,7 +118,7 @@ void SaveFileManager::SaveURL( int render_process_host_id, int render_view_id, SaveFileCreateInfo::SaveFileSource save_source, - const FilePath& file_full_path, + const base::FilePath& file_full_path, ResourceContext* context, SavePackage* save_package) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); @@ -189,7 +189,7 @@ SavePackage* SaveFileManager::GetSavePackageFromRenderIds( return contents->save_package(); } -void SaveFileManager::DeleteDirectoryOrFile(const FilePath& full_path, +void SaveFileManager::DeleteDirectoryOrFile(const base::FilePath& full_path, bool is_dir) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); BrowserThread::PostTask( @@ -450,7 +450,7 @@ void SaveFileManager::SaveLocalFile(const GURL& original_file_url, save_file->Detach(); DCHECK(original_file_url.SchemeIsFile()); - FilePath file_path; + base::FilePath file_path; net::FileURLToFilePath(original_file_url, &file_path); // If we can not get valid file path from original URL, treat it as // disk error. @@ -465,7 +465,7 @@ void SaveFileManager::SaveLocalFile(const GURL& original_file_url, SaveFinished(save_id, original_file_url, render_process_id, success); } -void SaveFileManager::OnDeleteDirectoryOrFile(const FilePath& full_path, +void SaveFileManager::OnDeleteDirectoryOrFile(const base::FilePath& full_path, bool is_dir) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); DCHECK(!full_path.empty()); @@ -475,7 +475,7 @@ void SaveFileManager::OnDeleteDirectoryOrFile(const FilePath& full_path, void SaveFileManager::RenameAllFiles( const FinalNameList& final_names, - const FilePath& resource_dir, + const base::FilePath& resource_dir, int render_process_id, int render_view_id, int save_package_id) { diff --git a/content/browser/download/save_item.cc b/content/browser/download/save_item.cc index e225ffc..450d383 100644 --- a/content/browser/download/save_item.cc +++ b/content/browser/download/save_item.cc @@ -114,7 +114,7 @@ int SaveItem::PercentComplete() const { } // Rename the save item with new path. -void SaveItem::Rename(const FilePath& full_path) { +void SaveItem::Rename(const base::FilePath& full_path) { DCHECK(!full_path.empty() && !has_final_name()); full_path_ = full_path; file_name_ = full_path_.BaseName(); diff --git a/content/browser/download/save_item.h b/content/browser/download/save_item.h index a78c28a..3a1d8df 100644 --- a/content/browser/download/save_item.h +++ b/content/browser/download/save_item.h @@ -48,7 +48,7 @@ class SaveItem { int PercentComplete() const; // Update path for SaveItem, the actual file is renamed on the file thread. - void Rename(const FilePath& full_path); + void Rename(const base::FilePath& full_path); void SetSaveId(int32 save_id); @@ -56,8 +56,8 @@ class SaveItem { // Accessors. SaveState state() const { return state_; } - const FilePath& full_path() const { return full_path_; } - const FilePath& file_name() const { return file_name_; } + const base::FilePath& full_path() const { return full_path_; } + const base::FilePath& file_name() const { return file_name_; } const GURL& url() const { return url_; } const Referrer& referrer() const { return referrer_; } int64 total_bytes() const { return total_bytes_; } @@ -78,10 +78,10 @@ class SaveItem { int32 save_id_; // Full path to the save item file. - FilePath full_path_; + base::FilePath full_path_; // Short display version of the file. - FilePath file_name_; + base::FilePath file_name_; // The URL for this save item. GURL url_; diff --git a/content/browser/download/save_package.cc b/content/browser/download/save_package.cc index c074d1e..76c26c7 100644 --- a/content/browser/download/save_package.cc +++ b/content/browser/download/save_package.cc @@ -79,16 +79,16 @@ const uint32 kMaxFileOrdinalNumberPartLength = 6; // Strip current ordinal number, if any. Should only be used on pure // file names, i.e. those stripped of their extensions. // TODO(estade): improve this to not choke on alternate encodings. -FilePath::StringType StripOrdinalNumber( - const FilePath::StringType& pure_file_name) { - FilePath::StringType::size_type r_paren_index = +base::FilePath::StringType StripOrdinalNumber( + const base::FilePath::StringType& pure_file_name) { + base::FilePath::StringType::size_type r_paren_index = pure_file_name.rfind(FILE_PATH_LITERAL(')')); - FilePath::StringType::size_type l_paren_index = + base::FilePath::StringType::size_type l_paren_index = pure_file_name.rfind(FILE_PATH_LITERAL('(')); if (l_paren_index >= r_paren_index) return pure_file_name; - for (FilePath::StringType::size_type i = l_paren_index + 1; + for (base::FilePath::StringType::size_type i = l_paren_index + 1; i != r_paren_index; ++i) { if (!IsAsciiDigit(pure_file_name[i])) return pure_file_name; @@ -107,7 +107,7 @@ bool CanSaveAsComplete(const std::string& contents_mime_type) { } // namespace -const FilePath::CharType SavePackage::kDefaultHtmlExtension[] = +const base::FilePath::CharType SavePackage::kDefaultHtmlExtension[] = #if defined(OS_WIN) FILE_PATH_LITERAL("htm"); #else @@ -116,8 +116,8 @@ const FilePath::CharType SavePackage::kDefaultHtmlExtension[] = SavePackage::SavePackage(WebContents* web_contents, SavePageType save_type, - const FilePath& file_full_path, - const FilePath& directory_full_path) + const base::FilePath& file_full_path, + const base::FilePath& directory_full_path) : WebContentsObserver(web_contents), file_manager_(NULL), download_manager_(NULL), @@ -133,7 +133,7 @@ SavePackage::SavePackage(WebContents* web_contents, disk_error_occurred_(false), save_type_(save_type), all_save_items_count_(0), - file_name_set_(&FilePath::CompareLessIgnoreCase), + file_name_set_(&base::FilePath::CompareLessIgnoreCase), wait_state_(INITIALIZE), contents_id_(web_contents->GetRenderProcessHost()->GetID()), unique_id_(g_save_package_id++), @@ -164,7 +164,7 @@ SavePackage::SavePackage(WebContents* web_contents) disk_error_occurred_(false), save_type_(SAVE_PAGE_TYPE_UNKNOWN), all_save_items_count_(0), - file_name_set_(&FilePath::CompareLessIgnoreCase), + file_name_set_(&base::FilePath::CompareLessIgnoreCase), wait_state_(INITIALIZE), contents_id_(web_contents->GetRenderProcessHost()->GetID()), unique_id_(g_save_package_id++), @@ -178,8 +178,8 @@ SavePackage::SavePackage(WebContents* web_contents) // method Cancel to be be called in destructor in test mode. // We also don't call InternalInit(). SavePackage::SavePackage(WebContents* web_contents, - const FilePath& file_full_path, - const FilePath& directory_full_path) + const base::FilePath& file_full_path, + const base::FilePath& directory_full_path) : WebContentsObserver(web_contents), file_manager_(NULL), download_manager_(NULL), @@ -193,7 +193,7 @@ SavePackage::SavePackage(WebContents* web_contents, disk_error_occurred_(false), save_type_(SAVE_PAGE_TYPE_UNKNOWN), all_save_items_count_(0), - file_name_set_(&FilePath::CompareLessIgnoreCase), + file_name_set_(&base::FilePath::CompareLessIgnoreCase), wait_state_(INITIALIZE), contents_id_(0), unique_id_(g_save_package_id++), @@ -324,7 +324,7 @@ bool SavePackage::Init( return true; } -void SavePackage::OnMHTMLGenerated(const FilePath& path, int64 size) { +void SavePackage::OnMHTMLGenerated(const base::FilePath& path, int64 size) { if (size <= 0) { Cancel(false); return; @@ -357,7 +357,8 @@ void SavePackage::OnMHTMLGenerated(const FilePath& path, int64 size) { // On POSIX, the length of |pure_file_name| + |file_name_ext| is further // restricted by NAME_MAX. The maximum allowed path looks like: // '/path/to/save_dir' + '/' + NAME_MAX. -uint32 SavePackage::GetMaxPathLengthForDirectory(const FilePath& base_dir) { +uint32 SavePackage::GetMaxPathLengthForDirectory( + const base::FilePath& base_dir) { #if defined(OS_POSIX) return std::min(kMaxFilePathLength, static_cast<uint32>(base_dir.value().length()) + diff --git a/content/browser/download/save_package.h b/content/browser/download/save_package.h index 9060916..4d17368 100644 --- a/content/browser/download/save_package.h +++ b/content/browser/download/save_package.h @@ -73,7 +73,7 @@ class CONTENT_EXPORT SavePackage FAILED }; - static const FilePath::CharType kDefaultHtmlExtension[]; + static const base::FilePath::CharType kDefaultHtmlExtension[]; // Constructor for user initiated page saving. This constructor results in a // SavePackage that will generate and sanitize a suggested name for the user @@ -85,8 +85,8 @@ class CONTENT_EXPORT SavePackage // better suited for tests. SavePackage(WebContents* web_contents, SavePageType save_type, - const FilePath& file_full_path, - const FilePath& directory_full_path); + const base::FilePath& file_full_path, + const base::FilePath& directory_full_path); // Initialize the SavePackage. Returns true if it initializes properly. Need // to make sure that this method must be called in the UI thread because using @@ -124,12 +124,12 @@ class CONTENT_EXPORT SavePackage friend class base::RefCountedThreadSafe<SavePackage>; // Callback for WebContents::GenerateMHTML(). - void OnMHTMLGenerated(const FilePath& path, int64 size); + void OnMHTMLGenerated(const base::FilePath& path, int64 size); // For testing only. SavePackage(WebContents* web_contents, - const FilePath& file_full_path, - const FilePath& directory_full_path); + const base::FilePath& file_full_path, + const base::FilePath& directory_full_path); virtual ~SavePackage(); @@ -157,18 +157,19 @@ class CONTENT_EXPORT SavePackage // This is needed on POSIX, which restrict the length of file names in // addition to the restriction on the length of path names. // |base_dir| is assumed to be a directory name with no trailing slash. - static uint32 GetMaxPathLengthForDirectory(const FilePath& base_dir); + static uint32 GetMaxPathLengthForDirectory(const base::FilePath& base_dir); - static bool GetSafePureFileName(const FilePath& dir_path, - const FilePath::StringType& file_name_ext, - uint32 max_file_path_len, - FilePath::StringType* pure_file_name); + static bool GetSafePureFileName( + const base::FilePath& dir_path, + const base::FilePath::StringType& file_name_ext, + uint32 max_file_path_len, + base::FilePath::StringType* pure_file_name); // Create a file name based on the response from the server. bool GenerateFileName(const std::string& disposition, const GURL& url, bool need_html_ext, - FilePath::StringType* generated_name); + base::FilePath::StringType* generated_name); // Get all savable resource links from current web page, include main // frame and sub-frame. @@ -186,15 +187,15 @@ class CONTENT_EXPORT SavePackage // Retrieves the URL to be saved from the WebContents. GURL GetUrlToBeSaved(); - void CreateDirectoryOnFileThread(const FilePath& website_save_dir, - const FilePath& download_save_dir, + void CreateDirectoryOnFileThread(const base::FilePath& website_save_dir, + const base::FilePath& download_save_dir, bool skip_dir_check, const std::string& mime_type, const std::string& accept_langs); - void ContinueGetSaveInfo(const FilePath& suggested_path, + void ContinueGetSaveInfo(const base::FilePath& suggested_path, bool can_save_as_complete); void OnPathPicked( - const FilePath& final_name, + const base::FilePath& final_name, SavePageType type, const SavePackageDownloadCreatedCallback& cb); void OnReceivedSavableResourceLinksForCurrentPage( @@ -233,23 +234,23 @@ class CONTENT_EXPORT SavePackage // Helper function for preparing suggested name for the SaveAs Dialog. The // suggested name is determined by the web document's title. - FilePath GetSuggestedNameForSaveAs( + base::FilePath GetSuggestedNameForSaveAs( bool can_save_as_complete, const std::string& contents_mime_type, const std::string& accept_langs); // Ensures that the file name has a proper extension for HTML by adding ".htm" // if necessary. - static FilePath EnsureHtmlExtension(const FilePath& name); + static base::FilePath EnsureHtmlExtension(const base::FilePath& name); // Ensures that the file name has a proper extension for supported formats // if necessary. - static FilePath EnsureMimeExtension(const FilePath& name, + static base::FilePath EnsureMimeExtension(const base::FilePath& name, const std::string& contents_mime_type); // Returns extension for supported MIME types (for example, for "text/plain" // it returns "txt"). - static const FilePath::CharType* ExtensionForMimeType( + static const base::FilePath::CharType* ExtensionForMimeType( const std::string& contents_mime_type); typedef std::queue<SaveItem*> SaveItemQueue; @@ -269,8 +270,8 @@ class CONTENT_EXPORT SavePackage // The URL of the page the user wants to save. GURL page_url_; - FilePath saved_main_file_path_; - FilePath saved_main_directory_path_; + base::FilePath saved_main_file_path_; + base::FilePath saved_main_directory_path_; // The title of the page the user wants to save. string16 title_; @@ -296,13 +297,13 @@ class CONTENT_EXPORT SavePackage // Number of all need to be saved resources. size_t all_save_items_count_; - typedef std::set<FilePath::StringType, - bool (*)(const FilePath::StringType&, - const FilePath::StringType&)> FileNameSet; + typedef std::set<base::FilePath::StringType, + bool (*)(const base::FilePath::StringType&, + const base::FilePath::StringType&)> FileNameSet; // This set is used to eliminate duplicated file names in saving directory. FileNameSet file_name_set_; - typedef base::hash_map<FilePath::StringType, uint32> FileNameCountMap; + typedef base::hash_map<base::FilePath::StringType, uint32> FileNameCountMap; // This map is used to track serial number for specified filename. FileNameCountMap file_name_count_map_; diff --git a/content/browser/download/save_package_browsertest.cc b/content/browser/download/save_package_browsertest.cc index 68e217ef..cc8f533 100644 --- a/content/browser/download/save_package_browsertest.cc +++ b/content/browser/download/save_package_browsertest.cc @@ -21,8 +21,8 @@ class SavePackageBrowserTest : public ContentBrowserTest { // Returns full paths of destination file and directory. void GetDestinationPaths(const std::string& prefix, - FilePath* full_file_name, - FilePath* dir) { + base::FilePath* full_file_name, + base::FilePath* dir) { *full_file_name = save_dir_.path().AppendASCII(prefix + ".htm"); *dir = save_dir_.path().AppendASCII(prefix + "_files"); } @@ -37,7 +37,7 @@ IN_PROC_BROWSER_TEST_F(SavePackageBrowserTest, ImplicitCancel) { ASSERT_TRUE(test_server()->Start()); GURL url = test_server()->GetURL(kTestFile); NavigateToURL(shell(), url); - FilePath full_file_name, dir; + base::FilePath full_file_name, dir; GetDestinationPaths("a", &full_file_name, &dir); scoped_refptr<SavePackage> save_package(new SavePackage( shell()->web_contents(), SAVE_PAGE_TYPE_AS_ONLY_HTML, full_file_name, @@ -51,7 +51,7 @@ IN_PROC_BROWSER_TEST_F(SavePackageBrowserTest, ExplicitCancel) { ASSERT_TRUE(test_server()->Start()); GURL url = test_server()->GetURL(kTestFile); NavigateToURL(shell(), url); - FilePath full_file_name, dir; + base::FilePath full_file_name, dir; GetDestinationPaths("a", &full_file_name, &dir); scoped_refptr<SavePackage> save_package(new SavePackage( shell()->web_contents(), SAVE_PAGE_TYPE_AS_ONLY_HTML, full_file_name, diff --git a/content/browser/download/save_package_unittest.cc b/content/browser/download/save_package_unittest.cc index a34e138..da4ccc8 100644 --- a/content/browser/download/save_package_unittest.cc +++ b/content/browser/download/save_package_unittest.cc @@ -47,13 +47,15 @@ std::string long_file_name( "6789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz0123" "456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789a"); -bool HasOrdinalNumber(const FilePath::StringType& filename) { - FilePath::StringType::size_type r_paren_index = filename.rfind(FPL(')')); - FilePath::StringType::size_type l_paren_index = filename.rfind(FPL('(')); +bool HasOrdinalNumber(const base::FilePath::StringType& filename) { + base::FilePath::StringType::size_type r_paren_index = + filename.rfind(FPL(')')); + base::FilePath::StringType::size_type l_paren_index = + filename.rfind(FPL('(')); if (l_paren_index >= r_paren_index) return false; - for (FilePath::StringType::size_type i = l_paren_index + 1; + for (base::FilePath::StringType::size_type i = l_paren_index + 1; i != r_paren_index; ++i) { if (!IsAsciiDigit(filename[i])) return false; @@ -73,7 +75,7 @@ class SavePackageTest : public RenderViewHostImplTestHarness { const std::string& disposition, const std::string& url, bool need_htm_ext, - FilePath::StringType* generated_name) { + base::FilePath::StringType* generated_name) { SavePackage* save_package; if (need_success_generate_filename) save_package = save_package_success_.get(); @@ -83,11 +85,11 @@ class SavePackageTest : public RenderViewHostImplTestHarness { generated_name); } - FilePath EnsureHtmlExtension(const FilePath& name) { + base::FilePath EnsureHtmlExtension(const base::FilePath& name) { return SavePackage::EnsureHtmlExtension(name); } - FilePath EnsureMimeExtension(const FilePath& name, + base::FilePath EnsureMimeExtension(const base::FilePath& name, const std::string& content_mime_type) { return SavePackage::EnsureMimeExtension(name, content_mime_type); } @@ -136,7 +138,7 @@ class SavePackageTest : public RenderViewHostImplTestHarness { static const struct { const char* disposition; const char* url; - const FilePath::CharType* expected_name; + const base::FilePath::CharType* expected_name; bool need_htm_ext; } kGeneratedFiles[] = { // We mainly focus on testing duplicated names here, since retrieving file @@ -183,7 +185,7 @@ static const struct { TEST_F(SavePackageTest, TestSuccessfullyGenerateSavePackageFilename) { for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kGeneratedFiles); ++i) { - FilePath::StringType file_name; + base::FilePath::StringType file_name; bool ok = GetGeneratedFilename(true, kGeneratedFiles[i].disposition, kGeneratedFiles[i].url, @@ -196,7 +198,7 @@ TEST_F(SavePackageTest, TestSuccessfullyGenerateSavePackageFilename) { TEST_F(SavePackageTest, TestUnSuccessfullyGenerateSavePackageFilename) { for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kGeneratedFiles); ++i) { - FilePath::StringType file_name; + base::FilePath::StringType file_name; bool ok = GetGeneratedFilename(false, kGeneratedFiles[i].disposition, kGeneratedFiles[i].url, @@ -217,7 +219,7 @@ TEST_F(SavePackageTest, MAYBE_TestLongSavePackageFilename) { const std::string long_file = long_file_name + ".css"; const std::string url = base_url + long_file; - FilePath::StringType filename; + base::FilePath::StringType filename; // Test that the filename is successfully shortened to fit. ASSERT_TRUE(GetGeneratedFilename(true, "", url, false, &filename)); EXPECT_TRUE(filename.length() < long_file.length()); @@ -231,7 +233,7 @@ TEST_F(SavePackageTest, MAYBE_TestLongSavePackageFilename) { // Test that the filename is successfully shortened to fit, and gets a // different ordinal appended. - FilePath::StringType filename2; + base::FilePath::StringType filename2; ASSERT_TRUE(GetGeneratedFilename(true, "", url, false, &filename2)); EXPECT_TRUE(filename2.length() < long_file.length()); EXPECT_TRUE(HasOrdinalNumber(filename2)); @@ -245,9 +247,9 @@ TEST_F(SavePackageTest, MAYBE_TestLongSavePackageFilename) { #define MAYBE_TestLongSafePureFilename TestLongSafePureFilename #endif TEST_F(SavePackageTest, MAYBE_TestLongSafePureFilename) { - const FilePath save_dir(FPL("test_dir")); - const FilePath::StringType ext(FPL_HTML_EXTENSION); - FilePath::StringType filename = + const base::FilePath save_dir(FPL("test_dir")); + const base::FilePath::StringType ext(FPL_HTML_EXTENSION); + base::FilePath::StringType filename = #if defined(OS_WIN) ASCIIToWide(long_file_name); #else @@ -262,8 +264,8 @@ TEST_F(SavePackageTest, MAYBE_TestLongSafePureFilename) { } static const struct { - const FilePath::CharType* page_title; - const FilePath::CharType* expected_name; + const base::FilePath::CharType* page_title; + const base::FilePath::CharType* expected_name; } kExtensionTestCases[] = { // Extension is preserved if it is already proper for HTML. {FPL("filename.html"), FPL("filename.html")}, @@ -288,9 +290,10 @@ static const struct { #endif TEST_F(SavePackageTest, MAYBE_TestEnsureHtmlExtension) { for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kExtensionTestCases); ++i) { - FilePath original = FilePath(kExtensionTestCases[i].page_title); - FilePath expected = FilePath(kExtensionTestCases[i].expected_name); - FilePath actual = EnsureHtmlExtension(original); + base::FilePath original = base::FilePath(kExtensionTestCases[i].page_title); + base::FilePath expected = + base::FilePath(kExtensionTestCases[i].expected_name); + base::FilePath actual = EnsureHtmlExtension(original); EXPECT_EQ(expected.value(), actual.value()) << "Failed for page title: " << kExtensionTestCases[i].page_title; } @@ -304,8 +307,8 @@ TEST_F(SavePackageTest, MAYBE_TestEnsureHtmlExtension) { #endif TEST_F(SavePackageTest, MAYBE_TestEnsureMimeExtension) { static const struct { - const FilePath::CharType* page_title; - const FilePath::CharType* expected_name; + const base::FilePath::CharType* page_title; + const base::FilePath::CharType* expected_name; const char* contents_mime_type; } kExtensionTests[] = { { FPL("filename.html"), FPL("filename.html"), "text/html" }, @@ -332,10 +335,10 @@ TEST_F(SavePackageTest, MAYBE_TestEnsureMimeExtension) { { FPL("filename"), FPL("filename"), "unknown/unknown" }, }; for (uint32 i = 0; i < ARRAYSIZE_UNSAFE(kExtensionTests); ++i) { - FilePath original = FilePath(kExtensionTests[i].page_title); - FilePath expected = FilePath(kExtensionTests[i].expected_name); + base::FilePath original = base::FilePath(kExtensionTests[i].page_title); + base::FilePath expected = base::FilePath(kExtensionTests[i].expected_name); std::string mime_type(kExtensionTests[i].contents_mime_type); - FilePath actual = EnsureMimeExtension(original, mime_type); + base::FilePath actual = EnsureMimeExtension(original, mime_type); EXPECT_EQ(expected.value(), actual.value()) << "Failed for page title: " << kExtensionTests[i].page_title << " MIME:" << mime_type; } @@ -351,7 +354,7 @@ TEST_F(SavePackageTest, MAYBE_TestEnsureMimeExtension) { static const struct SuggestedSaveNameTestCase { const char* page_url; const string16 page_title; - const FilePath::CharType* expected_name; + const base::FilePath::CharType* expected_name; bool ensure_html_extension; } kSuggestedSaveNames[] = { // Title overrides the URL. @@ -402,11 +405,11 @@ static const struct SuggestedSaveNameTestCase { TEST_F(SavePackageTest, MAYBE_TestSuggestedSaveNames) { for (size_t i = 0; i < arraysize(kSuggestedSaveNames); ++i) { scoped_refptr<SavePackage> save_package( - new SavePackage(contents(), FilePath(), FilePath())); + new SavePackage(contents(), base::FilePath(), base::FilePath())); save_package->page_url_ = GURL(kSuggestedSaveNames[i].page_url); save_package->title_ = kSuggestedSaveNames[i].page_title; - FilePath save_name = save_package->GetSuggestedNameForSaveAs( + base::FilePath save_name = save_package->GetSuggestedNameForSaveAs( kSuggestedSaveNames[i].ensure_html_extension, std::string(), std::string()); EXPECT_EQ(kSuggestedSaveNames[i].expected_name, save_name.value()) << @@ -414,13 +417,14 @@ TEST_F(SavePackageTest, MAYBE_TestSuggestedSaveNames) { } } -static const FilePath::CharType* kTestDir = FILE_PATH_LITERAL("save_page"); +static const base::FilePath::CharType* kTestDir = + FILE_PATH_LITERAL("save_page"); // GetUrlToBeSaved method should return correct url to be saved. TEST_F(SavePackageTest, TestGetUrlToBeSaved) { - FilePath file_name(FILE_PATH_LITERAL("a.htm")); + base::FilePath file_name(FILE_PATH_LITERAL("a.htm")); GURL url = URLRequestMockHTTPJob::GetMockUrl( - FilePath(kTestDir).Append(file_name)); + base::FilePath(kTestDir).Append(file_name)); NavigateAndCommit(url); EXPECT_EQ(url, GetUrlToBeSaved()); } @@ -430,11 +434,11 @@ TEST_F(SavePackageTest, TestGetUrlToBeSaved) { // Ex:GetUrlToBeSaved method should return http://www.google.com // when user types view-source:http://www.google.com TEST_F(SavePackageTest, TestGetUrlToBeSavedViewSource) { - FilePath file_name(FILE_PATH_LITERAL("a.htm")); + base::FilePath file_name(FILE_PATH_LITERAL("a.htm")); GURL view_source_url = URLRequestMockHTTPJob::GetMockViewSourceUrl( - FilePath(kTestDir).Append(file_name)); + base::FilePath(kTestDir).Append(file_name)); GURL actual_url = URLRequestMockHTTPJob::GetMockUrl( - FilePath(kTestDir).Append(file_name)); + base::FilePath(kTestDir).Append(file_name)); NavigateAndCommit(view_source_url); EXPECT_EQ(actual_url, GetUrlToBeSaved()); EXPECT_EQ(view_source_url, contents()->GetURL()); diff --git a/content/browser/download/save_types.cc b/content/browser/download/save_types.cc index 59f9f35..b72c01b 100644 --- a/content/browser/download/save_types.cc +++ b/content/browser/download/save_types.cc @@ -6,7 +6,7 @@ namespace content { -SaveFileCreateInfo::SaveFileCreateInfo(const FilePath& path, +SaveFileCreateInfo::SaveFileCreateInfo(const base::FilePath& path, const GURL& url, SaveFileSource save_source, int32 save_id) diff --git a/content/browser/download/save_types.h b/content/browser/download/save_types.h index 68a44c7..ab3fba9 100644 --- a/content/browser/download/save_types.h +++ b/content/browser/download/save_types.h @@ -14,7 +14,7 @@ #include "googleurl/src/gurl.h" namespace content { -typedef std::vector<std::pair<int, FilePath> > FinalNameList; +typedef std::vector<std::pair<int, base::FilePath> > FinalNameList; typedef std::vector<int> SaveIDList; // This structure is used to handle and deliver some info @@ -33,7 +33,7 @@ struct SaveFileCreateInfo { SAVE_FILE_FROM_FILE }; - SaveFileCreateInfo(const FilePath& path, + SaveFileCreateInfo(const base::FilePath& path, const GURL& url, SaveFileSource save_source, int32 save_id); @@ -44,7 +44,7 @@ struct SaveFileCreateInfo { // SaveItem fields. // The local file path of saved file. - FilePath path; + base::FilePath path; // Original URL of the saved resource. GURL url; // Final URL of the saved resource since some URL might be redirected. diff --git a/content/browser/fileapi/blob_layout_browsertest.cc b/content/browser/fileapi/blob_layout_browsertest.cc index 8188965..ab2adf9 100644 --- a/content/browser/fileapi/blob_layout_browsertest.cc +++ b/content/browser/fileapi/blob_layout_browsertest.cc @@ -10,8 +10,9 @@ class BlobLayoutTest : public InProcessBrowserLayoutTest { public: BlobLayoutTest() : InProcessBrowserLayoutTest( - FilePath(), - FilePath(FILE_PATH_LITERAL("fast/files")).NormalizePathSeparators()) { + base::FilePath(), + base::FilePath(FILE_PATH_LITERAL("fast/files")). + NormalizePathSeparators()) { } }; diff --git a/content/browser/fileapi/browser_file_system_helper.cc b/content/browser/fileapi/browser_file_system_helper.cc index a8b29bf..21e7b7d 100644 --- a/content/browser/fileapi/browser_file_system_helper.cc +++ b/content/browser/fileapi/browser_file_system_helper.cc @@ -42,7 +42,7 @@ FileSystemOptions CreateBrowserFileSystemOptions(bool is_incognito) { } // anonymous namespace scoped_refptr<fileapi::FileSystemContext> CreateFileSystemContext( - const FilePath& profile_path, bool is_incognito, + const base::FilePath& profile_path, bool is_incognito, fileapi::ExternalMountPoints* external_mount_points, quota::SpecialStoragePolicy* special_storage_policy, quota::QuotaManagerProxy* quota_manager_proxy) { diff --git a/content/browser/fileapi/browser_file_system_helper.h b/content/browser/fileapi/browser_file_system_helper.h index 8bd1773..fe2fcfe 100644 --- a/content/browser/fileapi/browser_file_system_helper.h +++ b/content/browser/fileapi/browser_file_system_helper.h @@ -23,7 +23,7 @@ namespace content { // the browser process. CONTENT_EXPORT scoped_refptr<fileapi::FileSystemContext> CreateFileSystemContext( - const FilePath& profile_path, + const base::FilePath& profile_path, bool is_incognito, fileapi::ExternalMountPoints* external_mount_points, quota::SpecialStoragePolicy* special_storage_policy, diff --git a/content/browser/fileapi/file_system_browsertest.cc b/content/browser/fileapi/file_system_browsertest.cc index e9fa9cf..8e8316e 100644 --- a/content/browser/fileapi/file_system_browsertest.cc +++ b/content/browser/fileapi/file_system_browsertest.cc @@ -85,8 +85,8 @@ class FileSystemLayoutTest : public InProcessBrowserLayoutTest { public: FileSystemLayoutTest() : InProcessBrowserLayoutTest( - FilePath(), - FilePath( + base::FilePath(), + base::FilePath( FILE_PATH_LITERAL("fast/filesystem_temp") ).NormalizePathSeparators()) { } diff --git a/content/browser/fileapi/fileapi_message_filter.cc b/content/browser/fileapi/fileapi_message_filter.cc index 0c01f38..f8fc3c3 100644 --- a/content/browser/fileapi/fileapi_message_filter.cc +++ b/content/browser/fileapi/fileapi_message_filter.cc @@ -49,7 +49,7 @@ namespace content { namespace { -void RevokeFilePermission(int child_id, const FilePath& path) { +void RevokeFilePermission(int child_id, const base::FilePath& path) { ChildProcessSecurityPolicyImpl::GetInstance()->RevokeAllPermissionsForFile( child_id, path); } @@ -499,10 +499,10 @@ void FileAPIMessageFilter::OnDidUpdate(const GURL& path, int64 delta) { } void FileAPIMessageFilter::OnSyncGetPlatformPath( - const GURL& path, FilePath* platform_path) { + const GURL& path, base::FilePath* platform_path) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); DCHECK(platform_path); - *platform_path = FilePath(); + *platform_path = base::FilePath(); FileSystemURL url(context_->CrackURL(path)); if (!url.is_valid()) return; @@ -542,7 +542,7 @@ void FileAPIMessageFilter::OnCreateSnapshotFile( int request_id, const GURL& blob_url, const GURL& path) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); FileSystemURL url(context_->CrackURL(path)); - base::Callback<void(const FilePath&)> register_file_callback = + base::Callback<void(const base::FilePath&)> register_file_callback = base::Bind(&FileAPIMessageFilter::RegisterFileAsBlob, this, blob_url, url); @@ -657,7 +657,7 @@ void FileAPIMessageFilter::DidGetMetadata( int request_id, base::PlatformFileError result, const base::PlatformFileInfo& info, - const FilePath& platform_path) { + const base::FilePath& platform_path) { if (result == base::PLATFORM_FILE_OK) Send(new FileSystemMsg_DidReadMetadata(request_id, info, platform_path)); else @@ -736,10 +736,10 @@ void FileAPIMessageFilter::DidDeleteFileSystem( void FileAPIMessageFilter::DidCreateSnapshot( int request_id, - const base::Callback<void(const FilePath&)>& register_file_callback, + const base::Callback<void(const base::FilePath&)>& register_file_callback, base::PlatformFileError result, const base::PlatformFileInfo& info, - const FilePath& platform_path, + const base::FilePath& platform_path, const scoped_refptr<webkit_blob::ShareableFileReference>& unused) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); if (result != base::PLATFORM_FILE_OK) { @@ -757,11 +757,12 @@ void FileAPIMessageFilter::DidCreateSnapshot( Send(new FileSystemMsg_DidReadMetadata(request_id, info, platform_path)); } -void FileAPIMessageFilter::RegisterFileAsBlob(const GURL& blob_url, - const FileSystemURL& url, - const FilePath& platform_path) { +void FileAPIMessageFilter::RegisterFileAsBlob( + const GURL& blob_url, + const FileSystemURL& url, + const base::FilePath& platform_path) { // Use the virtual path's extension to determine MIME type. - FilePath::StringType extension = url.path().Extension(); + base::FilePath::StringType extension = url.path().Extension(); if (!extension.empty()) extension = extension.substr(1); // Strip leading ".". @@ -824,7 +825,7 @@ bool FileAPIMessageFilter::HasPermissionsForFile( return false; } - FilePath file_path; + base::FilePath file_path; ChildProcessSecurityPolicyImpl* policy = ChildProcessSecurityPolicyImpl::GetInstance(); diff --git a/content/browser/gamepad/gamepad_platform_data_fetcher_win.cc b/content/browser/gamepad/gamepad_platform_data_fetcher_win.cc index 838a626..937b9a2 100644 --- a/content/browser/gamepad/gamepad_platform_data_fetcher_win.cc +++ b/content/browser/gamepad/gamepad_platform_data_fetcher_win.cc @@ -51,7 +51,7 @@ const WebUChar* const GamepadSubTypeName(BYTE sub_type) { } // namespace GamepadPlatformDataFetcherWin::GamepadPlatformDataFetcherWin() - : xinput_dll_(FilePath(FILE_PATH_LITERAL("xinput1_3.dll"))), + : xinput_dll_(base::FilePath(FILE_PATH_LITERAL("xinput1_3.dll"))), xinput_available_(GetXinputDllFunctions()) { } diff --git a/content/browser/geolocation/win7_location_api_win.cc b/content/browser/geolocation/win7_location_api_win.cc index 523cb87..093a2aa 100644 --- a/content/browser/geolocation/win7_location_api_win.cc +++ b/content/browser/geolocation/win7_location_api_win.cc @@ -23,7 +23,7 @@ void ConvertKnotsToMetresPerSecond(double* knots) { } HINSTANCE LoadWin7Library(const string16& lib_name) { - FilePath sys_dir; + base::FilePath sys_dir; PathService::Get(base::DIR_SYSTEM, &sys_dir); return LoadLibrary(sys_dir.Append(lib_name).value().c_str()); } diff --git a/content/browser/gpu/gpu_blacklist_unittest.cc b/content/browser/gpu/gpu_blacklist_unittest.cc index 25c3232..374b23b 100644 --- a/content/browser/gpu/gpu_blacklist_unittest.cc +++ b/content/browser/gpu/gpu_blacklist_unittest.cc @@ -59,7 +59,7 @@ class GpuBlacklistTest : public testing::Test { }; TEST_F(GpuBlacklistTest, CurrentBlacklistValidation) { - FilePath data_file; + base::FilePath data_file; ASSERT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &data_file)); data_file = data_file.Append(FILE_PATH_LITERAL("content")) diff --git a/content/browser/gpu/gpu_crash_browsertest.cc b/content/browser/gpu/gpu_crash_browsertest.cc index 23a0cc7..90b1fb3 100644 --- a/content/browser/gpu/gpu_crash_browsertest.cc +++ b/content/browser/gpu/gpu_crash_browsertest.cc @@ -18,11 +18,11 @@ namespace content { class GpuCrashTest : public ContentBrowserTest { protected: virtual void SetUpInProcessBrowserTestFixture() { - FilePath test_dir; + base::FilePath test_dir; ASSERT_TRUE(PathService::Get(DIR_TEST_DATA, &test_dir)); gpu_test_dir_ = test_dir.AppendASCII("gpu"); } - FilePath gpu_test_dir_; + base::FilePath gpu_test_dir_; }; IN_PROC_BROWSER_TEST_F(GpuCrashTest, MANUAL_Kill) { diff --git a/content/browser/gpu/gpu_data_manager_impl.cc b/content/browser/gpu/gpu_data_manager_impl.cc index 7a83afb..a085bc4 100644 --- a/content/browser/gpu/gpu_data_manager_impl.cc +++ b/content/browser/gpu/gpu_data_manager_impl.cc @@ -192,7 +192,7 @@ bool GpuDataManagerImpl::ShouldUseSoftwareRendering() const { return software_rendering_; } -void GpuDataManagerImpl::RegisterSwiftShaderPath(const FilePath& path) { +void GpuDataManagerImpl::RegisterSwiftShaderPath(const base::FilePath& path) { swiftshader_path_ = path; EnableSoftwareRenderingIfNecessary(); } @@ -389,7 +389,7 @@ void GpuDataManagerImpl::AppendGpuCommandLine( std::string use_gl = CommandLine::ForCurrentProcess()->GetSwitchValueASCII(switches::kUseGL); - FilePath swiftshader_path = + base::FilePath swiftshader_path = CommandLine::ForCurrentProcess()->GetSwitchValuePath( switches::kSwiftShaderPath); uint32 flags = GetBlacklistedFeatures(); diff --git a/content/browser/gpu/gpu_data_manager_impl.h b/content/browser/gpu/gpu_data_manager_impl.h index e78eee4..a0853e5 100644 --- a/content/browser/gpu/gpu_data_manager_impl.h +++ b/content/browser/gpu/gpu_data_manager_impl.h @@ -65,7 +65,7 @@ class CONTENT_EXPORT GpuDataManagerImpl virtual bool IsCompleteGpuInfoAvailable() const OVERRIDE; virtual void RequestVideoMemoryUsageStatsUpdate() const OVERRIDE; virtual bool ShouldUseSoftwareRendering() const OVERRIDE; - virtual void RegisterSwiftShaderPath(const FilePath& path) OVERRIDE; + virtual void RegisterSwiftShaderPath(const base::FilePath& path) OVERRIDE; virtual void AddObserver(GpuDataManagerObserver* observer) OVERRIDE; virtual void RemoveObserver(GpuDataManagerObserver* observer) OVERRIDE; virtual void SetWindowCount(uint32 count) OVERRIDE; @@ -237,7 +237,7 @@ class CONTENT_EXPORT GpuDataManagerImpl bool software_rendering_; - FilePath swiftshader_path_; + base::FilePath swiftshader_path_; // Current card force-blacklisted due to GPU crashes, or disabled through // the --disable-gpu commandline switch. diff --git a/content/browser/gpu/gpu_data_manager_impl_unittest.cc b/content/browser/gpu/gpu_data_manager_impl_unittest.cc index ef92de24..678f43c 100644 --- a/content/browser/gpu/gpu_data_manager_impl_unittest.cc +++ b/content/browser/gpu/gpu_data_manager_impl_unittest.cc @@ -219,7 +219,7 @@ TEST_F(GpuDataManagerImplTest, SoftwareRendering) { // If software rendering is enabled, even if we blacklist GPU, // GPU process is still allowed. - const FilePath test_path(FILE_PATH_LITERAL("AnyPath")); + const base::FilePath test_path(FILE_PATH_LITERAL("AnyPath")); manager->RegisterSwiftShaderPath(test_path); EXPECT_TRUE(manager->ShouldUseSoftwareRendering()); EXPECT_TRUE(manager->GpuAccessAllowed()); @@ -235,7 +235,7 @@ TEST_F(GpuDataManagerImplTest, SoftwareRendering2) { EXPECT_TRUE(manager->GpuAccessAllowed()); EXPECT_FALSE(manager->ShouldUseSoftwareRendering()); - const FilePath test_path(FILE_PATH_LITERAL("AnyPath")); + const base::FilePath test_path(FILE_PATH_LITERAL("AnyPath")); manager->RegisterSwiftShaderPath(test_path); EXPECT_EQ(0, manager->GetBlacklistedFeatures()); EXPECT_TRUE(manager->GpuAccessAllowed()); @@ -275,7 +275,7 @@ TEST_F(GpuDataManagerImplTest, NoGpuInfoUpdateWithSoftwareRendering) { ASSERT_TRUE(manager.get()); manager->BlacklistCard(); - const FilePath test_path(FILE_PATH_LITERAL("AnyPath")); + const base::FilePath test_path(FILE_PATH_LITERAL("AnyPath")); manager->RegisterSwiftShaderPath(test_path); EXPECT_TRUE(manager->ShouldUseSoftwareRendering()); EXPECT_TRUE(manager->GpuAccessAllowed()); diff --git a/content/browser/gpu/gpu_memory_test.cc b/content/browser/gpu/gpu_memory_test.cc index fc62846..00f7331 100644 --- a/content/browser/gpu/gpu_memory_test.cc +++ b/content/browser/gpu/gpu_memory_test.cc @@ -74,7 +74,7 @@ class GpuMemoryTest : public content::ContentBrowserTest { } virtual void SetUpInProcessBrowserTestFixture() { - FilePath test_dir; + base::FilePath test_dir; ASSERT_TRUE(PathService::Get(content::DIR_TEST_DATA, &test_dir)); gpu_test_dir_ = test_dir.AppendASCII("gpu"); } @@ -105,7 +105,7 @@ class GpuMemoryTest : public content::ContentBrowserTest { void LoadPage(content::Shell* tab_to_load, PageType page_type, size_t mb_to_use) { - FilePath url; + base::FilePath url; switch (page_type) { case PAGE_CSS3D: url = gpu_test_dir_.AppendASCII("mem_css3d.html"); @@ -226,7 +226,7 @@ class GpuMemoryTest : public content::ContentBrowserTest { std::set<content::Shell*> tabs_; std::set<content::Shell*> visible_tabs_; bool has_used_first_shell_; - FilePath gpu_test_dir_; + base::FilePath gpu_test_dir_; }; // When trying to load something that doesn't fit into our total GPU memory diff --git a/content/browser/gpu/gpu_pixel_browsertest.cc b/content/browser/gpu/gpu_pixel_browsertest.cc index 9dd36d5..49aa9a8 100644 --- a/content/browser/gpu/gpu_pixel_browsertest.cc +++ b/content/browser/gpu/gpu_pixel_browsertest.cc @@ -52,9 +52,9 @@ const char kBuildRevision[] = "build-revision"; // Reads and decodes a PNG image to a bitmap. Returns true on success. The PNG // should have been encoded using |gfx::PNGCodec::Encode|. -bool ReadPNGFile(const FilePath& file_path, SkBitmap* bitmap) { +bool ReadPNGFile(const base::FilePath& file_path, SkBitmap* bitmap) { DCHECK(bitmap); - FilePath abs_path(file_path); + base::FilePath abs_path(file_path); if (!file_util::AbsolutePath(&abs_path)) return false; @@ -67,7 +67,7 @@ bool ReadPNGFile(const FilePath& file_path, SkBitmap* bitmap) { // Encodes a bitmap into a PNG and write to disk. Returns true on success. The // parent directory does not have to exist. -bool WritePNGFile(const SkBitmap& bitmap, const FilePath& file_path) { +bool WritePNGFile(const SkBitmap& bitmap, const base::FilePath& file_path) { std::vector<unsigned char> png_data; if (gfx::PNGCodec::EncodeBGRASkBitmap(bitmap, true, &png_data) && file_util::CreateDirectory(file_path.DirName())) { @@ -81,7 +81,7 @@ bool WritePNGFile(const SkBitmap& bitmap, const FilePath& file_path) { // Write an empty file, whose name indicates the chrome revision when the ref // image was generated. -bool WriteREVFile(const FilePath& file_path) { +bool WriteREVFile(const base::FilePath& file_path) { if (file_util::CreateDirectory(file_path.DirName())) { char one_byte = 0; int bytes_written = file_util::WriteFile(file_path, &one_byte, 1); @@ -156,7 +156,7 @@ class GpuPixelBrowserTest : public ContentBrowserTest { // If the existing ref image was saved from an revision older than the // ref_img_update_revision, refresh the ref image. void RunPixelTest(const gfx::Size& tab_container_size, - const FilePath& url, + const base::FilePath& url, int64 ref_img_update_revision, const ReferencePixel* ref_pixels, size_t ref_pixel_count) { @@ -183,14 +183,14 @@ class GpuPixelBrowserTest : public ContentBrowserTest { EXPECT_TRUE(same_pixels); } - const FilePath& test_data_dir() const { + const base::FilePath& test_data_dir() const { return test_data_dir_; } private: - FilePath test_data_dir_; - FilePath generated_img_dir_; - FilePath ref_img_dir_; + base::FilePath test_data_dir_; + base::FilePath generated_img_dir_; + base::FilePath ref_img_dir_; int64 ref_img_revision_; std::string build_revision_; // The name of the test, with any special prefixes dropped. @@ -221,7 +221,7 @@ class GpuPixelBrowserTest : public ContentBrowserTest { bool CompareImages(const SkBitmap& gen_bmp) { SkBitmap ref_bmp_on_disk; - FilePath img_path = ref_img_dir_.AppendASCII(test_name_ + ".png"); + base::FilePath img_path = ref_img_dir_.AppendASCII(test_name_ + ".png"); bool found_ref_img = ReadPNGFile(img_path, &ref_bmp_on_disk); if (!found_ref_img && ref_img_option_ == kReferenceImageCheckedIn) { @@ -238,7 +238,7 @@ class GpuPixelBrowserTest : public ContentBrowserTest { if ((ref_img_revision_ <= 0 && ref_img_option_ == kReferenceImageLocal) || !found_ref_img) { - FilePath rev_path = ref_img_dir_.AppendASCII( + base::FilePath rev_path = ref_img_dir_.AppendASCII( test_name_ + "_" + build_revision_ + ".rev"); if (!WritePNGFile(gen_bmp, img_path)) { LOG(ERROR) << "Can't save generated image to: " @@ -321,7 +321,7 @@ class GpuPixelBrowserTest : public ContentBrowserTest { std::string ref_img_filename = img_path.BaseName().MaybeAsASCII(); if (save_gen) { - FilePath img_fail_path = generated_img_dir_.AppendASCII( + base::FilePath img_fail_path = generated_img_dir_.AppendASCII( "FAIL_" + ref_img_filename); if (!WritePNGFile(gen_bmp, img_fail_path)) { LOG(ERROR) << "Can't save generated image to: " @@ -332,7 +332,7 @@ class GpuPixelBrowserTest : public ContentBrowserTest { } } if (save_diff) { - FilePath img_diff_path = generated_img_dir_.AppendASCII( + base::FilePath img_diff_path = generated_img_dir_.AppendASCII( "DIFF_" + ref_img_filename); if (!WritePNGFile(diff_bmp, img_diff_path)) { LOG(ERROR) << "Can't save generated diff image to: " @@ -396,15 +396,15 @@ class GpuPixelBrowserTest : public ContentBrowserTest { // If no valid local revision file is located, the ref_img_revision_ is 0. void ObtainLocalRefImageRevision() { - FilePath filter; + base::FilePath filter; filter = filter.AppendASCII(test_name_ + "_*.rev"); file_util::FileEnumerator locator(ref_img_dir_, false, // non recursive file_util::FileEnumerator::FILES, filter.value()); int64 max_revision = 0; - std::vector<FilePath> outdated_revs; - for (FilePath full_path = locator.Next(); + std::vector<base::FilePath> outdated_revs; + for (base::FilePath full_path = locator.Next(); !full_path.empty(); full_path = locator.Next()) { std::string filename = @@ -447,7 +447,7 @@ IN_PROC_BROWSER_TEST_F(GpuPixelBrowserTest, MANUAL_WebGLGreenTriangle) { const size_t ref_pixel_count = sizeof(ref_pixels) / sizeof(ReferencePixel); gfx::Size container_size(400, 300); - FilePath url = + base::FilePath url = test_data_dir().AppendASCII("pixel_webgl.html"); RunPixelTest(container_size, url, ref_img_revision_update, ref_pixels, ref_pixel_count); @@ -470,7 +470,7 @@ IN_PROC_BROWSER_TEST_F(GpuPixelBrowserTest, MANUAL_CSS3DBlueBox) { const size_t ref_pixel_count = sizeof(ref_pixels) / sizeof(ReferencePixel); gfx::Size container_size(400, 300); - FilePath url = + base::FilePath url = test_data_dir().AppendASCII("pixel_css3d.html"); RunPixelTest(container_size, url, ref_img_revision_update, ref_pixels, ref_pixel_count); @@ -491,7 +491,7 @@ IN_PROC_BROWSER_TEST_F(GpuPixelBrowserTest, MANUAL_Canvas2DRedBoxHD) { const size_t ref_pixel_count = sizeof(ref_pixels) / sizeof(ReferencePixel); gfx::Size container_size(400, 300); - FilePath url = + base::FilePath url = test_data_dir().AppendASCII("pixel_canvas2d.html"); RunPixelTest(container_size, url, ref_img_revision_update, ref_pixels, ref_pixel_count); @@ -520,7 +520,7 @@ IN_PROC_BROWSER_TEST_F(GpuPixelTestCanvas2DSD, MANUAL_Canvas2DRedBoxSD) { const size_t ref_pixel_count = sizeof(ref_pixels) / sizeof(ReferencePixel); gfx::Size container_size(400, 300); - FilePath url = + base::FilePath url = test_data_dir().AppendASCII("pixel_canvas2d.html"); RunPixelTest(container_size, url, ref_img_revision_update, ref_pixels, ref_pixel_count); diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc index 5a6969a..4b6e5dd 100644 --- a/content/browser/gpu/gpu_process_host.cc +++ b/content/browser/gpu/gpu_process_host.cc @@ -959,7 +959,7 @@ bool GpuProcessHost::LaunchGpuProcess(const std::string& channel_id) { int child_flags = ChildProcessHost::CHILD_NORMAL; #endif - FilePath exe_path = ChildProcessHost::GetChildPath(child_flags); + base::FilePath exe_path = ChildProcessHost::GetChildPath(child_flags); if (exe_path.empty()) return false; @@ -1032,7 +1032,7 @@ bool GpuProcessHost::LaunchGpuProcess(const std::string& channel_id) { process_->Launch( #if defined(OS_WIN) - FilePath(), + base::FilePath(), #elif defined(OS_POSIX) false, base::EnvironmentVector(), diff --git a/content/browser/gpu/webgl_conformance_test.cc b/content/browser/gpu/webgl_conformance_test.cc index 1e54f14..bf69f1f 100644 --- a/content/browser/gpu/webgl_conformance_test.cc +++ b/content/browser/gpu/webgl_conformance_test.cc @@ -29,7 +29,7 @@ class WebGLConformanceTest : public ContentBrowserTest { } virtual void SetUpInProcessBrowserTestFixture() { - FilePath webgl_conformance_path; + base::FilePath webgl_conformance_path; PathService::Get(base::DIR_SOURCE_ROOT, &webgl_conformance_path); webgl_conformance_path = webgl_conformance_path.Append( FILE_PATH_LITERAL("third_party")); @@ -74,7 +74,7 @@ class WebGLConformanceTest : public ContentBrowserTest { } private: - FilePath test_path_; + base::FilePath test_path_; GPUTestBotConfig bot_config_; GPUTestExpectationsParser test_expectations_; }; diff --git a/content/browser/hyphenator/hyphenator_message_filter.cc b/content/browser/hyphenator/hyphenator_message_filter.cc index 88fa88e..1653ea3 100644 --- a/content/browser/hyphenator/hyphenator_message_filter.cc +++ b/content/browser/hyphenator/hyphenator_message_filter.cc @@ -45,7 +45,7 @@ HyphenatorMessageFilter::~HyphenatorMessageFilter() { } } -void HyphenatorMessageFilter::SetDictionaryBase(const FilePath& base) { +void HyphenatorMessageFilter::SetDictionaryBase(const base::FilePath& base) { dictionary_base_ = base; } @@ -99,7 +99,7 @@ void HyphenatorMessageFilter::OpenDictionary(const string16& locale) { if (rule_file != "en-US") return; rule_file.append("-1-0.dic"); - FilePath rule_path = dictionary_base_.AppendASCII(rule_file); + base::FilePath rule_path = dictionary_base_.AppendASCII(rule_file); dictionary_file_ = base::CreatePlatformFile( rule_path, base::PLATFORM_FILE_READ | base::PLATFORM_FILE_OPEN, diff --git a/content/browser/hyphenator/hyphenator_message_filter.h b/content/browser/hyphenator/hyphenator_message_filter.h index c672b6f..a3216cf 100644 --- a/content/browser/hyphenator/hyphenator_message_filter.h +++ b/content/browser/hyphenator/hyphenator_message_filter.h @@ -27,7 +27,7 @@ class CONTENT_EXPORT HyphenatorMessageFilter : public BrowserMessageFilter { // containing hyphenation dictionaries. When a renderer requests a hyphnation // dictionary, this class appends a file name (which consists of a locale, a // version number, and an extension) and use it as a dictionary file. - void SetDictionaryBase(const FilePath& directory); + void SetDictionaryBase(const base::FilePath& directory); // BrowserMessageFilter implementation. virtual void OverrideThreadForMessage( @@ -60,7 +60,7 @@ class CONTENT_EXPORT HyphenatorMessageFilter : public BrowserMessageFilter { // The directory that includes dictionary files. The default value is the // directory containing the executable file. - FilePath dictionary_base_; + base::FilePath dictionary_base_; // A cached dictionary file. base::PlatformFile dictionary_file_; diff --git a/content/browser/hyphenator/hyphenator_message_filter_unittest.cc b/content/browser/hyphenator/hyphenator_message_filter_unittest.cc index 469f194..2516b31 100644 --- a/content/browser/hyphenator/hyphenator_message_filter_unittest.cc +++ b/content/browser/hyphenator/hyphenator_message_filter_unittest.cc @@ -121,7 +121,7 @@ TEST_F(HyphenatorMessageFilterTest, OpenDictionary) { // Open a sample dictionary file and attach it to the // HyphenatorMessageFilter class so it can return a valid file. - FilePath path; + base::FilePath path; PathService::Get(base::DIR_SOURCE_ROOT, &path); path = path.Append(FILE_PATH_LITERAL("third_party")); path = path.Append(FILE_PATH_LITERAL("hyphen")); diff --git a/content/browser/in_process_webkit/browser_webkitplatformsupport_impl.cc b/content/browser/in_process_webkit/browser_webkitplatformsupport_impl.cc index f8deeaf..5a697b2 100644 --- a/content/browser/in_process_webkit/browser_webkitplatformsupport_impl.cc +++ b/content/browser/in_process_webkit/browser_webkitplatformsupport_impl.cc @@ -117,7 +117,7 @@ WebKit::WebData BrowserWebKitPlatformSupportImpl::loadResource( int BrowserWebKitPlatformSupportImpl::databaseDeleteFile( const WebKit::WebString& vfs_file_name, bool sync_dir) { - const FilePath path = webkit_base::WebStringToFilePath(vfs_file_name); + const base::FilePath path = webkit_base::WebStringToFilePath(vfs_file_name); return file_util::Delete(path, false) ? 0 : 1; } diff --git a/content/browser/in_process_webkit/indexed_db_browsertest.cc b/content/browser/in_process_webkit/indexed_db_browsertest.cc index c7ce5e7b..eeb56b6 100644 --- a/content/browser/in_process_webkit/indexed_db_browsertest.cc +++ b/content/browser/in_process_webkit/indexed_db_browsertest.cc @@ -203,12 +203,12 @@ static void CopyLevelDBToProfile(Shell* shell, scoped_refptr<IndexedDBContext> context, const std::string& test_directory) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); - FilePath leveldb_dir(FILE_PATH_LITERAL("file__0.indexeddb.leveldb")); - FilePath test_data_dir = + base::FilePath leveldb_dir(FILE_PATH_LITERAL("file__0.indexeddb.leveldb")); + base::FilePath test_data_dir = GetTestFilePath("indexeddb", test_directory.c_str()).Append(leveldb_dir); IndexedDBContextImpl* context_impl = static_cast<IndexedDBContextImpl*>(context.get()); - FilePath dest = context_impl->data_path().Append(leveldb_dir); + base::FilePath dest = context_impl->data_path().Append(leveldb_dir); // If we don't create the destination directory first, the contents of the // leveldb directory are copied directly into profile/IndexedDB instead of // profile/IndexedDB/file__0.xxx/ @@ -330,9 +330,9 @@ IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, LevelDBLogFileTest) { GetIndexedDBContext(); IndexedDBContextImpl* context_impl = static_cast<IndexedDBContextImpl*>(context.get()); - FilePath leveldb_dir(FILE_PATH_LITERAL("file__0.indexeddb.leveldb")); - FilePath log_file(FILE_PATH_LITERAL("LOG")); - FilePath log_file_path = + base::FilePath leveldb_dir(FILE_PATH_LITERAL("file__0.indexeddb.leveldb")); + base::FilePath log_file(FILE_PATH_LITERAL("LOG")); + base::FilePath log_file_path = context_impl->data_path().Append(leveldb_dir).Append(log_file); int64 size; EXPECT_TRUE(file_util::GetFileSize(log_file_path, &size)); diff --git a/content/browser/in_process_webkit/indexed_db_context_impl.cc b/content/browser/in_process_webkit/indexed_db_context_impl.cc index f84dcac..5591dc7 100644 --- a/content/browser/in_process_webkit/indexed_db_context_impl.cc +++ b/content/browser/in_process_webkit/indexed_db_context_impl.cc @@ -30,24 +30,24 @@ using WebKit::WebIDBFactory; using WebKit::WebSecurityOrigin; namespace content { -const FilePath::CharType IndexedDBContextImpl::kIndexedDBDirectory[] = +const base::FilePath::CharType IndexedDBContextImpl::kIndexedDBDirectory[] = FILE_PATH_LITERAL("IndexedDB"); -const FilePath::CharType IndexedDBContextImpl::kIndexedDBExtension[] = +const base::FilePath::CharType IndexedDBContextImpl::kIndexedDBExtension[] = FILE_PATH_LITERAL(".leveldb"); namespace { void GetAllOriginsAndPaths( - const FilePath& indexeddb_path, + const base::FilePath& indexeddb_path, std::vector<GURL>* origins, - std::vector<FilePath>* file_paths) { + std::vector<base::FilePath>* file_paths) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); if (indexeddb_path.empty()) return; file_util::FileEnumerator file_enumerator(indexeddb_path, false, file_util::FileEnumerator::DIRECTORIES); - for (FilePath file_path = file_enumerator.Next(); !file_path.empty(); + for (base::FilePath file_path = file_enumerator.Next(); !file_path.empty(); file_path = file_enumerator.Next()) { if (file_path.Extension() == IndexedDBContextImpl::kIndexedDBExtension) { WebKit::WebString origin_id_webstring = @@ -62,14 +62,15 @@ void GetAllOriginsAndPaths( // Deletes session-only databases. void ClearSessionOnlyOrigins( - const FilePath& indexeddb_path, + const base::FilePath& indexeddb_path, scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); std::vector<GURL> origins; - std::vector<FilePath> file_paths; + std::vector<base::FilePath> file_paths; GetAllOriginsAndPaths(indexeddb_path, &origins, &file_paths); DCHECK_EQ(origins.size(), file_paths.size()); - std::vector<FilePath>::const_iterator file_path_iter = file_paths.begin(); + std::vector<base::FilePath>::const_iterator file_path_iter = + file_paths.begin(); for (std::vector<GURL>::const_iterator iter = origins.begin(); iter != origins.end(); ++iter, ++file_path_iter) { if (!special_storage_policy->IsStorageSessionOnly(*iter)) @@ -83,7 +84,7 @@ void ClearSessionOnlyOrigins( } // namespace IndexedDBContextImpl::IndexedDBContextImpl( - const FilePath& data_path, + const base::FilePath& data_path, quota::SpecialStoragePolicy* special_storage_policy, quota::QuotaManagerProxy* quota_manager_proxy, base::MessageLoopProxy* webkit_thread_loop) @@ -132,7 +133,7 @@ base::Time IndexedDBContextImpl::GetOriginLastModified(const GURL& origin_url) { if (data_path_.empty() || !IsInOriginSet(origin_url)) return base::Time(); string16 origin_id = DatabaseUtil::GetOriginIdentifier(origin_url); - FilePath idb_directory = GetIndexedDBFilePath(origin_id); + base::FilePath idb_directory = GetIndexedDBFilePath(origin_id); base::PlatformFileInfo file_info; if (!file_util::GetFileInfo(idb_directory, &file_info)) return base::Time(); @@ -158,7 +159,7 @@ void IndexedDBContextImpl::DeleteForOrigin(const GURL& origin_url) { } string16 origin_id = DatabaseUtil::GetOriginIdentifier(origin_url); - FilePath idb_directory = GetIndexedDBFilePath(origin_id); + base::FilePath idb_directory = GetIndexedDBFilePath(origin_id); EnsureDiskUsageCacheInitialized(origin_url); const bool recursive = true; bool deleted = file_util::Delete(idb_directory, recursive); @@ -171,7 +172,7 @@ void IndexedDBContextImpl::DeleteForOrigin(const GURL& origin_url) { } } -FilePath IndexedDBContextImpl::GetFilePathForTesting( +base::FilePath IndexedDBContextImpl::GetFilePathForTesting( const string16& origin_id) const { return GetIndexedDBFilePath(origin_id); } @@ -269,10 +270,10 @@ IndexedDBContextImpl::~IndexedDBContextImpl() { special_storage_policy_)); } -FilePath IndexedDBContextImpl::GetIndexedDBFilePath( +base::FilePath IndexedDBContextImpl::GetIndexedDBFilePath( const string16& origin_id) const { DCHECK(!data_path_.empty()); - FilePath::StringType id = + base::FilePath::StringType id = webkit_base::WebStringToFilePathString(origin_id).append( FILE_PATH_LITERAL(".indexeddb")); return data_path_.Append(id.append(kIndexedDBExtension)); @@ -282,7 +283,7 @@ int64 IndexedDBContextImpl::ReadUsageFromDisk(const GURL& origin_url) const { if (data_path_.empty()) return 0; string16 origin_id = DatabaseUtil::GetOriginIdentifier(origin_url); - FilePath file_path = GetIndexedDBFilePath(origin_id); + base::FilePath file_path = GetIndexedDBFilePath(origin_id); return file_util::ComputeDirectorySize(file_path); } diff --git a/content/browser/in_process_webkit/indexed_db_dispatcher_host.cc b/content/browser/in_process_webkit/indexed_db_dispatcher_host.cc index f3b5077..4ecefd5 100644 --- a/content/browser/in_process_webkit/indexed_db_dispatcher_host.cc +++ b/content/browser/in_process_webkit/indexed_db_dispatcher_host.cc @@ -223,7 +223,7 @@ IndexedDBDatabaseMetadata IndexedDBDispatcherHost::ConvertMetadata( void IndexedDBDispatcherHost::OnIDBFactoryGetDatabaseNames( const IndexedDBHostMsg_FactoryGetDatabaseNames_Params& params) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); - FilePath indexed_db_path = indexed_db_context_->data_path(); + base::FilePath indexed_db_path = indexed_db_context_->data_path(); WebSecurityOrigin origin( WebSecurityOrigin::createFromDatabaseIdentifier(params.origin)); @@ -237,7 +237,7 @@ void IndexedDBDispatcherHost::OnIDBFactoryGetDatabaseNames( void IndexedDBDispatcherHost::OnIDBFactoryOpen( const IndexedDBHostMsg_FactoryOpen_Params& params) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); - FilePath indexed_db_path = indexed_db_context_->data_path(); + base::FilePath indexed_db_path = indexed_db_context_->data_path(); GURL origin_url = DatabaseUtil::GetOriginFromIdentifier(params.origin); WebSecurityOrigin origin( @@ -264,7 +264,7 @@ void IndexedDBDispatcherHost::OnIDBFactoryOpen( void IndexedDBDispatcherHost::OnIDBFactoryDeleteDatabase( const IndexedDBHostMsg_FactoryDeleteDatabase_Params& params) { - FilePath indexed_db_path = indexed_db_context_->data_path(); + base::FilePath indexed_db_path = indexed_db_context_->data_path(); DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); Context()->GetIDBFactory()->deleteDatabase( diff --git a/content/browser/in_process_webkit/indexed_db_layout_browsertest.cc b/content/browser/in_process_webkit/indexed_db_layout_browsertest.cc index e137b98..f063f09 100644 --- a/content/browser/in_process_webkit/indexed_db_layout_browsertest.cc +++ b/content/browser/in_process_webkit/indexed_db_layout_browsertest.cc @@ -9,7 +9,8 @@ namespace content { class IndexedDBLayoutTest : public InProcessBrowserLayoutTest { public: IndexedDBLayoutTest() : InProcessBrowserLayoutTest( - FilePath(), FilePath().AppendASCII("storage").AppendASCII("indexeddb")) { + base::FilePath(), + base::FilePath().AppendASCII("storage").AppendASCII("indexeddb")) { } void RunLayoutTests(const char* file_names[]) { diff --git a/content/browser/in_process_webkit/indexed_db_quota_client_unittest.cc b/content/browser/in_process_webkit/indexed_db_quota_client_unittest.cc index ac70f9a..0eebf4b 100644 --- a/content/browser/in_process_webkit/indexed_db_quota_client_unittest.cc +++ b/content/browser/in_process_webkit/indexed_db_quota_client_unittest.cc @@ -55,7 +55,7 @@ class IndexedDBQuotaClientTest : public testing::Test { } void setup_temp_dir() { ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); - FilePath indexeddb_dir = temp_dir_.path().Append( + base::FilePath indexeddb_dir = temp_dir_.path().Append( IndexedDBContextImpl::kIndexedDBDirectory); ASSERT_TRUE(file_util::CreateDirectory(indexeddb_dir)); idb_context()->set_data_path_for_testing(indexeddb_dir); @@ -125,13 +125,13 @@ class IndexedDBQuotaClientTest : public testing::Test { IndexedDBContextImpl* idb_context() { return idb_context_.get(); } - void SetFileSizeTo(const FilePath& path, int size) { + void SetFileSizeTo(const base::FilePath& path, int size) { std::string junk(size, 'a'); ASSERT_EQ(size, file_util::WriteFile(path, junk.c_str(), size)); } void AddFakeIndexedDB(const GURL& origin, int size) { - FilePath file_path_origin = idb_context()->GetFilePathForTesting( + base::FilePath file_path_origin = idb_context()->GetFilePathForTesting( DatabaseUtil::GetOriginIdentifier(origin)); if (!file_util::CreateDirectory(file_path_origin)) { LOG(ERROR) << "failed to file_util::CreateDirectory " diff --git a/content/browser/in_process_webkit/indexed_db_unittest.cc b/content/browser/in_process_webkit/indexed_db_unittest.cc index a15c4b2..bb71bcc 100644 --- a/content/browser/in_process_webkit/indexed_db_unittest.cc +++ b/content/browser/in_process_webkit/indexed_db_unittest.cc @@ -42,8 +42,8 @@ TEST_F(IndexedDBTest, ClearSessionOnlyDatabases) { base::ScopedTempDir temp_dir; ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); - FilePath normal_path; - FilePath session_only_path; + base::FilePath normal_path; + base::FilePath session_only_path; // Create the scope which will ensure we run the destructor of the webkit // context which should trigger the clean up. @@ -86,8 +86,8 @@ TEST_F(IndexedDBTest, SetForceKeepSessionState) { base::ScopedTempDir temp_dir; ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); - FilePath normal_path; - FilePath session_only_path; + base::FilePath normal_path; + base::FilePath session_only_path; // Create the scope which will ensure we run the destructor of the webkit // context. @@ -159,7 +159,7 @@ TEST_F(IndexedDBTest, ForceCloseOpenDatabasesOnDelete) { base::ScopedTempDir temp_dir; ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); - FilePath test_path; + base::FilePath test_path; // Create the scope which will ensure we run the destructor of the webkit // context. diff --git a/content/browser/intents/intent_injector.cc b/content/browser/intents/intent_injector.cc index aecedf3..96e8d87 100644 --- a/content/browser/intents/intent_injector.cc +++ b/content/browser/intents/intent_injector.cc @@ -92,7 +92,7 @@ void IntentInjector::RenderViewCreated(RenderViewHost* render_view_host) { } else if (source_intent_->data_type == webkit_glue::WebIntentData::FILESYSTEM) { const int child_id = render_view_host->GetProcess()->GetID(); - FilePath path; + base::FilePath path; const bool valid = fileapi::IsolatedContext::GetInstance()->GetRegisteredPath( source_intent_->filesystem_id, &path); diff --git a/content/browser/intents/web_intents_dispatcher_impl.cc b/content/browser/intents/web_intents_dispatcher_impl.cc index 0bc1261..a649673 100644 --- a/content/browser/intents/web_intents_dispatcher_impl.cc +++ b/content/browser/intents/web_intents_dispatcher_impl.cc @@ -28,7 +28,7 @@ WebIntentsDispatcherImpl::WebIntentsDispatcherImpl( intent_injector_(NULL) { // Ensure that WebIntentData sent from a renderer process // carries the right payload type and no extraneous data. - intent_.blob_file = FilePath(); + intent_.blob_file = base::FilePath(); intent_.blob_length = 0; intent_.root_name = ""; intent_.filesystem_id = ""; diff --git a/content/browser/loader/redirect_to_file_resource_handler.cc b/content/browser/loader/redirect_to_file_resource_handler.cc index 9b37784..f3f81dd 100644 --- a/content/browser/loader/redirect_to_file_resource_handler.cc +++ b/content/browser/loader/redirect_to_file_resource_handler.cc @@ -164,7 +164,7 @@ bool RedirectToFileResourceHandler::OnResponseCompleted( void RedirectToFileResourceHandler::DidCreateTemporaryFile( base::PlatformFileError /*error_code*/, base::PassPlatformFile file_handle, - const FilePath& file_path) { + const base::FilePath& file_path) { deletable_file_ = ShareableFileReference::GetOrCreate( file_path, ShareableFileReference::DELETE_ON_FINAL_RELEASE, BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE)); diff --git a/content/browser/loader/redirect_to_file_resource_handler.h b/content/browser/loader/redirect_to_file_resource_handler.h index 167dc9e..574738a 100644 --- a/content/browser/loader/redirect_to_file_resource_handler.h +++ b/content/browser/loader/redirect_to_file_resource_handler.h @@ -56,7 +56,7 @@ class RedirectToFileResourceHandler : public LayeredResourceHandler { private: void DidCreateTemporaryFile(base::PlatformFileError error_code, base::PassPlatformFile file_handle, - const FilePath& file_path); + const base::FilePath& file_path); void DidWriteToFile(int result); bool WriteMore(); bool BufIsFull() const; diff --git a/content/browser/loader/resource_dispatcher_host_browsertest.cc b/content/browser/loader/resource_dispatcher_host_browsertest.cc index 0257b57..6490ee5 100644 --- a/content/browser/loader/resource_dispatcher_host_browsertest.cc +++ b/content/browser/loader/resource_dispatcher_host_browsertest.cc @@ -31,7 +31,7 @@ class ResourceDispatcherHostBrowserTest : public ContentBrowserTest, protected: virtual void SetUpOnMainThread() OVERRIDE { - FilePath path = GetTestFilePath("", ""); + base::FilePath path = GetTestFilePath("", ""); BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, base::Bind(&URLRequestMockHTTPJob::AddUrlHandler, path)); @@ -48,7 +48,8 @@ class ResourceDispatcherHostBrowserTest : public ContentBrowserTest, } GURL GetMockURL(const std::string& file) { - return URLRequestMockHTTPJob::GetMockUrl(FilePath().AppendASCII(file)); + return URLRequestMockHTTPJob::GetMockUrl( + base::FilePath().AppendASCII(file)); } void CheckTitleTest(const GURL& url, diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc index 2eef436..edb60ab 100644 --- a/content/browser/loader/resource_dispatcher_host_impl.cc +++ b/content/browser/loader/resource_dispatcher_host_impl.cc @@ -188,7 +188,7 @@ bool ShouldServiceRequest(ProcessType process_type, } void RemoveDownloadFileFromChildSecurityPolicy(int child_id, - const FilePath& path) { + const base::FilePath& path) { ChildProcessSecurityPolicyImpl::GetInstance()->RevokeAllPermissionsForFile( child_id, path); } diff --git a/content/browser/media/audio_browsertest.cc b/content/browser/media/audio_browsertest.cc index f499827..a4fc02a 100644 --- a/content/browser/media/audio_browsertest.cc +++ b/content/browser/media/audio_browsertest.cc @@ -9,7 +9,7 @@ namespace content { class AudioLayoutTest : public InProcessBrowserLayoutTest { protected: AudioLayoutTest() : InProcessBrowserLayoutTest( - FilePath(), FilePath().AppendASCII("media")) { + base::FilePath(), base::FilePath().AppendASCII("media")) { } }; diff --git a/content/browser/media/encrypted_media_browsertest.cc b/content/browser/media/encrypted_media_browsertest.cc index 4b39425..64954a1 100644 --- a/content/browser/media/encrypted_media_browsertest.cc +++ b/content/browser/media/encrypted_media_browsertest.cc @@ -92,11 +92,11 @@ class EncryptedMediaTest : public testing::WithParamInterface<const char*>, command_line->AppendSwitch(switches::kPpapiOutOfProcess); // Append the switch to register the Clear Key CDM plugin. - FilePath plugin_dir; + base::FilePath plugin_dir; EXPECT_TRUE(PathService::Get(base::DIR_MODULE, &plugin_dir)); - FilePath plugin_lib = plugin_dir.Append(kLibraryName); + base::FilePath plugin_lib = plugin_dir.Append(kLibraryName); EXPECT_TRUE(file_util::PathExists(plugin_lib)); - FilePath::StringType pepper_plugin = plugin_lib.value(); + base::FilePath::StringType pepper_plugin = plugin_lib.value(); pepper_plugin.append(FILE_PATH_LITERAL( "#Clear Key CDM#Clear Key CDM 0.1.0.0#0.1.0.0;")); #if defined(OS_WIN) diff --git a/content/browser/media/media_browsertest.cc b/content/browser/media/media_browsertest.cc index abbcdcc..9e270fe 100644 --- a/content/browser/media/media_browsertest.cc +++ b/content/browser/media/media_browsertest.cc @@ -36,7 +36,7 @@ class MediaTest : public testing::WithParamInterface<bool>, // Run specified color format test with the expected result. void RunColorFormatTest(const char* media_file, const char* expected) { - FilePath test_file_path = GetTestFilePath("media", "blackwhite.html"); + base::FilePath test_file_path = GetTestFilePath("media", "blackwhite.html"); RunTest(GetFileUrlWithQuery(test_file_path, media_file), expected); } @@ -53,7 +53,7 @@ class MediaTest : public testing::WithParamInterface<bool>, gurl = test_server()->GetURL( base::StringPrintf("files/media/player.html?%s=%s", tag, media_file)); } else { - FilePath test_file_path = GetTestFilePath("media", "player.html"); + base::FilePath test_file_path = GetTestFilePath("media", "player.html"); gurl = GetFileUrlWithQuery( test_file_path, base::StringPrintf("%s=%s", tag, media_file)); } @@ -171,7 +171,7 @@ INSTANTIATE_TEST_CASE_P(Http, MediaTest, ::testing::Values(true)); class MediaLayoutTest : public InProcessBrowserLayoutTest { protected: MediaLayoutTest() : InProcessBrowserLayoutTest( - FilePath(), FilePath().AppendASCII("media")) { + base::FilePath(), base::FilePath().AppendASCII("media")) { } virtual ~MediaLayoutTest() {} }; diff --git a/content/browser/mime_registry_message_filter.cc b/content/browser/mime_registry_message_filter.cc index e29e1fa..49a0500 100644 --- a/content/browser/mime_registry_message_filter.cc +++ b/content/browser/mime_registry_message_filter.cc @@ -38,17 +38,17 @@ bool MimeRegistryMessageFilter::OnMessageReceived(const IPC::Message& message, } void MimeRegistryMessageFilter::OnGetMimeTypeFromExtension( - const FilePath::StringType& ext, std::string* mime_type) { + const base::FilePath::StringType& ext, std::string* mime_type) { net::GetMimeTypeFromExtension(ext, mime_type); } void MimeRegistryMessageFilter::OnGetMimeTypeFromFile( - const FilePath& file_path, std::string* mime_type) { + const base::FilePath& file_path, std::string* mime_type) { net::GetMimeTypeFromFile(file_path, mime_type); } void MimeRegistryMessageFilter::OnGetPreferredExtensionForMimeType( - const std::string& mime_type, FilePath::StringType* extension) { + const std::string& mime_type, base::FilePath::StringType* extension) { net::GetPreferredExtensionForMimeType(mime_type, extension); } diff --git a/content/browser/mime_registry_message_filter.h b/content/browser/mime_registry_message_filter.h index 085e5d2..5dc8153 100644 --- a/content/browser/mime_registry_message_filter.h +++ b/content/browser/mime_registry_message_filter.h @@ -23,12 +23,13 @@ class MimeRegistryMessageFilter : public BrowserMessageFilter { private: virtual ~MimeRegistryMessageFilter(); - void OnGetMimeTypeFromExtension(const FilePath::StringType& ext, + void OnGetMimeTypeFromExtension(const base::FilePath::StringType& ext, std::string* mime_type); - void OnGetMimeTypeFromFile(const FilePath& file_path, + void OnGetMimeTypeFromFile(const base::FilePath& file_path, std::string* mime_type); - void OnGetPreferredExtensionForMimeType(const std::string& mime_type, - FilePath::StringType* extension); + void OnGetPreferredExtensionForMimeType( + const std::string& mime_type, + base::FilePath::StringType* extension); }; } // namespace content diff --git a/content/browser/pepper_flash_settings_helper_impl.cc b/content/browser/pepper_flash_settings_helper_impl.cc index 557a2d5..bd99b1a 100644 --- a/content/browser/pepper_flash_settings_helper_impl.cc +++ b/content/browser/pepper_flash_settings_helper_impl.cc @@ -23,7 +23,7 @@ PepperFlashSettingsHelperImpl::~PepperFlashSettingsHelperImpl() { } void PepperFlashSettingsHelperImpl::OpenChannelToBroker( - const FilePath& path, + const base::FilePath& path, const OpenChannelCallback& callback) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); diff --git a/content/browser/pepper_flash_settings_helper_impl.h b/content/browser/pepper_flash_settings_helper_impl.h index de34fcf..19584a8 100644 --- a/content/browser/pepper_flash_settings_helper_impl.h +++ b/content/browser/pepper_flash_settings_helper_impl.h @@ -20,7 +20,7 @@ class CONTENT_EXPORT PepperFlashSettingsHelperImpl // PepperFlashSettingsHelper implementation. virtual void OpenChannelToBroker( - const FilePath& path, + const base::FilePath& path, const OpenChannelCallback& callback) OVERRIDE; // PpapiPluginProcessHost::BrokerClient implementation. diff --git a/content/browser/plugin_browsertest.cc b/content/browser/plugin_browsertest.cc index 5c17f29..e749095 100644 --- a/content/browser/plugin_browsertest.cc +++ b/content/browser/plugin_browsertest.cc @@ -24,7 +24,7 @@ namespace content { namespace { -void SetUrlRequestMock(const FilePath& path) { +void SetUrlRequestMock(const base::FilePath& path) { URLRequestMockHTTPJob::AddUrlHandler(path); } @@ -59,7 +59,7 @@ class PluginTest : public ContentBrowserTest { "security_tests.dll"); } #elif defined(OS_MACOSX) - FilePath plugin_dir; + base::FilePath plugin_dir; PathService::Get(base::DIR_MODULE, &plugin_dir); plugin_dir = plugin_dir.AppendASCII("plugins"); // The plugins directory isn't read by default on the Mac, so it needs to be @@ -69,7 +69,7 @@ class PluginTest : public ContentBrowserTest { } virtual void SetUpOnMainThread() OVERRIDE { - FilePath path = GetTestFilePath("", ""); + base::FilePath path = GetTestFilePath("", ""); BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, base::Bind(&SetUrlRequestMock, path)); } @@ -105,7 +105,7 @@ class PluginTest : public ContentBrowserTest { } void TestPlugin(const char* filename) { - FilePath path = GetTestFilePath("plugin", filename); + base::FilePath path = GetTestFilePath("plugin", filename); if (!file_util::PathExists(path)) { const testing::TestInfo* const test_info = testing::UnitTest::GetInstance()->current_test_info(); @@ -174,8 +174,8 @@ IN_PROC_BROWSER_TEST_F(PluginTest, // Flaky, http://crbug.com/60071. IN_PROC_BROWSER_TEST_F(PluginTest, GetURLRequest404Response) { GURL url(URLRequestMockHTTPJob::GetMockUrl( - FilePath().AppendASCII("npapi"). - AppendASCII("plugin_url_request_404.html"))); + base::FilePath().AppendASCII("npapi"). + AppendASCII("plugin_url_request_404.html"))); LoadAndWait(url); } @@ -349,8 +349,8 @@ IN_PROC_BROWSER_TEST_F(PluginTest, MultipleInstancesSyncCalls) { IN_PROC_BROWSER_TEST_F(PluginTest, GetURLRequestFailWrite) { GURL url(URLRequestMockHTTPJob::GetMockUrl( - FilePath().AppendASCII("npapi"). - AppendASCII("plugin_url_request_fail_write.html"))); + base::FilePath().AppendASCII("npapi"). + AppendASCII("plugin_url_request_fail_write.html"))); LoadAndWait(url); } @@ -372,8 +372,8 @@ IN_PROC_BROWSER_TEST_F(PluginTest, NoHangIfInitCrashes) { // If this flakes on Mac, use http://crbug.com/111508 IN_PROC_BROWSER_TEST_F(PluginTest, PluginReferrerTest) { GURL url(URLRequestMockHTTPJob::GetMockUrl( - FilePath().AppendASCII("npapi"). - AppendASCII("plugin_url_request_referrer_test.html"))); + base::FilePath().AppendASCII("npapi"). + AppendASCII("plugin_url_request_referrer_test.html"))); LoadAndWait(url); } diff --git a/content/browser/plugin_data_remover_impl.cc b/content/browser/plugin_data_remover_impl.cc index 7b8effc..e1efc1f 100644 --- a/content/browser/plugin_data_remover_impl.cc +++ b/content/browser/plugin_data_remover_impl.cc @@ -93,7 +93,7 @@ class PluginDataRemoverImpl::Context std::vector<webkit::WebPluginInfo> plugins; plugin_service->GetPluginInfoArray( GURL(), mime_type, false, &plugins, NULL); - FilePath plugin_path; + base::FilePath plugin_path; if (!plugins.empty()) // May be empty for some tests. plugin_path = plugins[0].path; @@ -202,17 +202,18 @@ class PluginDataRemoverImpl::Context virtual ~Context() {} IPC::Message* CreatePpapiClearSiteDataMsg(uint64 max_age) { - FilePath profile_path = + base::FilePath profile_path = PepperFlashFileMessageFilter::GetDataDirName(browser_context_path_); // TODO(vtl): This "duplicates" logic in webkit/plugins/ppapi/file_path.cc // (which prepends the plugin name to the relative part of the path // instead, with the absolute, profile-dependent part being enforced by // the browser). #if defined(OS_WIN) - FilePath plugin_data_path = - profile_path.Append(FilePath(UTF8ToUTF16(plugin_name_))); + base::FilePath plugin_data_path = + profile_path.Append(base::FilePath(UTF8ToUTF16(plugin_name_))); #else - FilePath plugin_data_path = profile_path.Append(FilePath(plugin_name_)); + base::FilePath plugin_data_path = + profile_path.Append(base::FilePath(plugin_name_)); #endif // defined(OS_WIN) return new PpapiMsg_ClearSiteData(0u, plugin_data_path, std::string(), kClearAllData, max_age); @@ -285,7 +286,7 @@ class PluginDataRemoverImpl::Context // Path for the current profile. Must be retrieved on the UI thread from the // browser context when we start so we can use it later on the I/O thread. - FilePath browser_context_path_; + base::FilePath browser_context_path_; // The resource context for the profile. Use only on the I/O thread. ResourceContext* resource_context_; diff --git a/content/browser/plugin_data_remover_impl_browsertest.cc b/content/browser/plugin_data_remover_impl_browsertest.cc index 98b06d7..bf1c6fa 100644 --- a/content/browser/plugin_data_remover_impl_browsertest.cc +++ b/content/browser/plugin_data_remover_impl_browsertest.cc @@ -30,7 +30,7 @@ class PluginDataRemoverTest : public ContentBrowserTest { virtual void SetUpCommandLine(CommandLine* command_line) { #ifdef OS_MACOSX - FilePath browser_directory; + base::FilePath browser_directory; PathService::Get(base::DIR_MODULE, &browser_directory); command_line->AppendSwitchPath(switches::kExtraPluginDir, browser_directory.AppendASCII("plugins")); diff --git a/content/browser/plugin_loader_posix.cc b/content/browser/plugin_loader_posix.cc index f152188..b01f385 100644 --- a/content/browser/plugin_loader_posix.cc +++ b/content/browser/plugin_loader_posix.cc @@ -131,7 +131,7 @@ void PluginLoaderPosix::OnPluginLoaded(uint32 index, } void PluginLoaderPosix::OnPluginLoadFailed(uint32 index, - const FilePath& plugin_path) { + const base::FilePath& plugin_path) { if (index != next_load_index_) { LOG(ERROR) << "Received unexpected plugin load failure message for " << plugin_path.value() << "; index=" << index; @@ -144,7 +144,8 @@ void PluginLoaderPosix::OnPluginLoadFailed(uint32 index, MaybeRunPendingCallbacks(); } -bool PluginLoaderPosix::MaybeAddInternalPlugin(const FilePath& plugin_path) { +bool PluginLoaderPosix::MaybeAddInternalPlugin( + const base::FilePath& plugin_path) { for (std::vector<webkit::WebPluginInfo>::iterator it = internal_plugins_.begin(); it != internal_plugins_.end(); diff --git a/content/browser/plugin_loader_posix.h b/content/browser/plugin_loader_posix.h index dca29ef..a43ef1f 100644 --- a/content/browser/plugin_loader_posix.h +++ b/content/browser/plugin_loader_posix.h @@ -83,11 +83,11 @@ class CONTENT_EXPORT PluginLoaderPosix // Message handlers. void OnPluginLoaded(uint32 index, const webkit::WebPluginInfo& plugin); - void OnPluginLoadFailed(uint32 index, const FilePath& plugin_path); + void OnPluginLoadFailed(uint32 index, const base::FilePath& plugin_path); // Checks if the plugin path is an internal plugin, and, if it is, adds it to // |loaded_plugins_|. - bool MaybeAddInternalPlugin(const FilePath& plugin_path); + bool MaybeAddInternalPlugin(const base::FilePath& plugin_path); // Runs all the registered callbacks on each's target loop if the condition // for ending the load process is done (i.e. the |next_load_index_| is outside @@ -99,7 +99,7 @@ class CONTENT_EXPORT PluginLoaderPosix // A list of paths to plugins which will be loaded by the utility process, in // the order specified by this vector. - std::vector<FilePath> canonical_list_; + std::vector<base::FilePath> canonical_list_; // The index in |canonical_list_| of the plugin that the child process will // attempt to load next. diff --git a/content/browser/plugin_loader_posix_unittest.cc b/content/browser/plugin_loader_posix_unittest.cc index dd10cee..01b961a 100644 --- a/content/browser/plugin_loader_posix_unittest.cc +++ b/content/browser/plugin_loader_posix_unittest.cc @@ -25,7 +25,7 @@ class MockPluginLoaderPosix : public PluginLoaderPosix { return callbacks_.size(); } - std::vector<FilePath>* canonical_list() { + std::vector<base::FilePath>* canonical_list() { return &canonical_list_; } @@ -49,7 +49,7 @@ class MockPluginLoaderPosix : public PluginLoaderPosix { OnPluginLoaded(index, plugin); } - void TestOnPluginLoadFailed(uint32 index, const FilePath& path) { + void TestOnPluginLoadFailed(uint32 index, const base::FilePath& path) { OnPluginLoadFailed(index, path); } @@ -64,11 +64,11 @@ void VerifyCallback(int* run_count, const std::vector<webkit::WebPluginInfo>&) { class PluginLoaderPosixTest : public testing::Test { public: PluginLoaderPosixTest() - : plugin1_(ASCIIToUTF16("plugin1"), FilePath("/tmp/one.plugin"), + : plugin1_(ASCIIToUTF16("plugin1"), base::FilePath("/tmp/one.plugin"), ASCIIToUTF16("1.0"), string16()), - plugin2_(ASCIIToUTF16("plugin2"), FilePath("/tmp/two.plugin"), + plugin2_(ASCIIToUTF16("plugin2"), base::FilePath("/tmp/two.plugin"), ASCIIToUTF16("2.0"), string16()), - plugin3_(ASCIIToUTF16("plugin3"), FilePath("/tmp/three.plugin"), + plugin3_(ASCIIToUTF16("plugin3"), base::FilePath("/tmp/three.plugin"), ASCIIToUTF16("3.0"), string16()), file_thread_(BrowserThread::FILE, &message_loop_), io_thread_(BrowserThread::IO, &message_loop_), @@ -304,7 +304,7 @@ TEST_F(PluginLoaderPosixTest, InternalPlugin) { EXPECT_CALL(*plugin_loader(), LoadPluginsInternal()).Times(1); message_loop()->RunUntilIdle(); - plugin2_.path = FilePath("/internal/plugin.plugin"); + plugin2_.path = base::FilePath("/internal/plugin.plugin"); AddThreePlugins(); diff --git a/content/browser/plugin_process_host.cc b/content/browser/plugin_process_host.cc index f95577d..d63aca9 100644 --- a/content/browser/plugin_process_host.cc +++ b/content/browser/plugin_process_host.cc @@ -167,7 +167,7 @@ bool PluginProcessHost::Init(const webkit::WebPluginInfo& info) { int flags = ChildProcessHost::CHILD_NORMAL; #endif - FilePath exe_path = ChildProcessHost::GetChildPath(flags); + base::FilePath exe_path = ChildProcessHost::GetChildPath(flags); if (exe_path.empty()) return false; @@ -238,7 +238,7 @@ bool PluginProcessHost::Init(const webkit::WebPluginInfo& info) { process_->Launch( #if defined(OS_WIN) - FilePath(), + base::FilePath(), #elif defined(OS_POSIX) false, env, diff --git a/content/browser/plugin_service_impl.cc b/content/browser/plugin_service_impl.cc index 7079828..7f393af 100644 --- a/content/browser/plugin_service_impl.cc +++ b/content/browser/plugin_service_impl.cc @@ -80,7 +80,7 @@ void NotifyPluginsOfActivation() { #endif #if defined(OS_POSIX) && !defined(OS_OPENBSD) && !defined(OS_ANDROID) -void NotifyPluginDirChanged(const FilePath& path, bool error) { +void NotifyPluginDirChanged(const base::FilePath& path, bool error) { if (error) { // TODO(pastarmovj): Add some sensible error handling. Maybe silently // stopping the watcher would be enough. Or possibly restart it. @@ -154,7 +154,7 @@ void PluginServiceImpl::Init() { if (command_line->HasSwitch(switches::kSitePerProcess)) { webkit::WebPluginInfo webview_plugin( ASCIIToUTF16("WebView Tag"), - FilePath(FILE_PATH_LITERAL("")), + base::FilePath(FILE_PATH_LITERAL("")), ASCIIToUTF16("1.2.3.4"), ASCIIToUTF16("Browser Plugin.")); webview_plugin.type = webkit::WebPluginInfo::PLUGIN_TYPE_NPAPI; @@ -168,7 +168,8 @@ void PluginServiceImpl::Init() { GetContentClient()->AddNPAPIPlugins(plugin_list_); // Load any specified on the command line as well. - FilePath path = command_line->GetSwitchValuePath(switches::kLoadPlugin); + base::FilePath path = + command_line->GetSwitchValuePath(switches::kLoadPlugin); if (!path.empty()) AddExtraPluginPath(path); path = command_line->GetSwitchValuePath(switches::kExtraPluginDir); @@ -210,7 +211,7 @@ void PluginServiceImpl::StartWatchingPlugins() { // Get the list of all paths for registering the FilePathWatchers // that will track and if needed reload the list of plugins on runtime. - std::vector<FilePath> plugin_dirs; + std::vector<base::FilePath> plugin_dirs; plugin_list_->GetPluginDirectories(&plugin_dirs); for (size_t i = 0; i < plugin_dirs.size(); ++i) { @@ -233,7 +234,7 @@ void PluginServiceImpl::StartWatchingPlugins() { } PluginProcessHost* PluginServiceImpl::FindNpapiPluginProcess( - const FilePath& plugin_path) { + const base::FilePath& plugin_path) { for (PluginProcessHostIterator iter; !iter.Done(); ++iter) { if (iter->info().path == plugin_path) return *iter; @@ -243,8 +244,8 @@ PluginProcessHost* PluginServiceImpl::FindNpapiPluginProcess( } PpapiPluginProcessHost* PluginServiceImpl::FindPpapiPluginProcess( - const FilePath& plugin_path, - const FilePath& profile_data_directory) { + const base::FilePath& plugin_path, + const base::FilePath& profile_data_directory) { for (PpapiPluginProcessHostIterator iter; !iter.Done(); ++iter) { if (iter->plugin_path() == plugin_path && iter->profile_data_directory() == profile_data_directory) { @@ -255,7 +256,7 @@ PpapiPluginProcessHost* PluginServiceImpl::FindPpapiPluginProcess( } PpapiPluginProcessHost* PluginServiceImpl::FindPpapiBrokerProcess( - const FilePath& broker_path) { + const base::FilePath& broker_path) { for (PpapiBrokerProcessHostIterator iter; !iter.Done(); ++iter) { if (iter->plugin_path() == broker_path) return *iter; @@ -266,7 +267,7 @@ PpapiPluginProcessHost* PluginServiceImpl::FindPpapiBrokerProcess( PluginProcessHost* PluginServiceImpl::FindOrStartNpapiPluginProcess( int render_process_id, - const FilePath& plugin_path) { + const base::FilePath& plugin_path) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); if (filter_ && !filter_->CanLoadPlugin(render_process_id, plugin_path)) @@ -292,8 +293,8 @@ PluginProcessHost* PluginServiceImpl::FindOrStartNpapiPluginProcess( PpapiPluginProcessHost* PluginServiceImpl::FindOrStartPpapiPluginProcess( int render_process_id, - const FilePath& plugin_path, - const FilePath& profile_data_directory, + const base::FilePath& plugin_path, + const base::FilePath& profile_data_directory, PpapiPluginProcessHost::PluginClient* client) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); @@ -318,7 +319,7 @@ PpapiPluginProcessHost* PluginServiceImpl::FindOrStartPpapiPluginProcess( PpapiPluginProcessHost* PluginServiceImpl::FindOrStartPpapiBrokerProcess( int render_process_id, - const FilePath& plugin_path) { + const base::FilePath& plugin_path) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); if (filter_ && !filter_->CanLoadPlugin(render_process_id, plugin_path)) @@ -365,8 +366,8 @@ void PluginServiceImpl::OpenChannelToNpapiPlugin( void PluginServiceImpl::OpenChannelToPpapiPlugin( int render_process_id, - const FilePath& plugin_path, - const FilePath& profile_data_directory, + const base::FilePath& plugin_path, + const base::FilePath& profile_data_directory, PpapiPluginProcessHost::PluginClient* client) { PpapiPluginProcessHost* plugin_host = FindOrStartPpapiPluginProcess( render_process_id, plugin_path, profile_data_directory, client); @@ -380,7 +381,7 @@ void PluginServiceImpl::OpenChannelToPpapiPlugin( void PluginServiceImpl::OpenChannelToPpapiBroker( int render_process_id, - const FilePath& path, + const base::FilePath& path, PpapiPluginProcessHost::BrokerClient* client) { PpapiPluginProcessHost* plugin_host = FindOrStartPpapiBrokerProcess( render_process_id, path); @@ -424,7 +425,7 @@ void PluginServiceImpl::GetAllowedPluginForOpenChannelToPlugin( render_process_id, render_view_id, resource_context, url, page_url, mime_type, allow_wildcard, NULL, &info, NULL); - FilePath plugin_path; + base::FilePath plugin_path; if (found) plugin_path = info.path; @@ -440,7 +441,7 @@ void PluginServiceImpl::GetAllowedPluginForOpenChannelToPlugin( void PluginServiceImpl::FinishOpenChannelToPlugin( int render_process_id, - const FilePath& plugin_path, + const base::FilePath& plugin_path, PluginProcessHost::Client* client) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); @@ -504,7 +505,7 @@ bool PluginServiceImpl::GetPluginInfo(int render_process_id, return false; } -bool PluginServiceImpl::GetPluginInfoByPath(const FilePath& plugin_path, +bool PluginServiceImpl::GetPluginInfoByPath(const base::FilePath& plugin_path, webkit::WebPluginInfo* info) { std::vector<webkit::WebPluginInfo> plugins; plugin_list_->GetPluginsNoRefresh(&plugins); @@ -521,7 +522,8 @@ bool PluginServiceImpl::GetPluginInfoByPath(const FilePath& plugin_path, return false; } -string16 PluginServiceImpl::GetPluginDisplayNameByPath(const FilePath& path) { +string16 PluginServiceImpl::GetPluginDisplayNameByPath( + const base::FilePath& path) { string16 plugin_name = path.LossyDisplayName(); webkit::WebPluginInfo info; if (PluginService::GetInstance()->GetPluginInfoByPath(path, &info) && @@ -613,7 +615,7 @@ void PluginServiceImpl::RegisterPepperPlugins() { // There should generally be very few plugins so a brute-force search is fine. PepperPluginInfo* PluginServiceImpl::GetRegisteredPpapiPluginInfo( - const FilePath& plugin_path) { + const base::FilePath& plugin_path) { PepperPluginInfo* info = NULL; for (size_t i = 0; i < ppapi_plugins_.size(); i++) { if (ppapi_plugins_[i].path == plugin_path) { @@ -641,7 +643,7 @@ PepperPluginInfo* PluginServiceImpl::GetRegisteredPpapiPluginInfo( #if defined(OS_POSIX) && !defined(OS_OPENBSD) && !defined(OS_ANDROID) // static void PluginServiceImpl::RegisterFilePathWatcher(FilePathWatcher* watcher, - const FilePath& path) { + const base::FilePath& path) { bool result = watcher->Watch(path, false, base::Bind(&NotifyPluginDirChanged)); DCHECK(result); @@ -656,7 +658,7 @@ PluginServiceFilter* PluginServiceImpl::GetFilter() { return filter_; } -void PluginServiceImpl::ForcePluginShutdown(const FilePath& plugin_path) { +void PluginServiceImpl::ForcePluginShutdown(const base::FilePath& plugin_path) { if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) { BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, @@ -673,9 +675,9 @@ void PluginServiceImpl::ForcePluginShutdown(const FilePath& plugin_path) { static const unsigned int kMaxCrashesPerInterval = 3; static const unsigned int kCrashesInterval = 120; -void PluginServiceImpl::RegisterPluginCrash(const FilePath& path) { +void PluginServiceImpl::RegisterPluginCrash(const base::FilePath& path) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); - std::map<FilePath, std::vector<base::Time> >::iterator i = + std::map<base::FilePath, std::vector<base::Time> >::iterator i = crash_times_.find(path); if (i == crash_times_.end()) { crash_times_[path] = std::vector<base::Time>(); @@ -688,9 +690,9 @@ void PluginServiceImpl::RegisterPluginCrash(const FilePath& path) { i->second.push_back(time); } -bool PluginServiceImpl::IsPluginUnstable(const FilePath& path) { +bool PluginServiceImpl::IsPluginUnstable(const base::FilePath& path) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); - std::map<FilePath, std::vector<base::Time> >::const_iterator i = + std::map<base::FilePath, std::vector<base::Time> >::const_iterator i = crash_times_.find(path); if (i == crash_times_.end()) { return false; @@ -709,19 +711,19 @@ void PluginServiceImpl::RefreshPlugins() { plugin_list_->RefreshPlugins(); } -void PluginServiceImpl::AddExtraPluginPath(const FilePath& path) { +void PluginServiceImpl::AddExtraPluginPath(const base::FilePath& path) { plugin_list_->AddExtraPluginPath(path); } -void PluginServiceImpl::AddExtraPluginDir(const FilePath& path) { +void PluginServiceImpl::AddExtraPluginDir(const base::FilePath& path) { plugin_list_->AddExtraPluginDir(path); } -void PluginServiceImpl::RemoveExtraPluginPath(const FilePath& path) { +void PluginServiceImpl::RemoveExtraPluginPath(const base::FilePath& path) { plugin_list_->RemoveExtraPluginPath(path); } -void PluginServiceImpl::UnregisterInternalPlugin(const FilePath& path) { +void PluginServiceImpl::UnregisterInternalPlugin(const base::FilePath& path) { plugin_list_->UnregisterInternalPlugin(path); } diff --git a/content/browser/plugin_service_impl.h b/content/browser/plugin_service_impl.h index 8003b65..9ee6c43 100644 --- a/content/browser/plugin_service_impl.h +++ b/content/browser/plugin_service_impl.h @@ -88,21 +88,22 @@ class CONTENT_EXPORT PluginServiceImpl bool* is_stale, webkit::WebPluginInfo* info, std::string* actual_mime_type) OVERRIDE; - virtual bool GetPluginInfoByPath(const FilePath& plugin_path, + virtual bool GetPluginInfoByPath(const base::FilePath& plugin_path, webkit::WebPluginInfo* info) OVERRIDE; - virtual string16 GetPluginDisplayNameByPath(const FilePath& path) OVERRIDE; + virtual string16 GetPluginDisplayNameByPath( + const base::FilePath& path) OVERRIDE; virtual void GetPlugins(const GetPluginsCallback& callback) OVERRIDE; virtual PepperPluginInfo* GetRegisteredPpapiPluginInfo( - const FilePath& plugin_path) OVERRIDE; + const base::FilePath& plugin_path) OVERRIDE; virtual void SetFilter(PluginServiceFilter* filter) OVERRIDE; virtual PluginServiceFilter* GetFilter() OVERRIDE; - virtual void ForcePluginShutdown(const FilePath& plugin_path) OVERRIDE; - virtual bool IsPluginUnstable(const FilePath& plugin_path) OVERRIDE; + virtual void ForcePluginShutdown(const base::FilePath& plugin_path) OVERRIDE; + virtual bool IsPluginUnstable(const base::FilePath& plugin_path) OVERRIDE; virtual void RefreshPlugins() OVERRIDE; - virtual void AddExtraPluginPath(const FilePath& path) OVERRIDE; - virtual void AddExtraPluginDir(const FilePath& path) OVERRIDE; - virtual void RemoveExtraPluginPath(const FilePath& path) OVERRIDE; - virtual void UnregisterInternalPlugin(const FilePath& path) OVERRIDE; + virtual void AddExtraPluginPath(const base::FilePath& path) OVERRIDE; + virtual void AddExtraPluginDir(const base::FilePath& path) OVERRIDE; + virtual void RemoveExtraPluginPath(const base::FilePath& path) OVERRIDE; + virtual void UnregisterInternalPlugin(const base::FilePath& path) OVERRIDE; virtual void RegisterInternalPlugin( const webkit::WebPluginInfo& info, bool add_at_beginning) OVERRIDE; virtual void GetInternalPlugins( @@ -119,14 +120,14 @@ class CONTENT_EXPORT PluginServiceImpl // 'plugin_path' if needed. If the process fails to start, the return value // is NULL. Must be called on the IO thread. PluginProcessHost* FindOrStartNpapiPluginProcess( - int render_process_id, const FilePath& plugin_path); + int render_process_id, const base::FilePath& plugin_path); PpapiPluginProcessHost* FindOrStartPpapiPluginProcess( int render_process_id, - const FilePath& plugin_path, - const FilePath& profile_data_directory, + const base::FilePath& plugin_path, + const base::FilePath& profile_data_directory, PpapiPluginProcessHost::PluginClient* client); PpapiPluginProcessHost* FindOrStartPpapiBrokerProcess( - int render_process_id, const FilePath& plugin_path); + int render_process_id, const base::FilePath& plugin_path); // Opens a channel to a plugin process for the given mime type, starting // a new plugin process if necessary. This must be called on the IO thread @@ -138,18 +139,18 @@ class CONTENT_EXPORT PluginServiceImpl const std::string& mime_type, PluginProcessHost::Client* client); void OpenChannelToPpapiPlugin(int render_process_id, - const FilePath& plugin_path, - const FilePath& profile_data_directory, + const base::FilePath& plugin_path, + const base::FilePath& profile_data_directory, PpapiPluginProcessHost::PluginClient* client); void OpenChannelToPpapiBroker(int render_process_id, - const FilePath& path, + const base::FilePath& path, PpapiPluginProcessHost::BrokerClient* client); // Cancels opening a channel to a NPAPI plugin. void CancelOpenChannelToNpapiPlugin(PluginProcessHost::Client* client); // Used to monitor plug-in stability. - void RegisterPluginCrash(const FilePath& plugin_path); + void RegisterPluginCrash(const base::FilePath& plugin_path); private: friend struct DefaultSingletonTraits<PluginServiceImpl>; @@ -164,11 +165,12 @@ class CONTENT_EXPORT PluginServiceImpl // Returns the plugin process host corresponding to the plugin process that // has been started by this service. Returns NULL if no process has been // started. - PluginProcessHost* FindNpapiPluginProcess(const FilePath& plugin_path); + PluginProcessHost* FindNpapiPluginProcess(const base::FilePath& plugin_path); PpapiPluginProcessHost* FindPpapiPluginProcess( - const FilePath& plugin_path, - const FilePath& profile_data_directory); - PpapiPluginProcessHost* FindPpapiBrokerProcess(const FilePath& broker_path); + const base::FilePath& plugin_path, + const base::FilePath& profile_data_directory); + PpapiPluginProcessHost* FindPpapiBrokerProcess( + const base::FilePath& broker_path); void RegisterPepperPlugins(); @@ -197,13 +199,13 @@ class CONTENT_EXPORT PluginServiceImpl // Helper so we can finish opening the channel after looking up the // plugin. void FinishOpenChannelToPlugin(int render_process_id, - const FilePath& plugin_path, + const base::FilePath& plugin_path, PluginProcessHost::Client* client); #if defined(OS_POSIX) && !defined(OS_OPENBSD) && !defined(OS_ANDROID) // Registers a new FilePathWatcher for a given path. static void RegisterFilePathWatcher(base::FilePathWatcher* watcher, - const FilePath& path); + const base::FilePath& path); #endif // The plugin list instance. @@ -238,7 +240,7 @@ class CONTENT_EXPORT PluginServiceImpl #endif // Used to detect if a given plug-in is crashing over and over. - std::map<FilePath, std::vector<base::Time> > crash_times_; + std::map<base::FilePath, std::vector<base::Time> > crash_times_; DISALLOW_COPY_AND_ASSIGN(PluginServiceImpl); }; diff --git a/content/browser/plugin_service_impl_browsertest.cc b/content/browser/plugin_service_impl_browsertest.cc index 94b929a..838aec4 100644 --- a/content/browser/plugin_service_impl_browsertest.cc +++ b/content/browser/plugin_service_impl_browsertest.cc @@ -131,7 +131,7 @@ class MockPluginServiceFilter : public content::PluginServiceFilter { virtual bool CanLoadPlugin( int render_process_id, - const FilePath& path) OVERRIDE { return false; } + const base::FilePath& path) OVERRIDE { return false; } }; class PluginServiceTest : public ContentBrowserTest { @@ -144,7 +144,7 @@ class PluginServiceTest : public ContentBrowserTest { virtual void SetUpCommandLine(CommandLine* command_line) { #ifdef OS_MACOSX - FilePath browser_directory; + base::FilePath browser_directory; PathService::Get(base::DIR_MODULE, &browser_directory); command_line->AppendSwitchPath(switches::kExtraPluginDir, browser_directory.AppendASCII("plugins")); diff --git a/content/browser/ppapi_plugin_process_host.cc b/content/browser/ppapi_plugin_process_host.cc index 3d07a60..1ea54d1 100644 --- a/content/browser/ppapi_plugin_process_host.cc +++ b/content/browser/ppapi_plugin_process_host.cc @@ -74,7 +74,7 @@ PpapiPluginProcessHost::~PpapiPluginProcessHost() { // static PpapiPluginProcessHost* PpapiPluginProcessHost::CreatePluginHost( const PepperPluginInfo& info, - const FilePath& profile_data_directory, + const base::FilePath& profile_data_directory, net::HostResolver* host_resolver) { PpapiPluginProcessHost* plugin_host = new PpapiPluginProcessHost( info, profile_data_directory, host_resolver); @@ -166,7 +166,7 @@ void PpapiPluginProcessHost::OpenChannelToPlugin(Client* client) { PpapiPluginProcessHost::PpapiPluginProcessHost( const PepperPluginInfo& info, - const FilePath& profile_data_directory, + const base::FilePath& profile_data_directory, net::HostResolver* host_resolver) : permissions_( ppapi::PpapiPermissions::GetForCommandLine(info.permissions)), @@ -202,7 +202,7 @@ PpapiPluginProcessHost::PpapiPluginProcessHost() // The plugin name and profile data directory shouldn't be needed for the // broker. std::string plugin_name; - FilePath profile_data_directory; + base::FilePath profile_data_directory; host_impl_.reset(new BrowserPpapiHostImpl(this, permissions, plugin_name, profile_data_directory, process_->GetData().type)); @@ -230,7 +230,7 @@ bool PpapiPluginProcessHost::Init(const PepperPluginInfo& info) { #else int flags = ChildProcessHost::CHILD_NORMAL; #endif - FilePath exe_path = ChildProcessHost::GetChildPath(flags); + base::FilePath exe_path = ChildProcessHost::GetChildPath(flags); if (exe_path.empty()) return false; @@ -284,7 +284,7 @@ bool PpapiPluginProcessHost::Init(const PepperPluginInfo& info) { #endif // OS_POSIX process_->Launch( #if defined(OS_WIN) - FilePath(), + base::FilePath(), #elif defined(OS_POSIX) use_zygote, base::EnvironmentVector(), diff --git a/content/browser/ppapi_plugin_process_host.h b/content/browser/ppapi_plugin_process_host.h index c5b6bc1..01a43c9 100644 --- a/content/browser/ppapi_plugin_process_host.h +++ b/content/browser/ppapi_plugin_process_host.h @@ -76,7 +76,7 @@ class PpapiPluginProcessHost : public BrowserChildProcessHostDelegate, static PpapiPluginProcessHost* CreatePluginHost( const PepperPluginInfo& info, - const FilePath& profile_data_directory, + const base::FilePath& profile_data_directory, net::HostResolver* host_resolver); static PpapiPluginProcessHost* CreateBrokerHost( const PepperPluginInfo& info); @@ -107,8 +107,8 @@ class PpapiPluginProcessHost : public BrowserChildProcessHostDelegate, // channel is ready or if there's an error. void OpenChannelToPlugin(Client* client); - const FilePath& plugin_path() const { return plugin_path_; } - const FilePath& profile_data_directory() const { + const base::FilePath& plugin_path() const { return plugin_path_; } + const base::FilePath& profile_data_directory() const { return profile_data_directory_; } @@ -120,7 +120,7 @@ class PpapiPluginProcessHost : public BrowserChildProcessHostDelegate, // Constructors for plugin and broker process hosts, respectively. // You must call Init before doing anything else. PpapiPluginProcessHost(const PepperPluginInfo& info, - const FilePath& profile_data_directory, + const base::FilePath& profile_data_directory, net::HostResolver* host_resolver); PpapiPluginProcessHost(); @@ -160,10 +160,10 @@ class PpapiPluginProcessHost : public BrowserChildProcessHostDelegate, std::queue<Client*> sent_requests_; // Path to the plugin library. - FilePath plugin_path_; + base::FilePath plugin_path_; // Path to the top-level plugin data directory (differs based upon profile). - FilePath profile_data_directory_; + base::FilePath profile_data_directory_; const bool is_broker_; diff --git a/content/browser/renderer_host/database_message_filter.cc b/content/browser/renderer_host/database_message_filter.cc index f0ff6ca..f8b0aa6 100644 --- a/content/browser/renderer_host/database_message_filter.cc +++ b/content/browser/renderer_host/database_message_filter.cc @@ -136,7 +136,7 @@ void DatabaseMessageFilter::OnDatabaseOpenFile(const string16& vfs_file_name, &database_name, NULL) && !db_tracker_->IsDatabaseScheduledForDeletion(origin_identifier, database_name)) { - FilePath db_file = + base::FilePath db_file = DatabaseUtil::GetFullFilePathForVfsFile(db_tracker_, vfs_file_name); if (!db_file.empty()) { if (db_tracker_->IsIncognitoProfile()) { @@ -180,7 +180,7 @@ void DatabaseMessageFilter::DatabaseDeleteFile(const string16& vfs_file_name, // Return an error if the file name is invalid or if the file could not // be deleted after kNumDeleteRetries attempts. int error_code = SQLITE_IOERR_DELETE; - FilePath db_file = + base::FilePath db_file = DatabaseUtil::GetFullFilePathForVfsFile(db_tracker_, vfs_file_name); if (!db_file.empty()) { // In order to delete a journal file in incognito mode, we only need to @@ -222,7 +222,7 @@ void DatabaseMessageFilter::OnDatabaseGetFileAttributes( IPC::Message* reply_msg) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); int32 attributes = -1; - FilePath db_file = + base::FilePath db_file = DatabaseUtil::GetFullFilePathForVfsFile(db_tracker_, vfs_file_name); if (!db_file.empty()) attributes = VfsBackend::GetFileAttributes(db_file); @@ -236,7 +236,7 @@ void DatabaseMessageFilter::OnDatabaseGetFileSize( const string16& vfs_file_name, IPC::Message* reply_msg) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); int64 size = 0; - FilePath db_file = + base::FilePath db_file = DatabaseUtil::GetFullFilePathForVfsFile(db_tracker_, vfs_file_name); if (!db_file.empty()) size = VfsBackend::GetFileSize(db_file); diff --git a/content/browser/renderer_host/file_utilities_message_filter.cc b/content/browser/renderer_host/file_utilities_message_filter.cc index 6ecf628..a2fcd80 100644 --- a/content/browser/renderer_host/file_utilities_message_filter.cc +++ b/content/browser/renderer_host/file_utilities_message_filter.cc @@ -36,7 +36,7 @@ bool FileUtilitiesMessageFilter::OnMessageReceived(const IPC::Message& message, } void FileUtilitiesMessageFilter::OnGetFileInfo( - const FilePath& path, + const base::FilePath& path, base::PlatformFileInfo* result, base::PlatformFileError* status) { *result = base::PlatformFileInfo(); @@ -54,7 +54,7 @@ void FileUtilitiesMessageFilter::OnGetFileInfo( } void FileUtilitiesMessageFilter::OnOpenFile( - const FilePath& path, + const base::FilePath& path, int mode, IPC::PlatformFileForTransit* result) { // Open the file only when the child process has been granted permission to diff --git a/content/browser/renderer_host/file_utilities_message_filter.h b/content/browser/renderer_host/file_utilities_message_filter.h index d698885..9faacef 100644 --- a/content/browser/renderer_host/file_utilities_message_filter.h +++ b/content/browser/renderer_host/file_utilities_message_filter.h @@ -36,10 +36,10 @@ class FileUtilitiesMessageFilter : public BrowserMessageFilter { typedef void (*FileInfoWriteFunc)(IPC::Message* reply_msg, const base::PlatformFileInfo& file_info); - void OnGetFileInfo(const FilePath& path, + void OnGetFileInfo(const base::FilePath& path, base::PlatformFileInfo* result, base::PlatformFileError* status); - void OnOpenFile(const FilePath& path, + void OnOpenFile(const base::FilePath& path, int mode, IPC::PlatformFileForTransit* result); diff --git a/content/browser/renderer_host/gtk_key_bindings_handler_unittest.cc b/content/browser/renderer_host/gtk_key_bindings_handler_unittest.cc index 0cb990a..379ea1f 100644 --- a/content/browser/renderer_host/gtk_key_bindings_handler_unittest.cc +++ b/content/browser/renderer_host/gtk_key_bindings_handler_unittest.cc @@ -31,7 +31,7 @@ class GtkKeyBindingsHandlerTest : public testing::Test { GtkKeyBindingsHandlerTest() : window_(gtk_window_new(GTK_WINDOW_TOPLEVEL)), handler_(NULL) { - FilePath gtkrc; + base::FilePath gtkrc; PathService::Get(DIR_TEST_DATA, >krc); gtkrc = gtkrc.AppendASCII("gtk_key_bindings_test_gtkrc"); EXPECT_TRUE(file_util::PathExists(gtkrc)); diff --git a/content/browser/renderer_host/media/video_capture_host_unittest.cc b/content/browser/renderer_host/media/video_capture_host_unittest.cc index 71fcfcf..89bdf36 100644 --- a/content/browser/renderer_host/media/video_capture_host_unittest.cc +++ b/content/browser/renderer_host/media/video_capture_host_unittest.cc @@ -53,7 +53,7 @@ class DumpVideo { public: DumpVideo() : expected_size_(0) {} void StartDump(int width, int height) { - FilePath file_name = FilePath( + base::FilePath file_name = base::FilePath( StringPrintf(FILE_PATH_LITERAL("dump_w%d_h%d.yuv"), width, height)); file_.reset(file_util::OpenFile(file_name, "wb")); expected_size_ = width * height * 3 / 2; diff --git a/content/browser/renderer_host/pepper/browser_ppapi_host_impl.cc b/content/browser/renderer_host/pepper/browser_ppapi_host_impl.cc index c5b87af..5337874 100644 --- a/content/browser/renderer_host/pepper/browser_ppapi_host_impl.cc +++ b/content/browser/renderer_host/pepper/browser_ppapi_host_impl.cc @@ -26,7 +26,7 @@ BrowserPpapiHost* BrowserPpapiHost::CreateExternalPluginProcess( // profile_data_directory through for NaCl. They are currently only needed for // PPB_Flash_File interfaces so it doesn't matter. std::string plugin_name; - FilePath profile_data_directory; + base::FilePath profile_data_directory; BrowserPpapiHostImpl* browser_ppapi_host = new BrowserPpapiHostImpl(sender, permissions, plugin_name, profile_data_directory, @@ -49,7 +49,7 @@ BrowserPpapiHostImpl::BrowserPpapiHostImpl( IPC::Sender* sender, const ppapi::PpapiPermissions& permissions, const std::string& plugin_name, - const FilePath& profile_data_directory, + const base::FilePath& profile_data_directory, ProcessType plugin_process_type) : ppapi_host_(new ppapi::host::PpapiHost(sender, permissions)), plugin_process_handle_(base::kNullProcessHandle), @@ -105,7 +105,7 @@ const std::string& BrowserPpapiHostImpl::GetPluginName() { return plugin_name_; } -const FilePath& BrowserPpapiHostImpl::GetProfileDataDirectory() { +const base::FilePath& BrowserPpapiHostImpl::GetProfileDataDirectory() { return profile_data_directory_; } diff --git a/content/browser/renderer_host/pepper/browser_ppapi_host_impl.h b/content/browser/renderer_host/pepper/browser_ppapi_host_impl.h index 70fe516..9271805 100644 --- a/content/browser/renderer_host/pepper/browser_ppapi_host_impl.h +++ b/content/browser/renderer_host/pepper/browser_ppapi_host_impl.h @@ -30,7 +30,7 @@ class CONTENT_EXPORT BrowserPpapiHostImpl : public BrowserPpapiHost { BrowserPpapiHostImpl(IPC::Sender* sender, const ppapi::PpapiPermissions& permissions, const std::string& plugin_name, - const FilePath& profile_data_directory, + const base::FilePath& profile_data_directory, ProcessType plugin_process_type); virtual ~BrowserPpapiHostImpl(); @@ -42,7 +42,7 @@ class CONTENT_EXPORT BrowserPpapiHostImpl : public BrowserPpapiHost { int* render_process_id, int* render_view_id) const OVERRIDE; virtual const std::string& GetPluginName() OVERRIDE; - virtual const FilePath& GetProfileDataDirectory() OVERRIDE; + virtual const base::FilePath& GetProfileDataDirectory() OVERRIDE; virtual GURL GetDocumentURLForInstance(PP_Instance instance) OVERRIDE; virtual GURL GetPluginURLForInstance(PP_Instance instance) OVERRIDE; @@ -87,7 +87,7 @@ class CONTENT_EXPORT BrowserPpapiHostImpl : public BrowserPpapiHost { scoped_ptr<ppapi::host::PpapiHost> ppapi_host_; base::ProcessHandle plugin_process_handle_; std::string plugin_name_; - FilePath profile_data_directory_; + base::FilePath profile_data_directory_; ProcessType plugin_process_type_; // Tracks all PP_Instances in this plugin and associated renderer-related diff --git a/content/browser/renderer_host/pepper/browser_ppapi_host_test.cc b/content/browser/renderer_host/pepper/browser_ppapi_host_test.cc index 8286115..0f0b9bd 100644 --- a/content/browser/renderer_host/pepper/browser_ppapi_host_test.cc +++ b/content/browser/renderer_host/pepper/browser_ppapi_host_test.cc @@ -15,7 +15,7 @@ BrowserPpapiHostTest::BrowserPpapiHostTest() &sink_, ppapi::PpapiPermissions::AllPermissions(), std::string(), - FilePath(), + base::FilePath(), PROCESS_TYPE_UNKNOWN)); ppapi_host_->set_plugin_process_handle(base::GetCurrentProcessHandle()); } diff --git a/content/browser/renderer_host/pepper/pepper_flash_file_message_filter.cc b/content/browser/renderer_host/pepper/pepper_flash_file_message_filter.cc index 30c07d94..e051d97 100644 --- a/content/browser/renderer_host/pepper/pepper_flash_file_message_filter.cc +++ b/content/browser/renderer_host/pepper/pepper_flash_file_message_filter.cc @@ -44,7 +44,7 @@ PepperFlashFileMessageFilter::PepperFlashFileMessageFilter( : plugin_process_handle_(host->GetPluginProcessHandle()) { int unused; host->GetRenderViewIDsForInstance(instance, &render_process_id_, &unused); - FilePath profile_data_directory = host->GetProfileDataDirectory(); + base::FilePath profile_data_directory = host->GetProfileDataDirectory(); std::string plugin_name = host->GetPluginName(); if (profile_data_directory.empty() || plugin_name.empty()) { @@ -54,8 +54,8 @@ PepperFlashFileMessageFilter::PepperFlashFileMessageFilter( // |ValidateAndConvertPepperFilePath| will fail. NOTREACHED(); } else { - plugin_data_directory_ = GetDataDirName( - profile_data_directory).Append(FilePath::FromUTF8Unsafe(plugin_name)); + plugin_data_directory_ = GetDataDirName(profile_data_directory).Append( + base::FilePath::FromUTF8Unsafe(plugin_name)); } } @@ -63,8 +63,8 @@ PepperFlashFileMessageFilter::~PepperFlashFileMessageFilter() { } // static -FilePath PepperFlashFileMessageFilter::GetDataDirName( - const FilePath& profile_path) { +base::FilePath PepperFlashFileMessageFilter::GetDataDirName( + const base::FilePath& profile_path) { return profile_path.Append(kPepperDataDirname); } @@ -109,7 +109,7 @@ int32_t PepperFlashFileMessageFilter::OnOpenFile( ppapi::host::HostMessageContext* context, const ppapi::PepperFilePath& path, int flags) { - FilePath full_path = ValidateAndConvertPepperFilePath(path, flags); + base::FilePath full_path = ValidateAndConvertPepperFilePath(path, flags); if (full_path.empty()) { return ppapi::PlatformFileErrorToPepperError( base::PLATFORM_FILE_ERROR_ACCESS_DENIED); @@ -147,10 +147,10 @@ int32_t PepperFlashFileMessageFilter::OnRenameFile( ppapi::host::HostMessageContext* context, const ppapi::PepperFilePath& from_path, const ppapi::PepperFilePath& to_path) { - FilePath from_full_path = ValidateAndConvertPepperFilePath(from_path, - kWritePermissions); - FilePath to_full_path = ValidateAndConvertPepperFilePath(to_path, - kWritePermissions); + base::FilePath from_full_path = ValidateAndConvertPepperFilePath( + from_path, kWritePermissions); + base::FilePath to_full_path = ValidateAndConvertPepperFilePath( + to_path, kWritePermissions); if (from_full_path.empty() || to_full_path.empty()) { return ppapi::PlatformFileErrorToPepperError( base::PLATFORM_FILE_ERROR_ACCESS_DENIED); @@ -165,8 +165,8 @@ int32_t PepperFlashFileMessageFilter::OnDeleteFileOrDir( ppapi::host::HostMessageContext* context, const ppapi::PepperFilePath& path, bool recursive) { - FilePath full_path = ValidateAndConvertPepperFilePath(path, - kWritePermissions); + base::FilePath full_path = ValidateAndConvertPepperFilePath( + path, kWritePermissions); if (full_path.empty()) { return ppapi::PlatformFileErrorToPepperError( base::PLATFORM_FILE_ERROR_ACCESS_DENIED); @@ -179,8 +179,8 @@ int32_t PepperFlashFileMessageFilter::OnDeleteFileOrDir( int32_t PepperFlashFileMessageFilter::OnCreateDir( ppapi::host::HostMessageContext* context, const ppapi::PepperFilePath& path) { - FilePath full_path = ValidateAndConvertPepperFilePath(path, - kWritePermissions); + base::FilePath full_path = ValidateAndConvertPepperFilePath( + path, kWritePermissions); if (full_path.empty()) { return ppapi::PlatformFileErrorToPepperError( base::PLATFORM_FILE_ERROR_ACCESS_DENIED); @@ -194,8 +194,8 @@ int32_t PepperFlashFileMessageFilter::OnCreateDir( int32_t PepperFlashFileMessageFilter::OnQueryFile( ppapi::host::HostMessageContext* context, const ppapi::PepperFilePath& path) { - FilePath full_path = ValidateAndConvertPepperFilePath(path, - kReadPermissions); + base::FilePath full_path = ValidateAndConvertPepperFilePath( + path, kReadPermissions); if (full_path.empty()) { return ppapi::PlatformFileErrorToPepperError( base::PLATFORM_FILE_ERROR_ACCESS_DENIED); @@ -211,7 +211,8 @@ int32_t PepperFlashFileMessageFilter::OnQueryFile( int32_t PepperFlashFileMessageFilter::OnGetDirContents( ppapi::host::HostMessageContext* context, const ppapi::PepperFilePath& path) { - FilePath full_path = ValidateAndConvertPepperFilePath(path, kReadPermissions); + base::FilePath full_path = ValidateAndConvertPepperFilePath( + path, kReadPermissions); if (full_path.empty()) { return ppapi::PlatformFileErrorToPepperError( base::PLATFORM_FILE_ERROR_ACCESS_DENIED); @@ -240,8 +241,8 @@ int32_t PepperFlashFileMessageFilter::OnGetDirContents( int32_t PepperFlashFileMessageFilter::OnCreateTemporaryFile( ppapi::host::HostMessageContext* context) { ppapi::PepperFilePath dir_path( - ppapi::PepperFilePath::DOMAIN_MODULE_LOCAL, FilePath()); - FilePath validated_dir_path = ValidateAndConvertPepperFilePath( + ppapi::PepperFilePath::DOMAIN_MODULE_LOCAL, base::FilePath()); + base::FilePath validated_dir_path = ValidateAndConvertPepperFilePath( dir_path, kReadPermissions | kWritePermissions); if (validated_dir_path.empty() || (!file_util::DirectoryExists(validated_dir_path) && @@ -250,7 +251,7 @@ int32_t PepperFlashFileMessageFilter::OnCreateTemporaryFile( base::PLATFORM_FILE_ERROR_ACCESS_DENIED); } - FilePath file_path; + base::FilePath file_path; if (!file_util::CreateTemporaryFileInDir(validated_dir_path, &file_path)) { return ppapi::PlatformFileErrorToPepperError( base::PLATFORM_FILE_ERROR_FAILED); @@ -279,10 +280,10 @@ int32_t PepperFlashFileMessageFilter::OnCreateTemporaryFile( return PP_OK_COMPLETIONPENDING; } -FilePath PepperFlashFileMessageFilter::ValidateAndConvertPepperFilePath( +base::FilePath PepperFlashFileMessageFilter::ValidateAndConvertPepperFilePath( const ppapi::PepperFilePath& pepper_path, int flags) { - FilePath file_path; // Empty path returned on error. + base::FilePath file_path; // Empty path returned on error. switch (pepper_path.domain()) { case ppapi::PepperFilePath::DOMAIN_ABSOLUTE: if (pepper_path.path().IsAbsolute() && diff --git a/content/browser/renderer_host/pepper/pepper_flash_file_message_filter.h b/content/browser/renderer_host/pepper/pepper_flash_file_message_filter.h index 216a6fb..3845528 100644 --- a/content/browser/renderer_host/pepper/pepper_flash_file_message_filter.h +++ b/content/browser/renderer_host/pepper/pepper_flash_file_message_filter.h @@ -37,7 +37,7 @@ class PepperFlashFileMessageFilter : public ppapi::host::ResourceMessageFilter { PepperFlashFileMessageFilter(PP_Instance instance, BrowserPpapiHost* host); - static FilePath GetDataDirName(const FilePath& profile_path); + static base::FilePath GetDataDirName(const base::FilePath& profile_path); private: virtual ~PepperFlashFileMessageFilter(); @@ -66,7 +66,7 @@ class PepperFlashFileMessageFilter : public ppapi::host::ResourceMessageFilter { const ppapi::PepperFilePath& path); int32_t OnCreateTemporaryFile(ppapi::host::HostMessageContext* context); - FilePath ValidateAndConvertPepperFilePath( + base::FilePath ValidateAndConvertPepperFilePath( const ppapi::PepperFilePath& pepper_path, int flags); diff --git a/content/browser/renderer_host/pepper/pepper_message_filter.h b/content/browser/renderer_host/pepper/pepper_message_filter.h index 963ec23..13164c6 100644 --- a/content/browser/renderer_host/pepper/pepper_message_filter.h +++ b/content/browser/renderer_host/pepper/pepper_message_filter.h @@ -249,7 +249,7 @@ class PepperMessageFilter NetworkMonitorIdSet network_monitor_ids_; - FilePath browser_path_; + base::FilePath browser_path_; bool incognito_; DISALLOW_COPY_AND_ASSIGN(PepperMessageFilter); diff --git a/content/browser/renderer_host/render_message_filter.cc b/content/browser/renderer_host/render_message_filter.cc index 9bd597b..5456ea1 100644 --- a/content/browser/renderer_host/render_message_filter.cc +++ b/content/browser/renderer_host/render_message_filter.cc @@ -717,7 +717,7 @@ void RenderMessageFilter::OnOpenChannelToPlugin(int routing_id, } void RenderMessageFilter::OnOpenChannelToPepperPlugin( - const FilePath& path, + const base::FilePath& path, IPC::Message* reply_msg) { plugin_service_->OpenChannelToPpapiPlugin( render_process_id_, @@ -769,9 +769,10 @@ void RenderMessageFilter::OnDidDeleteOutOfProcessPepperInstance( } } -void RenderMessageFilter::OnOpenChannelToPpapiBroker(int routing_id, - int request_id, - const FilePath& path) { +void RenderMessageFilter::OnOpenChannelToPpapiBroker( + int routing_id, + int request_id, + const base::FilePath& path) { plugin_service_->OpenChannelToPpapiBroker( render_process_id_, path, @@ -968,7 +969,7 @@ void RenderMessageFilter::OnKeygenOnWorkerThread( } void RenderMessageFilter::OnAsyncOpenFile(const IPC::Message& msg, - const FilePath& path, + const base::FilePath& path, int flags, int message_id) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); @@ -987,7 +988,7 @@ void RenderMessageFilter::OnAsyncOpenFile(const IPC::Message& msg, path, flags, message_id, msg.routing_id())); } -void RenderMessageFilter::AsyncOpenFileOnFileThread(const FilePath& path, +void RenderMessageFilter::AsyncOpenFileOnFileThread(const base::FilePath& path, int flags, int message_id, int routing_id) { diff --git a/content/browser/renderer_host/render_message_filter.h b/content/browser/renderer_host/render_message_filter.h index 4218fd7..3a1bdd2 100644 --- a/content/browser/renderer_host/render_message_filter.h +++ b/content/browser/renderer_host/render_message_filter.h @@ -167,7 +167,7 @@ class RenderMessageFilter : public BrowserMessageFilter { const GURL& policy_url, const std::string& mime_type, IPC::Message* reply_msg); - void OnOpenChannelToPepperPlugin(const FilePath& path, + void OnOpenChannelToPepperPlugin(const base::FilePath& path, IPC::Message* reply_msg); void OnDidCreateOutOfProcessPepperInstance( int plugin_child_id, @@ -179,7 +179,7 @@ class RenderMessageFilter : public BrowserMessageFilter { bool is_external); void OnOpenChannelToPpapiBroker(int routing_id, int request_id, - const FilePath& path); + const base::FilePath& path); void OnGenerateRoutingID(int* route_id); void OnDownloadUrl(const IPC::Message& message, const GURL& url, @@ -220,10 +220,10 @@ class RenderMessageFilter : public BrowserMessageFilter { const GURL& url, IPC::Message* reply_msg); void OnAsyncOpenFile(const IPC::Message& msg, - const FilePath& path, + const base::FilePath& path, int flags, int message_id); - void AsyncOpenFileOnFileThread(const FilePath& path, + void AsyncOpenFileOnFileThread(const base::FilePath& path, int flags, int message_id, int routing_id); @@ -261,7 +261,7 @@ class RenderMessageFilter : public BrowserMessageFilter { // by the BrowserProcess, which has a wider scope than we do. ResourceDispatcherHostImpl* resource_dispatcher_host_; PluginServiceImpl* plugin_service_; - FilePath profile_data_directory_; + base::FilePath profile_data_directory_; // Contextual information to be used for requests created here. scoped_refptr<net::URLRequestContextGetter> request_context_; diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc index 43c2c5c4..39df2cc 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc @@ -402,7 +402,7 @@ bool RenderProcessHostImpl::Init() { // Find the renderer before creating the channel so if this fails early we // return without creating the channel. - FilePath renderer_path = ChildProcessHost::GetChildPath(flags); + base::FilePath renderer_path = ChildProcessHost::GetChildPath(flags); if (renderer_path.empty()) return false; @@ -463,7 +463,7 @@ bool RenderProcessHostImpl::Init() { // at this stage. child_process_launcher_.reset(new ChildProcessLauncher( #if defined(OS_WIN) - FilePath(), + base::FilePath(), #elif defined(OS_POSIX) renderer_prefix.empty(), base::EnvironmentVector(), diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc index 3fb2b36..b9c2a29 100644 --- a/content/browser/renderer_host/render_view_host_impl.cc +++ b/content/browser/renderer_host/render_view_host_impl.cc @@ -616,7 +616,8 @@ void RenderViewHostImpl::DragTargetDragEnter( // which will happen at this point, so generously grant both access // and request permissions to the specific file to cover both cases. // We do not give it the permission to request all file:// URLs. - FilePath path = FilePath::FromUTF8Unsafe(UTF16ToUTF8(iter->path)); + base::FilePath path = + base::FilePath::FromUTF8Unsafe(UTF16ToUTF8(iter->path)); // Make sure we have the same display_name as the one we register. if (iter->display_name.empty()) { @@ -865,9 +866,9 @@ void RenderViewHostImpl::FilesSelectedInChooser( void RenderViewHostImpl::DirectoryEnumerationFinished( int request_id, - const std::vector<FilePath>& files) { + const std::vector<base::FilePath>& files) { // Grant the security access requested to the given files. - for (std::vector<FilePath>::const_iterator file = files.begin(); + for (std::vector<base::FilePath>::const_iterator file = files.begin(); file != files.end(); ++file) { ChildProcessSecurityPolicyImpl::GetInstance()->GrantReadFile( GetProcess()->GetID(), *file); @@ -1483,7 +1484,7 @@ void RenderViewHostImpl::OnStartDragging( for (std::vector<WebDropData::FileInfo>::const_iterator it = drop_data.filenames.begin(); it != drop_data.filenames.end(); ++it) { - FilePath path(FilePath::FromUTF8Unsafe(UTF16ToUTF8(it->path))); + base::FilePath path(base::FilePath::FromUTF8Unsafe(UTF16ToUTF8(it->path))); if (policy->CanReadFile(GetProcess()->GetID(), path)) filtered_data.filenames.push_back(*it); } diff --git a/content/browser/renderer_host/render_view_host_impl.h b/content/browser/renderer_host/render_view_host_impl.h index bdb77df..7d57852 100644 --- a/content/browser/renderer_host/render_view_host_impl.h +++ b/content/browser/renderer_host/render_view_host_impl.h @@ -137,7 +137,7 @@ class CONTENT_EXPORT RenderViewHostImpl virtual void DesktopNotificationPostClick(int notification_id) OVERRIDE; virtual void DirectoryEnumerationFinished( int request_id, - const std::vector<FilePath>& files) OVERRIDE; + const std::vector<base::FilePath>& files) OVERRIDE; virtual void DisableScrollbarsForThreshold(const gfx::Size& size) OVERRIDE; virtual void DragSourceEndedAt( int client_x, int client_y, int screen_x, int screen_y, @@ -335,8 +335,8 @@ class CONTENT_EXPORT RenderViewHostImpl // contain all saved auxiliary files included all sub frames and resouces. void GetSerializedHtmlDataForCurrentPageWithLocalLinks( const std::vector<GURL>& links, - const std::vector<FilePath>& local_paths, - const FilePath& local_directory_name); + const std::vector<base::FilePath>& local_paths, + const base::FilePath& local_directory_name); // Notifies the RenderViewHost that its load state changed. void LoadStateChanged(const GURL& url, diff --git a/content/browser/renderer_host/render_view_host_manager_browsertest.cc b/content/browser/renderer_host/render_view_host_manager_browsertest.cc index 94b33b0..a2ce269 100644 --- a/content/browser/renderer_host/render_view_host_manager_browsertest.cc +++ b/content/browser/renderer_host/render_view_host_manager_browsertest.cc @@ -112,7 +112,7 @@ IN_PROC_BROWSER_TEST_F(RenderViewHostManagerTest, NoScriptAccessAfterSwapOut) { net::TestServer https_server( net::TestServer::TYPE_HTTPS, net::TestServer::kLocalhost, - FilePath(FILE_PATH_LITERAL("content/test/data"))); + base::FilePath(FILE_PATH_LITERAL("content/test/data"))); ASSERT_TRUE(https_server.Start()); // Load a page with links that open in a new window. @@ -180,7 +180,7 @@ IN_PROC_BROWSER_TEST_F(RenderViewHostManagerTest, net::TestServer https_server( net::TestServer::TYPE_HTTPS, net::TestServer::kLocalhost, - FilePath(FILE_PATH_LITERAL("content/test/data"))); + base::FilePath(FILE_PATH_LITERAL("content/test/data"))); ASSERT_TRUE(https_server.Start()); // Load a page with links that open in a new window. @@ -233,7 +233,7 @@ IN_PROC_BROWSER_TEST_F(RenderViewHostManagerTest, net::TestServer https_server( net::TestServer::TYPE_HTTPS, net::TestServer::kLocalhost, - FilePath(FILE_PATH_LITERAL("content/test/data"))); + base::FilePath(FILE_PATH_LITERAL("content/test/data"))); ASSERT_TRUE(https_server.Start()); // Load a page with links that open in a new window. @@ -286,7 +286,7 @@ IN_PROC_BROWSER_TEST_F(RenderViewHostManagerTest, net::TestServer https_server( net::TestServer::TYPE_HTTPS, net::TestServer::kLocalhost, - FilePath(FILE_PATH_LITERAL("content/test/data"))); + base::FilePath(FILE_PATH_LITERAL("content/test/data"))); ASSERT_TRUE(https_server.Start()); // Load a page with links that open in a new window. @@ -334,7 +334,7 @@ IN_PROC_BROWSER_TEST_F(RenderViewHostManagerTest, net::TestServer https_server( net::TestServer::TYPE_HTTPS, net::TestServer::kLocalhost, - FilePath(FILE_PATH_LITERAL("content/test/data"))); + base::FilePath(FILE_PATH_LITERAL("content/test/data"))); ASSERT_TRUE(https_server.Start()); // Load a page with links that open in a new window. @@ -380,7 +380,7 @@ IN_PROC_BROWSER_TEST_F(RenderViewHostManagerTest, net::TestServer https_server( net::TestServer::TYPE_HTTPS, net::TestServer::kLocalhost, - FilePath(FILE_PATH_LITERAL("content/test/data"))); + base::FilePath(FILE_PATH_LITERAL("content/test/data"))); ASSERT_TRUE(https_server.Start()); // Load a page with links that open in a new window. @@ -463,7 +463,7 @@ IN_PROC_BROWSER_TEST_F(RenderViewHostManagerTest, DisownOpener) { net::TestServer https_server( net::TestServer::TYPE_HTTPS, net::TestServer::kLocalhost, - FilePath(FILE_PATH_LITERAL("content/test/data"))); + base::FilePath(FILE_PATH_LITERAL("content/test/data"))); ASSERT_TRUE(https_server.Start()); // Load a page with links that open in a new window. @@ -551,7 +551,7 @@ IN_PROC_BROWSER_TEST_F(RenderViewHostManagerTest, net::TestServer https_server( net::TestServer::TYPE_HTTPS, net::TestServer::kLocalhost, - FilePath(FILE_PATH_LITERAL("content/test/data"))); + base::FilePath(FILE_PATH_LITERAL("content/test/data"))); ASSERT_TRUE(https_server.Start()); // Load a page with links that open in a new window. @@ -689,7 +689,7 @@ IN_PROC_BROWSER_TEST_F(RenderViewHostManagerTest, net::TestServer https_server( net::TestServer::TYPE_HTTPS, net::TestServer::kLocalhost, - FilePath(FILE_PATH_LITERAL("content/test/data"))); + base::FilePath(FILE_PATH_LITERAL("content/test/data"))); ASSERT_TRUE(https_server.Start()); // Load a page with links that open in a new window. @@ -760,7 +760,7 @@ IN_PROC_BROWSER_TEST_F(RenderViewHostManagerTest, net::TestServer https_server( net::TestServer::TYPE_HTTPS, net::TestServer::kLocalhost, - FilePath(FILE_PATH_LITERAL("content/test/data"))); + base::FilePath(FILE_PATH_LITERAL("content/test/data"))); ASSERT_TRUE(https_server.Start()); // Load a page with links that open in a new window. @@ -827,7 +827,7 @@ IN_PROC_BROWSER_TEST_F(RenderViewHostManagerTest, ClickLinkAfter204Error) { net::TestServer https_server( net::TestServer::TYPE_HTTPS, net::TestServer::kLocalhost, - FilePath(FILE_PATH_LITERAL("content/test/data"))); + base::FilePath(FILE_PATH_LITERAL("content/test/data"))); ASSERT_TRUE(https_server.Start()); // Load a page with links that open in a new window. @@ -890,7 +890,7 @@ IN_PROC_BROWSER_TEST_F(RenderViewHostManagerTest, BackForwardNotStale) { net::TestServer https_server( net::TestServer::TYPE_HTTPS, net::TestServer::kLocalhost, - FilePath(FILE_PATH_LITERAL("content/test/data"))); + base::FilePath(FILE_PATH_LITERAL("content/test/data"))); ASSERT_TRUE(https_server.Start()); // Visit a page on first site. @@ -1005,7 +1005,7 @@ IN_PROC_BROWSER_TEST_F(RenderViewHostManagerTest, net::TestServer https_server( net::TestServer::TYPE_HTTPS, net::TestServer::kLocalhost, - FilePath(FILE_PATH_LITERAL("content/test/data"))); + base::FilePath(FILE_PATH_LITERAL("content/test/data"))); ASSERT_TRUE(https_server.Start()); // Load a page with links that open in a new window. @@ -1131,7 +1131,7 @@ IN_PROC_BROWSER_TEST_F(RenderViewHostManagerTest, LeakingRenderViewHosts) { net::TestServer https_server( net::TestServer::TYPE_HTTPS, net::TestServer::kLocalhost, - FilePath(FILE_PATH_LITERAL("content/test/data"))); + base::FilePath(FILE_PATH_LITERAL("content/test/data"))); ASSERT_TRUE(https_server.Start()); // Observe the created render_view_host's to make sure they will not leak. @@ -1202,7 +1202,7 @@ IN_PROC_BROWSER_TEST_F(RenderViewHostManagerTest, DISABLED_FrameTreeUpdates) { net::TestServer https_server( net::TestServer::TYPE_HTTPS, net::TestServer::kLocalhost, - FilePath(FILE_PATH_LITERAL("content/test/data"))); + base::FilePath(FILE_PATH_LITERAL("content/test/data"))); EXPECT_TRUE(https_server.Start()); GURL frame_tree_url(test_server()->GetURL("files/frame_tree/top.html")); @@ -1371,7 +1371,7 @@ IN_PROC_BROWSER_TEST_F(RenderViewHostManagerTest, net::TestServer https_server( net::TestServer::TYPE_HTTPS, net::TestServer::kLocalhost, - FilePath(FILE_PATH_LITERAL("content/test/data"))); + base::FilePath(FILE_PATH_LITERAL("content/test/data"))); ASSERT_TRUE(https_server.Start()); // 1. Load a page that deletes its iframe during unload. diff --git a/content/browser/renderer_host/render_view_host_unittest.cc b/content/browser/renderer_host/render_view_host_unittest.cc index 1feaa74..6e94708 100644 --- a/content/browser/renderer_host/render_view_host_unittest.cc +++ b/content/browser/renderer_host/render_view_host_unittest.cc @@ -159,9 +159,9 @@ TEST_F(RenderViewHostTest, DragEnteredFileURLsStillBlocked) { gfx::Point screen_point; // We use "//foo/bar" path (rather than "/foo/bar") since dragged paths are // expected to be absolute on any platforms. - FilePath highlighted_file_path(FILE_PATH_LITERAL("//tmp/foo.html")); - FilePath dragged_file_path(FILE_PATH_LITERAL("//tmp/image.jpg")); - FilePath sensitive_file_path(FILE_PATH_LITERAL("//etc/passwd")); + base::FilePath highlighted_file_path(FILE_PATH_LITERAL("//tmp/foo.html")); + base::FilePath dragged_file_path(FILE_PATH_LITERAL("//tmp/image.jpg")); + base::FilePath sensitive_file_path(FILE_PATH_LITERAL("//etc/passwd")); GURL highlighted_file_url = net::FilePathToFileURL(highlighted_file_path); GURL dragged_file_url = net::FilePathToFileURL(dragged_file_path); GURL sensitive_file_url = net::FilePathToFileURL(sensitive_file_path); diff --git a/content/browser/renderer_host/render_widget_host_view_browsertest.cc b/content/browser/renderer_host/render_widget_host_view_browsertest.cc index 7b360ac..7efbe7e 100644 --- a/content/browser/renderer_host/render_widget_host_view_browsertest.cc +++ b/content/browser/renderer_host/render_widget_host_view_browsertest.cc @@ -70,7 +70,7 @@ class RenderWidgetHostViewBrowserTest : public ContentBrowserTest { } protected: - FilePath test_dir_; + base::FilePath test_dir_; bool finish_called_; gfx::Size size_; }; diff --git a/content/browser/safe_util_win.cc b/content/browser/safe_util_win.cc index f17c346..f0d8dc5 100644 --- a/content/browser/safe_util_win.cc +++ b/content/browser/safe_util_win.cc @@ -31,7 +31,7 @@ static const GUID kClientID = { 0x2676a9a2, 0xd919, 0x4fee, // This function does not invoke Windows Attachment Execution Services. // // |full_path| is the path to the downloaded file. -bool SetInternetZoneIdentifierDirectly(const FilePath& full_path) { +bool SetInternetZoneIdentifierDirectly(const base::FilePath& full_path) { const DWORD kShare = FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE; std::wstring path = full_path.value() + L":Zone.Identifier"; HANDLE file = CreateFile(path.c_str(), GENERIC_WRITE, kShare, NULL, @@ -63,7 +63,7 @@ bool SetInternetZoneIdentifierDirectly(const FilePath& full_path) { // more information at: // http://msdn2.microsoft.com/en-us/library/ms647048.aspx bool SaferOpenItemViaShell(HWND hwnd, const std::wstring& window_title, - const FilePath& full_path, + const base::FilePath& full_path, const std::wstring& source_url) { base::win::ScopedComPtr<IAttachmentExecute> attachment_services; HRESULT hr = attachment_services.CreateInstance(CLSID_AttachmentServices); @@ -119,7 +119,7 @@ bool SaferOpenItemViaShell(HWND hwnd, const std::wstring& window_title, return ui::win::OpenItemViaShellNoZoneCheck(full_path); } -HRESULT ScanAndSaveDownloadedFile(const FilePath& full_path, +HRESULT ScanAndSaveDownloadedFile(const base::FilePath& full_path, const GURL& source_url) { base::win::ScopedComPtr<IAttachmentExecute> attachment_services; HRESULT hr = attachment_services.CreateInstance(CLSID_AttachmentServices); diff --git a/content/browser/site_per_process_browsertest.cc b/content/browser/site_per_process_browsertest.cc index 65fa770e..99ce0c94 100644 --- a/content/browser/site_per_process_browsertest.cc +++ b/content/browser/site_per_process_browsertest.cc @@ -169,7 +169,7 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, DISABLED_CrossSiteIframe) { net::TestServer https_server( net::TestServer::TYPE_HTTPS, net::TestServer::kLocalhost, - FilePath(FILE_PATH_LITERAL("content/test/data"))); + base::FilePath(FILE_PATH_LITERAL("content/test/data"))); ASSERT_TRUE(https_server.Start()); GURL main_url(test_server()->GetURL("files/site_per_process_main.html")); @@ -201,7 +201,7 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, net::TestServer https_server( net::TestServer::TYPE_HTTPS, net::TestServer::kLocalhost, - FilePath(FILE_PATH_LITERAL("content/test/data"))); + base::FilePath(FILE_PATH_LITERAL("content/test/data"))); ASSERT_TRUE(https_server.Start()); GURL main_url(test_server()->GetURL("files/site_per_process_main.html")); @@ -325,7 +325,7 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, net::TestServer https_server( net::TestServer::TYPE_HTTPS, net::TestServer::kLocalhost, - FilePath(FILE_PATH_LITERAL("content/test/data"))); + base::FilePath(FILE_PATH_LITERAL("content/test/data"))); ASSERT_TRUE(https_server.Start()); GURL main_url(test_server()->GetURL("files/site_per_process_main.html")); diff --git a/content/browser/storage_partition_impl.cc b/content/browser/storage_partition_impl.cc index acf7ecd..d4ab773 100644 --- a/content/browser/storage_partition_impl.cc +++ b/content/browser/storage_partition_impl.cc @@ -111,7 +111,7 @@ void OnSessionStorageUsageInfo( } // namespace StoragePartitionImpl::StoragePartitionImpl( - const FilePath& partition_path, + const base::FilePath& partition_path, quota::QuotaManager* quota_manager, ChromeAppCacheService* appcache_service, fileapi::FileSystemContext* filesystem_context, @@ -146,7 +146,7 @@ StoragePartitionImpl::~StoragePartitionImpl() { StoragePartitionImpl* StoragePartitionImpl::Create( BrowserContext* context, bool in_memory, - const FilePath& partition_path) { + const base::FilePath& partition_path) { // Ensure that these methods are called on the UI thread, except for // unittests where a UI thread might not have been created. DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI) || @@ -177,7 +177,7 @@ StoragePartitionImpl* StoragePartitionImpl::Create( context->GetSpecialStoragePolicy(), quota_manager->proxy(), BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE)); - FilePath path = in_memory ? FilePath() : partition_path; + base::FilePath path = in_memory ? base::FilePath() : partition_path; scoped_refptr<DOMStorageContextImpl> dom_storage_context = new DOMStorageContextImpl(path, context->GetSpecialStoragePolicy()); @@ -199,7 +199,7 @@ StoragePartitionImpl* StoragePartitionImpl::Create( indexed_db_context); } -FilePath StoragePartitionImpl::GetPath() { +base::FilePath StoragePartitionImpl::GetPath() { return partition_path_; } diff --git a/content/browser/storage_partition_impl.h b/content/browser/storage_partition_impl.h index 46daacd..6de28ed 100644 --- a/content/browser/storage_partition_impl.h +++ b/content/browser/storage_partition_impl.h @@ -20,7 +20,7 @@ class StoragePartitionImpl : public StoragePartition { virtual ~StoragePartitionImpl(); // StoragePartition interface. - virtual FilePath GetPath() OVERRIDE; + virtual base::FilePath GetPath() OVERRIDE; virtual net::URLRequestContextGetter* GetURLRequestContext() OVERRIDE; virtual net::URLRequestContextGetter* GetMediaURLRequestContext() OVERRIDE; virtual quota::QuotaManager* GetQuotaManager() OVERRIDE; @@ -45,10 +45,10 @@ class StoragePartitionImpl : public StoragePartition { // on to disk. static StoragePartitionImpl* Create(BrowserContext* context, bool in_memory, - const FilePath& profile_path); + const base::FilePath& profile_path); StoragePartitionImpl( - const FilePath& partition_path, + const base::FilePath& partition_path, quota::QuotaManager* quota_manager, ChromeAppCacheService* appcache_service, fileapi::FileSystemContext* filesystem_context, @@ -72,7 +72,7 @@ class StoragePartitionImpl : public StoragePartition { void SetMediaURLRequestContext( net::URLRequestContextGetter* media_url_request_context); - FilePath partition_path_; + base::FilePath partition_path_; scoped_refptr<net::URLRequestContextGetter> url_request_context_; scoped_refptr<net::URLRequestContextGetter> media_url_request_context_; scoped_refptr<quota::QuotaManager> quota_manager_; diff --git a/content/browser/storage_partition_impl_map.cc b/content/browser/storage_partition_impl_map.cc index a9c9cd2..79c6a77 100644 --- a/content/browser/storage_partition_impl_map.cc +++ b/content/browser/storage_partition_impl_map.cc @@ -222,13 +222,13 @@ void InitializeURLRequestContext( // The code in GetStoragePartitionPath() constructs these path names. // // TODO(nasko): Move extension related path code out of content. -const FilePath::CharType kStoragePartitionDirname[] = +const base::FilePath::CharType kStoragePartitionDirname[] = FILE_PATH_LITERAL("Storage"); -const FilePath::CharType kExtensionsDirname[] = +const base::FilePath::CharType kExtensionsDirname[] = FILE_PATH_LITERAL("ext"); -const FilePath::CharType kDefaultPartitionDirname[] = +const base::FilePath::CharType kDefaultPartitionDirname[] = FILE_PATH_LITERAL("def"); -const FilePath::CharType kTrashDirname[] = +const base::FilePath::CharType kTrashDirname[] = FILE_PATH_LITERAL("trash"); // Because partition names are user specified, they can be arbitrarily long @@ -271,12 +271,12 @@ const int kAllFileTypes = file_util::FileEnumerator::FILES | file_util::FileEnumerator::DIRECTORIES; #endif -FilePath GetStoragePartitionDomainPath( +base::FilePath GetStoragePartitionDomainPath( const std::string& partition_domain) { CHECK(IsStringUTF8(partition_domain)); - return FilePath(kStoragePartitionDirname).Append(kExtensionsDirname) - .Append(FilePath::FromUTF8Unsafe(partition_domain)); + return base::FilePath(kStoragePartitionDirname).Append(kExtensionsDirname) + .Append(base::FilePath::FromUTF8Unsafe(partition_domain)); } // Helper function for doing a depth-first deletion of the data on disk. @@ -284,18 +284,19 @@ FilePath GetStoragePartitionDomainPath( // delete from disk anything that is in, or isn't a parent of something in // |paths_to_keep|. Paths that need further expansion are added to // |paths_to_consider|. -void ObliterateOneDirectory(const FilePath& current_dir, - const std::vector<FilePath>& paths_to_keep, - std::vector<FilePath>* paths_to_consider) { +void ObliterateOneDirectory(const base::FilePath& current_dir, + const std::vector<base::FilePath>& paths_to_keep, + std::vector<base::FilePath>* paths_to_consider) { CHECK(current_dir.IsAbsolute()); file_util::FileEnumerator enumerator(current_dir, false, kAllFileTypes); - for (FilePath to_delete = enumerator.Next(); !to_delete.empty(); + for (base::FilePath to_delete = enumerator.Next(); !to_delete.empty(); to_delete = enumerator.Next()) { // Enum tracking which of the 3 possible actions to take for |to_delete|. enum { kSkip, kEnqueue, kDelete } action = kDelete; - for (std::vector<FilePath>::const_iterator to_keep = paths_to_keep.begin(); + for (std::vector<base::FilePath>::const_iterator to_keep = + paths_to_keep.begin(); to_keep != paths_to_keep.end(); ++to_keep) { if (to_delete == *to_keep) { @@ -329,9 +330,9 @@ void ObliterateOneDirectory(const FilePath& current_dir, // disk, then it completely removes |unnormalized_root|. All paths must be // absolute paths. void BlockingObliteratePath( - const FilePath& unnormalized_browser_context_root, - const FilePath& unnormalized_root, - const std::vector<FilePath>& paths_to_keep, + const base::FilePath& unnormalized_browser_context_root, + const base::FilePath& unnormalized_root, + const std::vector<base::FilePath>& paths_to_keep, const scoped_refptr<base::TaskRunner>& closure_runner, const base::Closure& on_gc_required) { // Early exit required because file_util::AbsolutePath() will fail on POSIX @@ -343,16 +344,16 @@ void BlockingObliteratePath( // Never try to obliterate things outside of the browser context root or the // browser context root itself. Die hard. - FilePath root = unnormalized_root; - FilePath browser_context_root = unnormalized_browser_context_root; + base::FilePath root = unnormalized_root; + base::FilePath browser_context_root = unnormalized_browser_context_root; CHECK(file_util::AbsolutePath(&root)); CHECK(file_util::AbsolutePath(&browser_context_root)); CHECK(file_util::ContainsPath(browser_context_root, root) && browser_context_root != root); // Reduce |paths_to_keep| set to those under the root and actually on disk. - std::vector<FilePath> valid_paths_to_keep; - for (std::vector<FilePath>::const_iterator it = paths_to_keep.begin(); + std::vector<base::FilePath> valid_paths_to_keep; + for (std::vector<base::FilePath>::const_iterator it = paths_to_keep.begin(); it != paths_to_keep.end(); ++it) { if (root.IsParent(*it) && file_util::PathExists(*it)) @@ -370,10 +371,10 @@ void BlockingObliteratePath( // Otherwise, start at the root and delete everything that is not in // |valid_paths_to_keep|. - std::vector<FilePath> paths_to_consider; + std::vector<base::FilePath> paths_to_consider; paths_to_consider.push_back(root); while(!paths_to_consider.empty()) { - FilePath path = paths_to_consider.back(); + base::FilePath path = paths_to_consider.back(); paths_to_consider.pop_back(); ObliterateOneDirectory(path, valid_paths_to_keep, &paths_to_consider); } @@ -397,19 +398,19 @@ void BlockingObliteratePath( // This function is still named BlockingGarbageCollect() because it does // execute a few filesystem operations synchronously. void BlockingGarbageCollect( - const FilePath& storage_root, + const base::FilePath& storage_root, const scoped_refptr<base::TaskRunner>& file_access_runner, - scoped_ptr<base::hash_set<FilePath> > active_paths) { + scoped_ptr<base::hash_set<base::FilePath> > active_paths) { CHECK(storage_root.IsAbsolute()); file_util::FileEnumerator enumerator(storage_root, false, kAllFileTypes); - FilePath trash_directory; + base::FilePath trash_directory; if (!file_util::CreateTemporaryDirInDir(storage_root, kTrashDirname, &trash_directory)) { // Unable to continue without creating the trash directory so give up. return; } - for (FilePath path = enumerator.Next(); !path.empty(); + for (base::FilePath path = enumerator.Next(); !path.empty(); path = enumerator.Next()) { if (active_paths->find(path) == active_paths->end() && path != trash_directory) { @@ -428,13 +429,13 @@ void BlockingGarbageCollect( } // namespace // static -FilePath StoragePartitionImplMap::GetStoragePartitionPath( +base::FilePath StoragePartitionImplMap::GetStoragePartitionPath( const std::string& partition_domain, const std::string& partition_name) { if (partition_domain.empty()) - return FilePath(); + return base::FilePath(); - FilePath path = GetStoragePartitionDomainPath(partition_domain); + base::FilePath path = GetStoragePartitionDomainPath(partition_domain); // TODO(ajwong): Mangle in-memory into this somehow, either by putting // it into the partition_name, or by manually adding another path component @@ -479,7 +480,7 @@ StoragePartitionImpl* StoragePartitionImplMap::Get( if (it != partitions_.end()) return it->second; - FilePath partition_path = + base::FilePath partition_path = browser_context_->GetPath().Append( GetStoragePartitionPath(partition_domain, partition_name)); StoragePartitionImpl* partition = @@ -524,7 +525,7 @@ void StoragePartitionImplMap::AsyncObliterate( // remove any data they have saved. This will leave the directory structure // intact but it will only contain empty databases. std::vector<StoragePartitionImpl*> active_partitions; - std::vector<FilePath> paths_to_keep; + std::vector<base::FilePath> paths_to_keep; for (PartitionMap::const_iterator it = partitions_.begin(); it != partitions_.end(); ++it) { @@ -541,7 +542,7 @@ void StoragePartitionImplMap::AsyncObliterate( // known to still be in use. This is to delete any previously created // StoragePartition state that just happens to not have been used during this // run of the browser. - FilePath domain_root = browser_context_->GetPath().Append( + base::FilePath domain_root = browser_context_->GetPath().Append( GetStoragePartitionDomainPath(partition_domain)); BrowserThread::PostBlockingPoolTask( @@ -552,7 +553,7 @@ void StoragePartitionImplMap::AsyncObliterate( } void StoragePartitionImplMap::GarbageCollect( - scoped_ptr<base::hash_set<FilePath> > active_paths, + scoped_ptr<base::hash_set<base::FilePath> > active_paths, const base::Closure& done) { // Include all paths for current StoragePartitions in the active_paths since // they cannot be deleted safely. @@ -566,7 +567,7 @@ void StoragePartitionImplMap::GarbageCollect( // Find the directory holding the StoragePartitions and delete everything in // there that isn't considered active. - FilePath storage_root = browser_context_->GetPath().Append( + base::FilePath storage_root = browser_context_->GetPath().Append( GetStoragePartitionDomainPath(std::string())); file_access_runner_->PostTaskAndReply( FROM_HERE, @@ -604,7 +605,7 @@ void StoragePartitionImplMap::PostCreateInitialization( BrowserThread::IO, FROM_HERE, base::Bind(&ChromeAppCacheService::InitializeOnIOThread, partition->GetAppCacheService(), - in_memory ? FilePath() : + in_memory ? base::FilePath() : partition->GetPath().Append(kAppCacheDirname), browser_context_->GetResourceContext(), make_scoped_refptr(partition->GetURLRequestContext()), diff --git a/content/browser/tracing/trace_controller_impl.cc b/content/browser/tracing/trace_controller_impl.cc index 40a3f56..4c61591 100644 --- a/content/browser/tracing/trace_controller_impl.cc +++ b/content/browser/tracing/trace_controller_impl.cc @@ -25,7 +25,7 @@ base::LazyInstance<TraceControllerImpl>::Leaky g_controller = class AutoStopTraceSubscriberStdio : public TraceSubscriberStdio { public: - AutoStopTraceSubscriberStdio(const FilePath& file_path) + AutoStopTraceSubscriberStdio(const base::FilePath& file_path) : TraceSubscriberStdio(file_path) {} static void EndStartupTrace(TraceSubscriberStdio* subscriber) { @@ -72,17 +72,17 @@ TraceControllerImpl* TraceControllerImpl::GetInstance() { void TraceControllerImpl::InitStartupTracing(const CommandLine& command_line) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - FilePath trace_file = command_line.GetSwitchValuePath( + base::FilePath trace_file = command_line.GetSwitchValuePath( switches::kTraceStartupFile); // trace_file = "none" means that startup events will show up for the next // begin/end tracing (via about:tracing or AutomationProxy::BeginTracing/ // EndTracing, for example). - if (trace_file == FilePath().AppendASCII("none")) + if (trace_file == base::FilePath().AppendASCII("none")) return; if (trace_file.empty()) { // Default to saving the startup trace into the current dir. - trace_file = FilePath().AppendASCII("chrometrace.log"); + trace_file = base::FilePath().AppendASCII("chrometrace.log"); } scoped_ptr<AutoStopTraceSubscriberStdio> subscriber( new AutoStopTraceSubscriberStdio(trace_file)); diff --git a/content/browser/tracing/trace_subscriber_stdio.cc b/content/browser/tracing/trace_subscriber_stdio.cc index d366f1b..ea3a724 100644 --- a/content/browser/tracing/trace_subscriber_stdio.cc +++ b/content/browser/tracing/trace_subscriber_stdio.cc @@ -16,7 +16,7 @@ namespace content { class TraceSubscriberStdioImpl : public base::RefCountedThreadSafe<TraceSubscriberStdioImpl> { public: - explicit TraceSubscriberStdioImpl(const FilePath& path) + explicit TraceSubscriberStdioImpl(const base::FilePath& path) : path_(path), file_(0) {} @@ -73,12 +73,12 @@ class TraceSubscriberStdioImpl } } - FilePath path_; + base::FilePath path_; FILE* file_; base::debug::TraceResultBuffer trace_buffer_; }; -TraceSubscriberStdio::TraceSubscriberStdio(const FilePath& path) +TraceSubscriberStdio::TraceSubscriberStdio(const base::FilePath& path) : impl_(new TraceSubscriberStdioImpl(path)) { BrowserThread::PostBlockingPoolSequencedTask( __FILE__, FROM_HERE, diff --git a/content/browser/tracing/trace_subscriber_stdio.h b/content/browser/tracing/trace_subscriber_stdio.h index 7fa37e5..9851618 100644 --- a/content/browser/tracing/trace_subscriber_stdio.h +++ b/content/browser/tracing/trace_subscriber_stdio.h @@ -21,7 +21,7 @@ class CONTENT_EXPORT TraceSubscriberStdio : NON_EXPORTED_BASE(public TraceSubscriber) { public: // Creates or overwrites the specified file. Check IsValid() for success. - explicit TraceSubscriberStdio(const FilePath& path); + explicit TraceSubscriberStdio(const base::FilePath& path); virtual ~TraceSubscriberStdio(); // Implementation of TraceSubscriber diff --git a/content/browser/tracing/trace_subscriber_stdio_unittest.cc b/content/browser/tracing/trace_subscriber_stdio_unittest.cc index 73ca474..90d313f 100644 --- a/content/browser/tracing/trace_subscriber_stdio_unittest.cc +++ b/content/browser/tracing/trace_subscriber_stdio_unittest.cc @@ -16,7 +16,7 @@ class TraceSubscriberStdioTest : public ::testing::Test {}; TEST_F(TraceSubscriberStdioTest, CanWriteDataToFile) { base::ScopedTempDir trace_dir; ASSERT_TRUE(trace_dir.CreateUniqueTempDir()); - FilePath trace_file(trace_dir.path().AppendASCII("trace.txt")); + base::FilePath trace_file(trace_dir.path().AppendASCII("trace.txt")); { TraceSubscriberStdio subscriber(trace_file); diff --git a/content/browser/tracing/tracing_ui.cc b/content/browser/tracing/tracing_ui.cc index b82da36..e9d08d6 100644 --- a/content/browser/tracing/tracing_ui.cc +++ b/content/browser/tracing/tracing_ui.cc @@ -65,7 +65,9 @@ class TracingMessageHandler virtual void RegisterMessages(); // SelectFileDialog::Listener implementation - virtual void FileSelected(const FilePath& path, int index, void* params); + virtual void FileSelected(const base::FilePath& path, + int index, + void* params); virtual void FileSelectionCanceled(void* params); // TraceSubscriber implementation. @@ -212,7 +214,7 @@ void TracingMessageHandler::OnBeginRequestBufferPercentFull( // A callback used for asynchronously reading a file to a string. Calls the // TaskProxy callback when reading is complete. -void ReadTraceFileCallback(TaskProxy* proxy, const FilePath& path) { +void ReadTraceFileCallback(TaskProxy* proxy, const base::FilePath& path) { std::string file_contents; if (!file_util::ReadFileToString(path, &file_contents)) return; @@ -255,7 +257,7 @@ void ReadTraceFileCallback(TaskProxy* proxy, const FilePath& path) { // A callback used for asynchronously writing a file from a string. Calls the // TaskProxy callback when writing is complete. void WriteTraceFileCallback(TaskProxy* proxy, - const FilePath& path, + const base::FilePath& path, std::string* contents) { if (!file_util::WriteFile(path, contents->c_str(), contents->size())) return; @@ -266,7 +268,7 @@ void WriteTraceFileCallback(TaskProxy* proxy, } void TracingMessageHandler::FileSelected( - const FilePath& path, int index, void* params) { + const base::FilePath& path, int index, void* params) { if (select_trace_file_dialog_type_ == ui::SelectFileDialog::SELECT_OPEN_FILE) { BrowserThread::PostTask( @@ -308,7 +310,7 @@ void TracingMessageHandler::OnLoadTraceFile(const ListValue* list) { select_trace_file_dialog_->SelectFile( ui::SelectFileDialog::SELECT_OPEN_FILE, string16(), - FilePath(), + base::FilePath(), NULL, 0, FILE_PATH_LITERAL(""), web_ui()->GetWebContents()->GetView()->GetTopLevelNativeWindow(), NULL); } @@ -358,7 +360,7 @@ void TracingMessageHandler::OnSaveTraceFile(const ListValue* list) { select_trace_file_dialog_->SelectFile( ui::SelectFileDialog::SELECT_SAVEAS_FILE, string16(), - FilePath(), + base::FilePath(), NULL, 0, FILE_PATH_LITERAL(""), web_ui()->GetWebContents()->GetView()->GetTopLevelNativeWindow(), NULL); } diff --git a/content/browser/utility_process_host_impl.cc b/content/browser/utility_process_host_impl.cc index 2a0b43c..d286427 100644 --- a/content/browser/utility_process_host_impl.cc +++ b/content/browser/utility_process_host_impl.cc @@ -70,7 +70,7 @@ void UtilityProcessHostImpl::EndBatchMode() { Send(new UtilityMsg_BatchMode_Finished()); } -void UtilityProcessHostImpl::SetExposedDir(const FilePath& dir) { +void UtilityProcessHostImpl::SetExposedDir(const base::FilePath& dir) { exposed_dir_ = dir; } @@ -125,7 +125,7 @@ bool UtilityProcessHostImpl::StartProcess() { child_flags = ChildProcessHost::CHILD_NORMAL; #endif - FilePath exe_path = ChildProcessHost::GetChildPath(child_flags); + base::FilePath exe_path = ChildProcessHost::GetChildPath(child_flags); if (exe_path.empty()) { NOTREACHED() << "Unable to get utility process binary name."; return false; diff --git a/content/browser/utility_process_host_impl.h b/content/browser/utility_process_host_impl.h index 4922e9c..4c85258 100644 --- a/content/browser/utility_process_host_impl.h +++ b/content/browser/utility_process_host_impl.h @@ -35,7 +35,7 @@ class CONTENT_EXPORT UtilityProcessHostImpl virtual bool Send(IPC::Message* message) OVERRIDE; virtual bool StartBatchMode() OVERRIDE; virtual void EndBatchMode() OVERRIDE; - virtual void SetExposedDir(const FilePath& dir) OVERRIDE; + virtual void SetExposedDir(const base::FilePath& dir) OVERRIDE; virtual void DisableSandbox() OVERRIDE; virtual void EnableZygote() OVERRIDE; virtual const ChildProcessData& GetData() OVERRIDE; @@ -61,7 +61,7 @@ class CONTENT_EXPORT UtilityProcessHostImpl // and the utility process will run until EndBatchMode(). bool is_batch_mode_; - FilePath exposed_dir_; + base::FilePath exposed_dir_; // Whether to pass switches::kNoSandbox to the child. bool no_sandbox_; diff --git a/content/browser/web_contents/navigation_controller_impl_unittest.cc b/content/browser/web_contents/navigation_controller_impl_unittest.cc index 22a43ec..021d2b9 100644 --- a/content/browser/web_contents/navigation_controller_impl_unittest.cc +++ b/content/browser/web_contents/navigation_controller_impl_unittest.cc @@ -3208,7 +3208,7 @@ class NavigationControllerHistoryTest : public NavigationControllerTest { private: ProfileManager* profile_manager_; - FilePath test_dir_; + base::FilePath test_dir_; }; // A basic test case. Navigates to a single url, and make sure the history diff --git a/content/browser/web_contents/web_contents_drag_win.cc b/content/browser/web_contents/web_contents_drag_win.cc index adc4cec..32dcb69 100644 --- a/content/browser/web_contents/web_contents_drag_win.cc +++ b/content/browser/web_contents/web_contents_drag_win.cc @@ -225,7 +225,7 @@ void WebContentsDragWin::PrepareDragForDownload( const std::string& page_encoding) { // Parse the download metadata. string16 mime_type; - FilePath file_name; + base::FilePath file_name; GURL download_url; if (!ParseDownloadMetadata(drop_data.download_metadata, &mime_type, @@ -236,18 +236,19 @@ void WebContentsDragWin::PrepareDragForDownload( // Generate the file name based on both mime type and proposed file name. std::string default_name = GetContentClient()->browser()->GetDefaultDownloadName(); - FilePath generated_download_file_name = + base::FilePath generated_download_file_name = net::GenerateFileName(download_url, std::string(), std::string(), UTF16ToUTF8(file_name.value()), UTF16ToUTF8(mime_type), default_name); - FilePath temp_dir_path; + base::FilePath temp_dir_path; if (!file_util::CreateNewTempDirectory( FILE_PATH_LITERAL("chrome_drag"), &temp_dir_path)) return; - FilePath download_path = temp_dir_path.Append(generated_download_file_name); + base::FilePath download_path = + temp_dir_path.Append(generated_download_file_name); // We cannot know when the target application will be done using the temporary // file, so schedule it to be deleted after rebooting. @@ -264,7 +265,7 @@ void WebContentsDragWin::PrepareDragForDownload( Referrer(page_url, drop_data.referrer_policy), page_encoding, web_contents_); - ui::OSExchangeData::DownloadFileInfo file_download(FilePath(), + ui::OSExchangeData::DownloadFileInfo file_download(base::FilePath(), download_file.get()); data->SetDownloadFileInfo(file_download); @@ -275,17 +276,17 @@ void WebContentsDragWin::PrepareDragForDownload( void WebContentsDragWin::PrepareDragForFileContents( const WebDropData& drop_data, ui::OSExchangeData* data) { static const int kMaxFilenameLength = 255; // FAT and NTFS - FilePath file_name(drop_data.file_description_filename); + base::FilePath file_name(drop_data.file_description_filename); // Images without ALT text will only have a file extension so we need to // synthesize one from the provided extension and URL. if (file_name.BaseName().RemoveExtension().empty()) { const string16 extension = file_name.Extension(); // Retrieve the name from the URL. - file_name = FilePath( + file_name = base::FilePath( net::GetSuggestedFilename(drop_data.url, "", "", "", "", "")); if (file_name.value().size() + extension.size() > kMaxFilenameLength) { - file_name = FilePath(file_name.value().substr( + file_name = base::FilePath(file_name.value().substr( 0, kMaxFilenameLength - extension.size())); } file_name = file_name.ReplaceExtension(extension); diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc index f585948..51ecab4 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc @@ -1790,8 +1790,8 @@ void WebContentsImpl::OnSavePage() { // Used in automated testing to bypass prompting the user for file names. // Instead, the names and paths are hard coded rather than running them through // file name sanitation and extension / mime checking. -bool WebContentsImpl::SavePage(const FilePath& main_file, - const FilePath& dir_path, +bool WebContentsImpl::SavePage(const base::FilePath& main_file, + const base::FilePath& dir_path, SavePageType save_type) { // Stop the page from navigating. Stop(); @@ -1801,8 +1801,8 @@ bool WebContentsImpl::SavePage(const FilePath& main_file, } void WebContentsImpl::GenerateMHTML( - const FilePath& file, - const base::Callback<void(const FilePath&, int64)>& callback) { + const base::FilePath& file, + const base::Callback<void(const base::FilePath&, int64)>& callback) { MHTMLGenerationManager::GetInstance()->GenerateMHTML(this, file, callback); } @@ -2306,7 +2306,7 @@ void WebContentsImpl::OnSaveURL(const GURL& url, } void WebContentsImpl::OnEnumerateDirectory(int request_id, - const FilePath& path) { + const base::FilePath& path) { if (!delegate_) return; @@ -2362,7 +2362,7 @@ void WebContentsImpl::OnOpenDateTimeDialog(int type, const std::string& value) { #endif -void WebContentsImpl::OnCrashedPlugin(const FilePath& plugin_path, +void WebContentsImpl::OnCrashedPlugin(const base::FilePath& plugin_path, base::ProcessId plugin_pid) { FOR_EACH_OBSERVER(WebContentsObserver, observers_, PluginCrashed(plugin_path, plugin_pid)); @@ -2395,7 +2395,7 @@ void WebContentsImpl::OnSetSelectedColorInColorChooser(int color_chooser_id, } void WebContentsImpl::OnPepperPluginHung(int plugin_child_id, - const FilePath& path, + const base::FilePath& path, bool is_hung) { UMA_HISTOGRAM_COUNTS("Pepper.PluginHung", 1); @@ -2415,7 +2415,7 @@ void WebContentsImpl::OnWebUISend(const GURL& source_url, void WebContentsImpl::OnRequestPpapiBrokerPermission( int request_id, const GURL& url, - const FilePath& plugin_path) { + const base::FilePath& plugin_path) { if (!delegate_) { OnPpapiBrokerPermissionResult(request_id, false); return; diff --git a/content/browser/web_contents/web_contents_impl.h b/content/browser/web_contents/web_contents_impl.h index 6dab5b7..6568854 100644 --- a/content/browser/web_contents/web_contents_impl.h +++ b/content/browser/web_contents/web_contents_impl.h @@ -241,12 +241,13 @@ class CONTENT_EXPORT WebContentsImpl virtual InterstitialPage* GetInterstitialPage() const OVERRIDE; virtual bool IsSavable() OVERRIDE; virtual void OnSavePage() OVERRIDE; - virtual bool SavePage(const FilePath& main_file, - const FilePath& dir_path, + virtual bool SavePage(const base::FilePath& main_file, + const base::FilePath& dir_path, SavePageType save_type) OVERRIDE; virtual void GenerateMHTML( - const FilePath& file, - const base::Callback<void(const FilePath&, int64)>& callback) OVERRIDE; + const base::FilePath& file, + const base::Callback<void(const base::FilePath&, int64)>& callback) + OVERRIDE; virtual bool IsActiveEntry(int32 page_id) OVERRIDE; virtual const std::string& GetContentsMimeType() const OVERRIDE; @@ -544,7 +545,7 @@ class CONTENT_EXPORT WebContentsImpl int maximum_percent, bool remember); void OnSaveURL(const GURL& url, const Referrer& referrer); - void OnEnumerateDirectory(int request_id, const FilePath& path); + void OnEnumerateDirectory(int request_id, const base::FilePath& path); void OnJSOutOfMemory(); void OnRegisterProtocolHandler(const std::string& protocol, @@ -563,20 +564,21 @@ class CONTENT_EXPORT WebContentsImpl void OnOpenDateTimeDialog(int type, const std::string& value); #endif - void OnCrashedPlugin(const FilePath& plugin_path, base::ProcessId plugin_pid); + void OnCrashedPlugin(const base::FilePath& plugin_path, + base::ProcessId plugin_pid); void OnAppCacheAccessed(const GURL& manifest_url, bool blocked_by_policy); void OnOpenColorChooser(int color_chooser_id, SkColor color); void OnEndColorChooser(int color_chooser_id); void OnSetSelectedColorInColorChooser(int color_chooser_id, SkColor color); void OnPepperPluginHung(int plugin_child_id, - const FilePath& path, + const base::FilePath& path, bool is_hung); void OnWebUISend(const GURL& source_url, const std::string& name, const base::ListValue& args); void OnRequestPpapiBrokerPermission(int request_id, const GURL& url, - const FilePath& plugin_path); + const base::FilePath& plugin_path); void OnBrowserPluginAllocateInstanceID(const IPC::Message& message, int request_id); void OnDidDownloadFavicon(int id, diff --git a/content/browser/web_contents/web_contents_view_aura.cc b/content/browser/web_contents/web_contents_view_aura.cc index 9250d7c..45a4d9d 100644 --- a/content/browser/web_contents/web_contents_view_aura.cc +++ b/content/browser/web_contents/web_contents_view_aura.cc @@ -274,8 +274,8 @@ void PrepareDragData(const WebDropData& drop_data, it != drop_data.filenames.end(); ++it) { filenames.push_back( ui::OSExchangeData::FileInfo( - FilePath::FromUTF8Unsafe(UTF16ToUTF8(it->path)), - FilePath::FromUTF8Unsafe(UTF16ToUTF8(it->display_name)))); + base::FilePath::FromUTF8Unsafe(UTF16ToUTF8(it->path)), + base::FilePath::FromUTF8Unsafe(UTF16ToUTF8(it->display_name)))); } provider->SetFilenames(filenames); } diff --git a/content/browser/web_contents/web_contents_view_aura_browsertest.cc b/content/browser/web_contents/web_contents_view_aura_browsertest.cc index 81c8dfa..0686ca3 100644 --- a/content/browser/web_contents/web_contents_view_aura_browsertest.cc +++ b/content/browser/web_contents/web_contents_view_aura_browsertest.cc @@ -400,7 +400,7 @@ IN_PROC_BROWSER_TEST_F(WebContentsViewAuraTest, net::TestServer https_server( net::TestServer::TYPE_HTTPS, net::TestServer::kLocalhost, - FilePath(FILE_PATH_LITERAL("content/test/data"))); + base::FilePath(FILE_PATH_LITERAL("content/test/data"))); ASSERT_TRUE(https_server.Start()); WebContentsImpl* web_contents = diff --git a/content/browser/web_contents/web_drag_dest_gtk.cc b/content/browser/web_contents/web_drag_dest_gtk.cc index b089449..1d8e960 100644 --- a/content/browser/web_contents/web_drag_dest_gtk.cc +++ b/content/browser/web_contents/web_drag_dest_gtk.cc @@ -189,7 +189,7 @@ void WebDragDestGtk::OnDragDataReceived( // file URLs are never set as the URL content for the drop. // TODO(estade): Can the filenames have a non-UTF8 encoding? GURL url(*uri_iter); - FilePath file_path; + base::FilePath file_path; if (url.SchemeIs(chrome::kFileScheme) && net::FileURLToFilePath(url, &file_path)) { drop_data_->filenames.push_back( diff --git a/content/browser/web_contents/web_drag_source_gtk.cc b/content/browser/web_contents/web_drag_source_gtk.cc index b1dda32..c3a786f 100644 --- a/content/browser/web_contents/web_drag_source_gtk.cc +++ b/content/browser/web_contents/web_drag_source_gtk.cc @@ -239,7 +239,7 @@ void WebDragSourceGtk::OnDragDataGet(GtkWidget* sender, GURL file_url(std::string(reinterpret_cast<char*>(file_url_value), file_url_len)); g_free(file_url_value); - FilePath file_path; + base::FilePath file_path; if (net::FileURLToFilePath(file_url, &file_path)) { // Open the file as a stream. scoped_ptr<net::FileStream> file_stream( @@ -316,7 +316,7 @@ void WebDragSourceGtk::OnDragBegin(GtkWidget* sender, // Generate the file name based on both mime type and proposed file name. std::string default_name = GetContentClient()->browser()->GetDefaultDownloadName(); - FilePath generated_download_file_name = + base::FilePath generated_download_file_name = net::GenerateFileName(download_url_, std::string(), std::string(), diff --git a/content/browser/web_contents/web_drag_source_gtk.h b/content/browser/web_contents/web_drag_source_gtk.h index 979047a..1926ca2 100644 --- a/content/browser/web_contents/web_drag_source_gtk.h +++ b/content/browser/web_contents/web_drag_source_gtk.h @@ -93,7 +93,7 @@ class CONTENT_EXPORT WebDragSourceGtk : public MessageLoopForUI::Observer { string16 wide_download_mime_type_; // The file name to be saved to for a drag-out download. - FilePath download_file_name_; + base::FilePath download_file_name_; // The URL to download from for a drag-out download. GURL download_url_; diff --git a/content/browser/web_contents/web_drag_source_mac.h b/content/browser/web_contents/web_drag_source_mac.h index 856edc6..a6cabec 100644 --- a/content/browser/web_contents/web_drag_source_mac.h +++ b/content/browser/web_contents/web_drag_source_mac.h @@ -41,7 +41,7 @@ class WebContentsImpl; NSDragOperation dragOperationMask_; // The file name to be saved to for a drag-out download. - FilePath downloadFileName_; + base::FilePath downloadFileName_; // The URL to download from for a drag-out download. GURL downloadURL_; diff --git a/content/browser/web_contents/web_drag_source_mac.mm b/content/browser/web_contents/web_drag_source_mac.mm index b59be11..f371dcb 100644 --- a/content/browser/web_contents/web_drag_source_mac.mm +++ b/content/browser/web_contents/web_drag_source_mac.mm @@ -51,19 +51,20 @@ NSString* const kNSURLTitlePboardType = @"public.url-name"; // Converts a string16 into a FilePath. Use this method instead of // -[NSString fileSystemRepresentation] to prevent exceptions from being thrown. // See http://crbug.com/78782 for more info. -FilePath FilePathFromFilename(const string16& filename) { +base::FilePath FilePathFromFilename(const string16& filename) { NSString* str = SysUTF16ToNSString(filename); char buf[MAXPATHLEN]; if (![str getFileSystemRepresentation:buf maxLength:sizeof(buf)]) - return FilePath(); - return FilePath(buf); + return base::FilePath(); + return base::FilePath(buf); } // Returns a filename appropriate for the drop data // TODO(viettrungluu): Refactor to make it common across platforms, // and move it somewhere sensible. -FilePath GetFileNameFromDragData(const WebDropData& drop_data) { - FilePath file_name(FilePathFromFilename(drop_data.file_description_filename)); +base::FilePath GetFileNameFromDragData(const WebDropData& drop_data) { + base::FilePath file_name( + FilePathFromFilename(drop_data.file_description_filename)); // Images without ALT text will only have a file extension so we need to // synthesize one from the provided extension and URL. @@ -318,9 +319,9 @@ void PromiseWriterHelper(const WebDropData& drop_data, return nil; } - FilePath fileName = downloadFileName_.empty() ? + base::FilePath fileName = downloadFileName_.empty() ? GetFileNameFromDragData(*dropData_) : downloadFileName_; - FilePath filePath(SysNSStringToUTF8(path)); + base::FilePath filePath(SysNSStringToUTF8(path)); filePath = filePath.Append(fileName); // CreateFileStreamForDrop() will call file_util::PathExists(), @@ -388,7 +389,7 @@ void PromiseWriterHelper(const WebDropData& drop_data, net::GetMimeTypeFromExtension(fileExtension, &mimeType); } else { string16 mimeType16; - FilePath fileName; + base::FilePath fileName; if (content::ParseDownloadMetadata( dropData_->download_metadata, &mimeType16, diff --git a/content/browser/webui/shared_resources_data_source.cc b/content/browser/webui/shared_resources_data_source.cc index 9f7e0a2..54c0c4c 100644 --- a/content/browser/webui/shared_resources_data_source.cc +++ b/content/browser/webui/shared_resources_data_source.cc @@ -57,6 +57,6 @@ std::string SharedResourcesDataSource::GetMimeType( base::ThreadRestrictions::ScopedAllowIO allow_io; std::string mime_type; - net::GetMimeTypeFromFile(FilePath().AppendASCII(path), &mime_type); + net::GetMimeTypeFromFile(base::FilePath().AppendASCII(path), &mime_type); return mime_type; } diff --git a/content/browser/worker_host/test/worker_browsertest.cc b/content/browser/worker_host/test/worker_browsertest.cc index 9e93529..da23201 100644 --- a/content/browser/worker_host/test/worker_browsertest.cc +++ b/content/browser/worker_host/test/worker_browsertest.cc @@ -31,7 +31,8 @@ namespace content { class WorkerLayoutTest : public InProcessBrowserLayoutTest { public: WorkerLayoutTest() : InProcessBrowserLayoutTest( - FilePath(), FilePath().AppendASCII("fast").AppendASCII("workers")) { + base::FilePath(), + base::FilePath().AppendASCII("fast").AppendASCII("workers")) { } }; @@ -126,7 +127,8 @@ IN_PROC_BROWSER_TEST_F(WorkerLayoutTest, SharedWorkerFastSimple) { class MessagePortTest : public InProcessBrowserLayoutTest { public: MessagePortTest() : InProcessBrowserLayoutTest( - FilePath(), FilePath().AppendASCII("fast").AppendASCII("events")) { + base::FilePath(), + base::FilePath().AppendASCII("fast").AppendASCII("events")) { } }; @@ -160,8 +162,8 @@ class WorkerHttpLayoutTest : public InProcessBrowserLayoutTest { // multiple tests which use it run in parallel, then the test will fail but // it'll run again at the end in serial and pass. WorkerHttpLayoutTest() : InProcessBrowserLayoutTest( - FilePath().AppendASCII("http").AppendASCII("tests"), - FilePath().AppendASCII("workers"), + base::FilePath().AppendASCII("http").AppendASCII("tests"), + base::FilePath().AppendASCII("workers"), 8000) { } }; @@ -187,8 +189,8 @@ IN_PROC_BROWSER_TEST_F(WorkerHttpLayoutTest, DISABLED_Tests) { class WorkerXHRHttpLayoutTest : public InProcessBrowserLayoutTest { public: WorkerXHRHttpLayoutTest() : InProcessBrowserLayoutTest( - FilePath().AppendASCII("http").AppendASCII("tests"), - FilePath().AppendASCII("xmlhttprequest").AppendASCII("workers"), + base::FilePath().AppendASCII("http").AppendASCII("tests"), + base::FilePath().AppendASCII("xmlhttprequest").AppendASCII("workers"), -1) { } }; @@ -227,7 +229,7 @@ class WorkerTest : public ContentBrowserTest { WorkerTest() {} GURL GetTestURL(const std::string& test_case, const std::string& query) { - FilePath test_file_path = GetTestFilePath( + base::FilePath test_file_path = GetTestFilePath( "workers", test_case.c_str()); return GetFileUrlWithQuery(test_file_path, query); } diff --git a/content/browser/worker_host/worker_process_host.cc b/content/browser/worker_host/worker_process_host.cc index 03ec6ed..0799ee7 100644 --- a/content/browser/worker_host/worker_process_host.cc +++ b/content/browser/worker_host/worker_process_host.cc @@ -136,7 +136,7 @@ bool WorkerProcessHost::Init(int render_process_id) { int flags = ChildProcessHost::CHILD_NORMAL; #endif - FilePath exe_path = ChildProcessHost::GetChildPath(flags); + base::FilePath exe_path = ChildProcessHost::GetChildPath(flags); if (exe_path.empty()) return false; @@ -191,7 +191,7 @@ bool WorkerProcessHost::Init(int render_process_id) { process_->Launch( #if defined(OS_WIN) - FilePath(), + base::FilePath(), #elif defined(OS_POSIX) use_zygote, base::EnvironmentVector(), diff --git a/content/browser/zygote_host/zygote_host_impl_linux.cc b/content/browser/zygote_host/zygote_host_impl_linux.cc index 409a19f..2251b120 100644 --- a/content/browser/zygote_host/zygote_host_impl_linux.cc +++ b/content/browser/zygote_host/zygote_host_impl_linux.cc @@ -68,7 +68,7 @@ void ZygoteHostImpl::Init(const std::string& sandbox_cmd) { DCHECK(!init_); init_ = true; - FilePath chrome_path; + base::FilePath chrome_path; CHECK(PathService::Get(base::FILE_EXE, &chrome_path)); CommandLine cmd_line(chrome_path); @@ -372,7 +372,7 @@ void ZygoteHostImpl::AdjustRendererOOMScore(base::ProcessHandle pid, static bool selinux_valid = false; if (!selinux_valid) { - const FilePath kSelinuxPath("/selinux"); + const base::FilePath kSelinuxPath("/selinux"); selinux = access(kSelinuxPath.value().c_str(), X_OK) == 0 && file_util::CountFilesCreatedAfter(kSelinuxPath, base::Time::UnixEpoch()) > 0; |