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

Side by Side Diff: extensions/browser/api/runtime/runtime_api.cc

Issue 341043008: Add FileSystemID parameter to IsolatedContext::RegisterFileSystemForPath. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/browser/api/runtime/runtime_api.h" 5 #include "extensions/browser/api/runtime/runtime_api.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 521
522 ExtensionFunction::ResponseAction 522 ExtensionFunction::ResponseAction
523 RuntimeGetPackageDirectoryEntryFunction::Run() { 523 RuntimeGetPackageDirectoryEntryFunction::Run() {
524 fileapi::IsolatedContext* isolated_context = 524 fileapi::IsolatedContext* isolated_context =
525 fileapi::IsolatedContext::GetInstance(); 525 fileapi::IsolatedContext::GetInstance();
526 DCHECK(isolated_context); 526 DCHECK(isolated_context);
527 527
528 std::string relative_path = kPackageDirectoryPath; 528 std::string relative_path = kPackageDirectoryPath;
529 base::FilePath path = extension_->path(); 529 base::FilePath path = extension_->path();
530 std::string filesystem_id = isolated_context->RegisterFileSystemForPath( 530 std::string filesystem_id = isolated_context->RegisterFileSystemForPath(
531 fileapi::kFileSystemTypeNativeLocal, path, &relative_path); 531 fileapi::kFileSystemTypeNativeLocal, std::string(), path, &relative_path);
532 532
533 int renderer_id = render_view_host_->GetProcess()->GetID(); 533 int renderer_id = render_view_host_->GetProcess()->GetID();
534 content::ChildProcessSecurityPolicy* policy = 534 content::ChildProcessSecurityPolicy* policy =
535 content::ChildProcessSecurityPolicy::GetInstance(); 535 content::ChildProcessSecurityPolicy::GetInstance();
536 policy->GrantReadFileSystem(renderer_id, filesystem_id); 536 policy->GrantReadFileSystem(renderer_id, filesystem_id);
537 base::DictionaryValue* dict = new base::DictionaryValue(); 537 base::DictionaryValue* dict = new base::DictionaryValue();
538 dict->SetString("fileSystemId", filesystem_id); 538 dict->SetString("fileSystemId", filesystem_id);
539 dict->SetString("baseName", relative_path); 539 dict->SetString("baseName", relative_path);
540 return RespondNow(OneArgument(dict)); 540 return RespondNow(OneArgument(dict));
541 } 541 }
542 542
543 } // namespace extensions 543 } // namespace extensions
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_view_host_impl.cc ('k') | webkit/browser/fileapi/external_mount_points.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698