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

Side by Side Diff: content/child/npapi/plugin_url_fetcher.cc

Issue 182383015: Merge weburlrequest_extradata_impl.cc/h into content/child/request_extra_data.cc/h (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address all feedback Created 6 years, 9 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 | « no previous file | content/child/request_extra_data.h » ('j') | content/child/request_extra_data.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/child/npapi/plugin_url_fetcher.h" 5 #include "content/child/npapi/plugin_url_fetcher.h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "content/child/child_thread.h" 8 #include "content/child/child_thread.h"
9 #include "content/child/npapi/plugin_host.h" 9 #include "content/child/npapi/plugin_host.h"
10 #include "content/child/npapi/plugin_instance.h" 10 #include "content/child/npapi/plugin_instance.h"
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 webkit_glue::ResourceLoaderBridge::RequestInfo request_info; 100 webkit_glue::ResourceLoaderBridge::RequestInfo request_info;
101 request_info.method = method; 101 request_info.method = method;
102 request_info.url = url; 102 request_info.url = url;
103 request_info.first_party_for_cookies = first_party_for_cookies; 103 request_info.first_party_for_cookies = first_party_for_cookies;
104 request_info.referrer = referrer; 104 request_info.referrer = referrer;
105 request_info.load_flags = net::LOAD_NORMAL; 105 request_info.load_flags = net::LOAD_NORMAL;
106 request_info.requestor_pid = origin_pid; 106 request_info.requestor_pid = origin_pid;
107 request_info.request_type = ResourceType::OBJECT; 107 request_info.request_type = ResourceType::OBJECT;
108 request_info.routing_id = render_view_id; 108 request_info.routing_id = render_view_id;
109 109
110 RequestExtraData extra_data(blink::WebPageVisibilityStateVisible, 110 RequestExtraData* extra_data = new RequestExtraData();
111 base::string16(), 111 extra_data->set_visibility_state(blink::WebPageVisibilityStateVisible);
112 false, 112 extra_data->set_custom_user_agent(base::string16());
113 render_frame_id, 113 extra_data->set_was_after_preconnect_request(false);
114 false, 114 extra_data->set_render_frame_id(render_frame_id);
115 GURL(), 115 extra_data->set_is_main_frame(false);
116 false, 116 extra_data->set_frame_origin(GURL());
117 -1, 117 extra_data->set_parent_is_main_frame(false);
118 true, 118 extra_data->set_parent_render_frame_id(-1);
119 PAGE_TRANSITION_LINK, 119 extra_data->set_allow_download(true);
120 false, 120 extra_data->set_transition_type(PAGE_TRANSITION_LINK);
121 -1, 121 extra_data->set_should_replace_current_entry(false);
122 -1, 122 extra_data->set_transferred_request_child_id(-1);
123 kInvalidServiceWorkerProviderId); 123 extra_data->set_transferred_request_request_id(-1);
124 124 extra_data->set_service_worker_provider_id(kInvalidServiceWorkerProviderId);
125 request_info.extra_data = &extra_data; 125 request_info.extra_data = extra_data;
126 126
127 std::vector<char> body; 127 std::vector<char> body;
128 if (method == "POST") { 128 if (method == "POST") {
129 bool content_type_found = false; 129 bool content_type_found = false;
130 std::vector<std::string> names; 130 std::vector<std::string> names;
131 std::vector<std::string> values; 131 std::vector<std::string> values;
132 PluginHost::SetPostData(buf, len, &names, &values, &body); 132 PluginHost::SetPostData(buf, len, &names, &values, &body);
133 for (size_t i = 0; i < names.size(); ++i) { 133 for (size_t i = 0; i < names.size(); ++i) {
134 if (!request_info.headers.empty()) 134 if (!request_info.headers.empty())
135 request_info.headers += "\r\n"; 135 request_info.headers += "\r\n";
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 } 352 }
353 353
354 if (error_code == net::OK) { 354 if (error_code == net::OK) {
355 plugin_stream_->DidFinishLoading(resource_id_); 355 plugin_stream_->DidFinishLoading(resource_id_);
356 } else { 356 } else {
357 plugin_stream_->DidFail(resource_id_); 357 plugin_stream_->DidFail(resource_id_);
358 } 358 }
359 } 359 }
360 360
361 } // namespace content 361 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/child/request_extra_data.h » ('j') | content/child/request_extra_data.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698