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

Side by Side Diff: content/renderer/pepper/url_request_info_util.cc

Issue 20777009: A few more cleanups to the pepper code. Dispatch IPCs in the sockets implementations directly by ha… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix browsertest Created 7 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 | « content/renderer/pepper/resource_helper.cc ('k') | content/renderer/render_thread_impl.cc » ('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 (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
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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 bool URLRequestRequiresUniversalAccess( 209 bool URLRequestRequiresUniversalAccess(
215 const ::ppapi::URLRequestInfoData& data) { 210 const ::ppapi::URLRequestInfoData& data) {
216 return 211 return
217 data.has_custom_referrer_url || 212 data.has_custom_referrer_url ||
218 data.has_custom_content_transfer_encoding || 213 data.has_custom_content_transfer_encoding ||
219 data.has_custom_user_agent || 214 data.has_custom_user_agent ||
220 url_util::FindAndCompareScheme(data.url, "javascript", NULL); 215 url_util::FindAndCompareScheme(data.url, "javascript", NULL);
221 } 216 }
222 217
223 } // namespace content 218 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/pepper/resource_helper.cc ('k') | content/renderer/render_thread_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698