OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/devtools/devtools_file_helper.h" | 5 #include "chrome/browser/devtools/devtools_file_helper.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 122 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
123 DCHECK(!path.empty()); | 123 DCHECK(!path.empty()); |
124 | 124 |
125 base::WriteFile(path, content.c_str(), content.length()); | 125 base::WriteFile(path, content.c_str(), content.length()); |
126 } | 126 } |
127 | 127 |
128 void AppendToFile(const base::FilePath& path, const std::string& content) { | 128 void AppendToFile(const base::FilePath& path, const std::string& content) { |
129 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 129 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
130 DCHECK(!path.empty()); | 130 DCHECK(!path.empty()); |
131 | 131 |
132 file_util::AppendToFile(path, content.c_str(), content.length()); | 132 base::AppendToFile(path, content.c_str(), content.length()); |
133 } | 133 } |
134 | 134 |
135 fileapi::IsolatedContext* isolated_context() { | 135 fileapi::IsolatedContext* isolated_context() { |
136 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 136 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
137 fileapi::IsolatedContext* isolated_context = | 137 fileapi::IsolatedContext* isolated_context = |
138 fileapi::IsolatedContext::GetInstance(); | 138 fileapi::IsolatedContext::GetInstance(); |
139 DCHECK(isolated_context); | 139 DCHECK(isolated_context); |
140 return isolated_context; | 140 return isolated_context; |
141 } | 141 } |
142 | 142 |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 base::DictionaryValue* file_systems_paths_value = update.Get(); | 420 base::DictionaryValue* file_systems_paths_value = update.Get(); |
421 file_systems_paths_value->RemoveWithoutPathExpansion(file_system_path, NULL); | 421 file_systems_paths_value->RemoveWithoutPathExpansion(file_system_path, NULL); |
422 } | 422 } |
423 | 423 |
424 bool DevToolsFileHelper::IsFileSystemAdded( | 424 bool DevToolsFileHelper::IsFileSystemAdded( |
425 const std::string& file_system_path) { | 425 const std::string& file_system_path) { |
426 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 426 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
427 set<std::string> file_system_paths = GetAddedFileSystemPaths(profile_); | 427 set<std::string> file_system_paths = GetAddedFileSystemPaths(profile_); |
428 return file_system_paths.find(file_system_path) != file_system_paths.end(); | 428 return file_system_paths.find(file_system_path) != file_system_paths.end(); |
429 } | 429 } |
OLD | NEW |