| 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/renderer/pepper/url_request_info_util.h" | 5 #include "content/renderer/pepper/url_request_info_util.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
| 9 #include "content/common/fileapi/file_system_messages.h" | 9 #include "content/common/fileapi/file_system_messages.h" |
| 10 #include "content/renderer/pepper/common.h" | 10 #include "content/renderer/pepper/common.h" |
| 11 #include "content/renderer/pepper/plugin_module.h" | 11 #include "content/renderer/pepper/plugin_module.h" |
| 12 #include "content/renderer/pepper/ppb_file_ref_impl.h" | 12 #include "content/renderer/pepper/ppb_file_ref_impl.h" |
| 13 #include "content/renderer/pepper/resource_helper.h" | |
| 14 #include "content/renderer/render_thread_impl.h" | 13 #include "content/renderer/render_thread_impl.h" |
| 15 #include "net/http/http_util.h" | 14 #include "net/http/http_util.h" |
| 16 #include "ppapi/shared_impl/url_request_info_data.h" | 15 #include "ppapi/shared_impl/url_request_info_data.h" |
| 17 #include "ppapi/shared_impl/var.h" | 16 #include "ppapi/shared_impl/var.h" |
| 18 #include "ppapi/thunk/enter.h" | 17 #include "ppapi/thunk/enter.h" |
| 19 #include "third_party/WebKit/public/platform/WebData.h" | 18 #include "third_party/WebKit/public/platform/WebData.h" |
| 20 #include "third_party/WebKit/public/platform/WebHTTPBody.h" | 19 #include "third_party/WebKit/public/platform/WebHTTPBody.h" |
| 21 #include "third_party/WebKit/public/platform/WebURL.h" | 20 #include "third_party/WebKit/public/platform/WebURL.h" |
| 22 #include "third_party/WebKit/public/platform/WebURLRequest.h" | 21 #include "third_party/WebKit/public/platform/WebURLRequest.h" |
| 23 #include "third_party/WebKit/public/web/WebDocument.h" | 22 #include "third_party/WebKit/public/web/WebDocument.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 51 WebHTTPBody *http_body) { | 50 WebHTTPBody *http_body) { |
| 52 // Get the underlying file ref impl. | 51 // Get the underlying file ref impl. |
| 53 if (!file_ref_resource) | 52 if (!file_ref_resource) |
| 54 return false; | 53 return false; |
| 55 PPB_FileRef_API* file_ref_api = file_ref_resource->AsPPB_FileRef_API(); | 54 PPB_FileRef_API* file_ref_api = file_ref_resource->AsPPB_FileRef_API(); |
| 56 if (!file_ref_api) | 55 if (!file_ref_api) |
| 57 return false; | 56 return false; |
| 58 const PPB_FileRef_Impl* file_ref = | 57 const PPB_FileRef_Impl* file_ref = |
| 59 static_cast<PPB_FileRef_Impl*>(file_ref_api); | 58 static_cast<PPB_FileRef_Impl*>(file_ref_api); |
| 60 | 59 |
| 61 PepperHelperImpl* helper = ResourceHelper::GetHelper(file_ref_resource); | |
| 62 if (!helper) | |
| 63 return false; | |
| 64 | |
| 65 base::FilePath platform_path; | 60 base::FilePath platform_path; |
| 66 switch (file_ref->GetFileSystemType()) { | 61 switch (file_ref->GetFileSystemType()) { |
| 67 case PP_FILESYSTEMTYPE_LOCALTEMPORARY: | 62 case PP_FILESYSTEMTYPE_LOCALTEMPORARY: |
| 68 case PP_FILESYSTEMTYPE_LOCALPERSISTENT: | 63 case PP_FILESYSTEMTYPE_LOCALPERSISTENT: |
| 69 // TODO(kinuko): remove this sync IPC when we fully support | 64 // TODO(kinuko): remove this sync IPC when we fully support |
| 70 // AppendURLRange for FileSystem URL. | 65 // AppendURLRange for FileSystem URL. |
| 71 RenderThreadImpl::current()->Send( | 66 RenderThreadImpl::current()->Send( |
| 72 new FileSystemHostMsg_SyncGetPlatformPath( | 67 new FileSystemHostMsg_SyncGetPlatformPath( |
| 73 file_ref->GetFileSystemURL(), &platform_path)); | 68 file_ref->GetFileSystemURL(), &platform_path)); |
| 74 break; | 69 break; |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 bool URLRequestRequiresUniversalAccess( | 193 bool URLRequestRequiresUniversalAccess( |
| 199 const ::ppapi::URLRequestInfoData& data) { | 194 const ::ppapi::URLRequestInfoData& data) { |
| 200 return | 195 return |
| 201 data.has_custom_referrer_url || | 196 data.has_custom_referrer_url || |
| 202 data.has_custom_content_transfer_encoding || | 197 data.has_custom_content_transfer_encoding || |
| 203 data.has_custom_user_agent || | 198 data.has_custom_user_agent || |
| 204 url_util::FindAndCompareScheme(data.url, "javascript", NULL); | 199 url_util::FindAndCompareScheme(data.url, "javascript", NULL); |
| 205 } | 200 } |
| 206 | 201 |
| 207 } // namespace content | 202 } // namespace content |
| OLD | NEW |