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

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

Issue 442383002: Move storage-related files from webkit/ to new top-level directory storage/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 4 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 | « extensions/browser/DEPS ('k') | extensions/renderer/DEPS » ('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 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 16 matching lines...) Expand all
27 #include "extensions/browser/extensions_browser_client.h" 27 #include "extensions/browser/extensions_browser_client.h"
28 #include "extensions/browser/lazy_background_task_queue.h" 28 #include "extensions/browser/lazy_background_task_queue.h"
29 #include "extensions/browser/notification_types.h" 29 #include "extensions/browser/notification_types.h"
30 #include "extensions/browser/process_manager.h" 30 #include "extensions/browser/process_manager.h"
31 #include "extensions/common/api/runtime.h" 31 #include "extensions/common/api/runtime.h"
32 #include "extensions/common/error_utils.h" 32 #include "extensions/common/error_utils.h"
33 #include "extensions/common/extension.h" 33 #include "extensions/common/extension.h"
34 #include "extensions/common/manifest_handlers/background_info.h" 34 #include "extensions/common/manifest_handlers/background_info.h"
35 #include "extensions/common/manifest_handlers/shared_module_info.h" 35 #include "extensions/common/manifest_handlers/shared_module_info.h"
36 #include "url/gurl.h" 36 #include "url/gurl.h"
37 #include "webkit/browser/fileapi/isolated_context.h" 37 #include "storage/browser/fileapi/isolated_context.h"
38 38
39 using content::BrowserContext; 39 using content::BrowserContext;
40 40
41 namespace extensions { 41 namespace extensions {
42 42
43 namespace runtime = core_api::runtime; 43 namespace runtime = core_api::runtime;
44 44
45 namespace { 45 namespace {
46 46
47 const char kNoBackgroundPageError[] = "You do not have a background page."; 47 const char kNoBackgroundPageError[] = "You do not have a background page.";
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 ->Get(browser_context()) 491 ->Get(browser_context())
492 ->GetPlatformInfo(&info)) { 492 ->GetPlatformInfo(&info)) {
493 return RespondNow(Error(kPlatformInfoUnavailable)); 493 return RespondNow(Error(kPlatformInfoUnavailable));
494 } 494 }
495 return RespondNow( 495 return RespondNow(
496 ArgumentList(runtime::GetPlatformInfo::Results::Create(info))); 496 ArgumentList(runtime::GetPlatformInfo::Results::Create(info)));
497 } 497 }
498 498
499 ExtensionFunction::ResponseAction 499 ExtensionFunction::ResponseAction
500 RuntimeGetPackageDirectoryEntryFunction::Run() { 500 RuntimeGetPackageDirectoryEntryFunction::Run() {
501 fileapi::IsolatedContext* isolated_context = 501 storage::IsolatedContext* isolated_context =
502 fileapi::IsolatedContext::GetInstance(); 502 storage::IsolatedContext::GetInstance();
503 DCHECK(isolated_context); 503 DCHECK(isolated_context);
504 504
505 std::string relative_path = kPackageDirectoryPath; 505 std::string relative_path = kPackageDirectoryPath;
506 base::FilePath path = extension_->path(); 506 base::FilePath path = extension_->path();
507 std::string filesystem_id = isolated_context->RegisterFileSystemForPath( 507 std::string filesystem_id = isolated_context->RegisterFileSystemForPath(
508 fileapi::kFileSystemTypeNativeLocal, std::string(), path, &relative_path); 508 storage::kFileSystemTypeNativeLocal, std::string(), path, &relative_path);
509 509
510 int renderer_id = render_view_host_->GetProcess()->GetID(); 510 int renderer_id = render_view_host_->GetProcess()->GetID();
511 content::ChildProcessSecurityPolicy* policy = 511 content::ChildProcessSecurityPolicy* policy =
512 content::ChildProcessSecurityPolicy::GetInstance(); 512 content::ChildProcessSecurityPolicy::GetInstance();
513 policy->GrantReadFileSystem(renderer_id, filesystem_id); 513 policy->GrantReadFileSystem(renderer_id, filesystem_id);
514 base::DictionaryValue* dict = new base::DictionaryValue(); 514 base::DictionaryValue* dict = new base::DictionaryValue();
515 dict->SetString("fileSystemId", filesystem_id); 515 dict->SetString("fileSystemId", filesystem_id);
516 dict->SetString("baseName", relative_path); 516 dict->SetString("baseName", relative_path);
517 return RespondNow(OneArgument(dict)); 517 return RespondNow(OneArgument(dict));
518 } 518 }
519 519
520 } // namespace extensions 520 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/DEPS ('k') | extensions/renderer/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698