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

Side by Side Diff: chrome/browser/extensions/api/file_system/file_system_api.cc

Issue 10879002: kFileSystemTypeIsolated should be only used in the URL exposed to renderer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: build fix Created 8 years, 3 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 | chrome/browser/extensions/platform_app_launcher.cc » ('j') | 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/extensions/api/file_system/file_system_api.h" 5 #include "chrome/browser/extensions/api/file_system/file_system_api.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/file_path.h" 8 #include "base/file_path.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 void FileSystemEntryFunction::RegisterFileSystemAndSendResponse( 251 void FileSystemEntryFunction::RegisterFileSystemAndSendResponse(
252 const FilePath& path, EntryType entry_type) { 252 const FilePath& path, EntryType entry_type) {
253 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); 253 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
254 254
255 fileapi::IsolatedContext* isolated_context = 255 fileapi::IsolatedContext* isolated_context =
256 fileapi::IsolatedContext::GetInstance(); 256 fileapi::IsolatedContext::GetInstance();
257 DCHECK(isolated_context); 257 DCHECK(isolated_context);
258 258
259 std::string registered_name; 259 std::string registered_name;
260 std::string filesystem_id = isolated_context->RegisterFileSystemForPath( 260 std::string filesystem_id = isolated_context->RegisterFileSystemForPath(
261 fileapi::kFileSystemTypeIsolated, path, &registered_name); 261 fileapi::kFileSystemTypeNativeLocal, path, &registered_name);
262 262
263 content::ChildProcessSecurityPolicy* policy = 263 content::ChildProcessSecurityPolicy* policy =
264 content::ChildProcessSecurityPolicy::GetInstance(); 264 content::ChildProcessSecurityPolicy::GetInstance();
265 int renderer_id = render_view_host_->GetProcess()->GetID(); 265 int renderer_id = render_view_host_->GetProcess()->GetID();
266 if (entry_type == WRITABLE) 266 if (entry_type == WRITABLE)
267 policy->GrantReadWriteFileSystem(renderer_id, filesystem_id); 267 policy->GrantReadWriteFileSystem(renderer_id, filesystem_id);
268 else 268 else
269 policy->GrantReadFileSystem(renderer_id, filesystem_id); 269 policy->GrantReadFileSystem(renderer_id, filesystem_id);
270 270
271 // We only need file level access for reading FileEntries. Saving FileEntries 271 // We only need file level access for reading FileEntries. Saving FileEntries
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 553
554 if (entry_type == WRITABLE && !HasFileSystemWritePermission()) { 554 if (entry_type == WRITABLE && !HasFileSystemWritePermission()) {
555 error_ = kRequiresFileSystemWriteError; 555 error_ = kRequiresFileSystemWriteError;
556 return false; 556 return false;
557 } 557 }
558 558
559 return ShowPicker(suggested_name, file_type_info, picker_type, entry_type); 559 return ShowPicker(suggested_name, file_type_info, picker_type, entry_type);
560 } 560 }
561 561
562 } // namespace extensions 562 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/platform_app_launcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698