OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/renderer_host/pepper/pepper_isolated_file_system_messag
e_filter.h" | 5 #include "chrome/browser/renderer_host/pepper/pepper_isolated_file_system_messag
e_filter.h" |
6 | 6 |
7 #include "chrome/browser/browser_process.h" | 7 #include "chrome/browser/browser_process.h" |
8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
9 #include "chrome/browser/profiles/profile_manager.h" | 9 #include "chrome/browser/profiles/profile_manager.h" |
10 #include "chrome/common/chrome_switches.h" | 10 #include "chrome/common/chrome_switches.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 ppapi::host::HostMessageContext* context) { | 85 ppapi::host::HostMessageContext* context) { |
86 PPAPI_BEGIN_MESSAGE_MAP(PepperIsolatedFileSystemMessageFilter, msg) | 86 PPAPI_BEGIN_MESSAGE_MAP(PepperIsolatedFileSystemMessageFilter, msg) |
87 PPAPI_DISPATCH_HOST_RESOURCE_CALL( | 87 PPAPI_DISPATCH_HOST_RESOURCE_CALL( |
88 PpapiHostMsg_IsolatedFileSystem_BrowserOpen, | 88 PpapiHostMsg_IsolatedFileSystem_BrowserOpen, |
89 OnOpenFileSystem) | 89 OnOpenFileSystem) |
90 PPAPI_END_MESSAGE_MAP() | 90 PPAPI_END_MESSAGE_MAP() |
91 return PP_ERROR_FAILED; | 91 return PP_ERROR_FAILED; |
92 } | 92 } |
93 | 93 |
94 Profile* PepperIsolatedFileSystemMessageFilter::GetProfile() { | 94 Profile* PepperIsolatedFileSystemMessageFilter::GetProfile() { |
95 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); | 95 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
96 ProfileManager* profile_manager = g_browser_process->profile_manager(); | 96 ProfileManager* profile_manager = g_browser_process->profile_manager(); |
97 return profile_manager->GetProfile(profile_directory_); | 97 return profile_manager->GetProfile(profile_directory_); |
98 } | 98 } |
99 | 99 |
100 std::string PepperIsolatedFileSystemMessageFilter::CreateCrxFileSystem( | 100 std::string PepperIsolatedFileSystemMessageFilter::CreateCrxFileSystem( |
101 Profile* profile) { | 101 Profile* profile) { |
102 #if defined(ENABLE_EXTENSIONS) | 102 #if defined(ENABLE_EXTENSIONS) |
103 const extensions::Extension* extension = | 103 const extensions::Extension* extension = |
104 extensions::ExtensionRegistry::Get(profile)->enabled_extensions().GetByID( | 104 extensions::ExtensionRegistry::Get(profile)->enabled_extensions().GetByID( |
105 document_url_.host()); | 105 document_url_.host()); |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 // Grant full access of isolated filesystem to renderer process. | 190 // Grant full access of isolated filesystem to renderer process. |
191 content::ChildProcessSecurityPolicy* policy = | 191 content::ChildProcessSecurityPolicy* policy = |
192 content::ChildProcessSecurityPolicy::GetInstance(); | 192 content::ChildProcessSecurityPolicy::GetInstance(); |
193 policy->GrantCreateReadWriteFileSystem(render_process_id_, fsid); | 193 policy->GrantCreateReadWriteFileSystem(render_process_id_, fsid); |
194 | 194 |
195 context->reply_msg = PpapiPluginMsg_IsolatedFileSystem_BrowserOpenReply(fsid); | 195 context->reply_msg = PpapiPluginMsg_IsolatedFileSystem_BrowserOpenReply(fsid); |
196 return PP_OK; | 196 return PP_OK; |
197 } | 197 } |
198 | 198 |
199 } // namespace chrome | 199 } // namespace chrome |
OLD | NEW |