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

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

Issue 730603002: PPAPI: Refactor renderer side of browser host creation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge Created 6 years, 1 month 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
« no previous file with comments | « content/renderer/pepper/resource_converter.cc ('k') | ppapi/proxy/ppapi_messages.h » ('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 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 "content/renderer/pepper/url_response_info_util.h" 5 #include "content/renderer/pepper/url_response_info_util.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "content/public/renderer/renderer_ppapi_host.h" 10 #include "content/public/renderer/renderer_ppapi_host.h"
(...skipping 27 matching lines...) Expand all
38 buffer_.append(": "); 38 buffer_.append(": ");
39 buffer_.append(value.utf8()); 39 buffer_.append(value.utf8());
40 } 40 }
41 41
42 private: 42 private:
43 std::string buffer_; 43 std::string buffer_;
44 }; 44 };
45 45
46 bool IsRedirect(int32_t status) { return status >= 300 && status <= 399; } 46 bool IsRedirect(int32_t status) { return status >= 300 && status <= 399; }
47 47
48 void DidCreateResourceHosts(const ppapi::URLResponseInfoData& in_data, 48 void DidCreateResourceHosts(
49 const base::FilePath& external_path, 49 const ppapi::URLResponseInfoData& in_data,
50 int renderer_pending_host_id, 50 const base::FilePath& external_path,
51 const DataFromWebURLResponseCallback& callback, 51 int renderer_pending_host_id,
52 const std::vector<int>& browser_pending_host_ids) { 52 const DataFromWebURLResponseCallback& callback,
53 DCHECK_EQ(1U, browser_pending_host_ids.size()); 53 const ppapi::proxy::CompletedBrowserResourceHosts& browser_hosts) {
54 DCHECK_EQ(1U, browser_hosts.host_ids.size());
54 int browser_pending_host_id = 0; 55 int browser_pending_host_id = 0;
55 56
56 if (browser_pending_host_ids.size() == 1) 57 if (browser_hosts.host_ids.size() == 1)
57 browser_pending_host_id = browser_pending_host_ids[0]; 58 browser_pending_host_id = browser_hosts.host_ids[0];
58 59
59 ppapi::URLResponseInfoData data = in_data; 60 ppapi::URLResponseInfoData data = in_data;
60 61
61 data.body_as_file_ref = 62 data.body_as_file_ref =
62 ppapi::MakeExternalFileRefCreateInfo(external_path, 63 ppapi::MakeExternalFileRefCreateInfo(external_path,
63 std::string(), 64 std::string(),
64 browser_pending_host_id, 65 browser_pending_host_id,
65 renderer_pending_host_id); 66 renderer_pending_host_id);
66 callback.Run(data); 67 callback.Run(data);
67 } 68 }
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 external_path, 106 external_path,
106 renderer_pending_host_id, 107 renderer_pending_host_id,
107 callback)); 108 callback));
108 } else { 109 } else {
109 base::MessageLoop::current()->PostTask(FROM_HERE, 110 base::MessageLoop::current()->PostTask(FROM_HERE,
110 base::Bind(callback, data)); 111 base::Bind(callback, data));
111 } 112 }
112 } 113 }
113 114
114 } // namespace content 115 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/pepper/resource_converter.cc ('k') | ppapi/proxy/ppapi_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698