| OLD | NEW |
| 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 "content/browser/intents/intent_injector.h" | 5 #include "content/browser/intents/intent_injector.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 (source_intent_->data_type == webkit_glue::WebIntentData::MIME_TYPE && | 85 (source_intent_->data_type == webkit_glue::WebIntentData::MIME_TYPE && |
| 86 !source_intent_->blob_file.empty())) { | 86 !source_intent_->blob_file.empty())) { |
| 87 const int child_id = render_view_host->GetProcess()->GetID(); | 87 const int child_id = render_view_host->GetProcess()->GetID(); |
| 88 ChildProcessSecurityPolicy* policy = | 88 ChildProcessSecurityPolicy* policy = |
| 89 ChildProcessSecurityPolicy::GetInstance(); | 89 ChildProcessSecurityPolicy::GetInstance(); |
| 90 if (!policy->CanReadFile(child_id, source_intent_->blob_file)) | 90 if (!policy->CanReadFile(child_id, source_intent_->blob_file)) |
| 91 policy->GrantReadFile(child_id, source_intent_->blob_file); | 91 policy->GrantReadFile(child_id, source_intent_->blob_file); |
| 92 } else if (source_intent_->data_type == | 92 } else if (source_intent_->data_type == |
| 93 webkit_glue::WebIntentData::FILESYSTEM) { | 93 webkit_glue::WebIntentData::FILESYSTEM) { |
| 94 const int child_id = render_view_host->GetProcess()->GetID(); | 94 const int child_id = render_view_host->GetProcess()->GetID(); |
| 95 FilePath path; | 95 base::FilePath path; |
| 96 const bool valid = | 96 const bool valid = |
| 97 fileapi::IsolatedContext::GetInstance()->GetRegisteredPath( | 97 fileapi::IsolatedContext::GetInstance()->GetRegisteredPath( |
| 98 source_intent_->filesystem_id, &path); | 98 source_intent_->filesystem_id, &path); |
| 99 DCHECK(valid); | 99 DCHECK(valid); |
| 100 ChildProcessSecurityPolicy* policy = | 100 ChildProcessSecurityPolicy* policy = |
| 101 ChildProcessSecurityPolicy::GetInstance(); | 101 ChildProcessSecurityPolicy::GetInstance(); |
| 102 if (!policy->CanReadFile(child_id, path)) | 102 if (!policy->CanReadFile(child_id, path)) |
| 103 policy->GrantReadFile(child_id, path); | 103 policy->GrantReadFile(child_id, path); |
| 104 policy->GrantReadFileSystem(child_id, source_intent_->filesystem_id); | 104 policy->GrantReadFileSystem(child_id, source_intent_->filesystem_id); |
| 105 } | 105 } |
| (...skipping 15 matching lines...) Expand all Loading... |
| 121 if (!intents_dispatcher_) | 121 if (!intents_dispatcher_) |
| 122 return; | 122 return; |
| 123 | 123 |
| 124 // Ensure SendReplyMessage is only called once. | 124 // Ensure SendReplyMessage is only called once. |
| 125 WebIntentsDispatcher* intents_dispatcher = intents_dispatcher_; | 125 WebIntentsDispatcher* intents_dispatcher = intents_dispatcher_; |
| 126 intents_dispatcher_ = NULL; | 126 intents_dispatcher_ = NULL; |
| 127 intents_dispatcher->SendReply(reply); | 127 intents_dispatcher->SendReply(reply); |
| 128 } | 128 } |
| 129 | 129 |
| 130 } // namespace content | 130 } // namespace content |
| OLD | NEW |