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

Side by Side Diff: chrome/browser/devtools/devtools_file_helper.cc

Issue 15915009: DevTools: Do not treat saved path as dot separated keys when saving file systems. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 } 311 }
312 std::string registered_name; 312 std::string registered_name;
313 std::string file_system_id = RegisterFileSystem(web_contents_, 313 std::string file_system_id = RegisterFileSystem(web_contents_,
314 path, 314 path,
315 &registered_name); 315 &registered_name);
316 std::string file_system_path = path.AsUTF8Unsafe(); 316 std::string file_system_path = path.AsUTF8Unsafe();
317 317
318 DictionaryPrefUpdate update(profile_->GetPrefs(), 318 DictionaryPrefUpdate update(profile_->GetPrefs(),
319 prefs::kDevToolsFileSystemPaths); 319 prefs::kDevToolsFileSystemPaths);
320 DictionaryValue* file_systems_paths_value = update.Get(); 320 DictionaryValue* file_systems_paths_value = update.Get();
321 file_systems_paths_value->Set(file_system_path, Value::CreateNullValue()); 321 file_systems_paths_value->SetWithoutPathExpansion(file_system_path,
322 Value::CreateNullValue());
322 323
323 FileSystem filesystem = CreateFileSystemStruct(web_contents_, 324 FileSystem filesystem = CreateFileSystemStruct(web_contents_,
324 file_system_id, 325 file_system_id,
325 registered_name, 326 registered_name,
326 file_system_path); 327 file_system_path);
327 callback.Run(filesystem); 328 callback.Run(filesystem);
328 } 329 }
329 330
330 void DevToolsFileHelper::RequestFileSystems( 331 void DevToolsFileHelper::RequestFileSystems(
331 const RequestFileSystemsCallback& callback) { 332 const RequestFileSystemsCallback& callback) {
(...skipping 21 matching lines...) Expand all
353 void DevToolsFileHelper::RemoveFileSystem(const std::string& file_system_path) { 354 void DevToolsFileHelper::RemoveFileSystem(const std::string& file_system_path) {
354 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 355 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
355 base::FilePath path = base::FilePath::FromUTF8Unsafe(file_system_path); 356 base::FilePath path = base::FilePath::FromUTF8Unsafe(file_system_path);
356 isolated_context()->RevokeFileSystemByPath(path); 357 isolated_context()->RevokeFileSystemByPath(path);
357 358
358 DictionaryPrefUpdate update(profile_->GetPrefs(), 359 DictionaryPrefUpdate update(profile_->GetPrefs(),
359 prefs::kDevToolsFileSystemPaths); 360 prefs::kDevToolsFileSystemPaths);
360 DictionaryValue* file_systems_paths_value = update.Get(); 361 DictionaryValue* file_systems_paths_value = update.Get();
361 file_systems_paths_value->RemoveWithoutPathExpansion(file_system_path, NULL); 362 file_systems_paths_value->RemoveWithoutPathExpansion(file_system_path, NULL);
362 } 363 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698