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

Side by Side Diff: content/browser/renderer_host/resource_request_details.cc

Issue 9052007: Create an API around WorkerService that chrome consumes. Rename the existing WorkerService to Wor... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 8 years, 11 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/renderer_host/resource_request_details.h" 5 #include "content/browser/renderer_host/resource_request_details.h"
6 6
7 #include "content/browser/renderer_host/resource_dispatcher_host.h" 7 #include "content/browser/renderer_host/resource_dispatcher_host.h"
8 #include "content/browser/renderer_host/resource_dispatcher_host_request_info.h" 8 #include "content/browser/renderer_host/resource_dispatcher_host_request_info.h"
9 #include "content/browser/worker_host/worker_service.h" 9 #include "content/browser/worker_host/worker_service_impl.h"
10
11 using content::WorkerServiceImpl;
10 12
11 ResourceRequestDetails::ResourceRequestDetails(const net::URLRequest* request, 13 ResourceRequestDetails::ResourceRequestDetails(const net::URLRequest* request,
12 int cert_id) 14 int cert_id)
13 : url_(request->url()), 15 : url_(request->url()),
14 original_url_(request->original_url()), 16 original_url_(request->original_url()),
15 method_(request->method()), 17 method_(request->method()),
16 referrer_(request->referrer()), 18 referrer_(request->referrer()),
17 has_upload_(request->has_upload()), 19 has_upload_(request->has_upload()),
18 load_flags_(request->load_flags()), 20 load_flags_(request->load_flags()),
19 status_(request->status()), 21 status_(request->status()),
20 ssl_cert_id_(cert_id), 22 ssl_cert_id_(cert_id),
21 ssl_cert_status_(request->ssl_info().cert_status), 23 ssl_cert_status_(request->ssl_info().cert_status),
22 socket_address_(request->GetSocketAddress()) { 24 socket_address_(request->GetSocketAddress()) {
23 const ResourceDispatcherHostRequestInfo* info = 25 const ResourceDispatcherHostRequestInfo* info =
24 ResourceDispatcherHost::InfoForRequest(request); 26 ResourceDispatcherHost::InfoForRequest(request);
25 resource_type_ = info->resource_type(); 27 resource_type_ = info->resource_type();
26 28
27 // If request is from the worker process on behalf of a renderer, use 29 // If request is from the worker process on behalf of a renderer, use
28 // the renderer process id, since it consumes the notification response 30 // the renderer process id, since it consumes the notification response
29 // such as ssl state etc. 31 // such as ssl state etc.
30 // TODO(atwilson): need to notify all associated renderers in the case 32 // TODO(atwilson): need to notify all associated renderers in the case
31 // of ssl state change (http://crbug.com/25357). For now, just notify 33 // of ssl state change (http://crbug.com/25357). For now, just notify
32 // the first one (works for dedicated workers and shared workers with 34 // the first one (works for dedicated workers and shared workers with
33 // a single process). 35 // a single process).
34 int temp; 36 int temp;
35 if (!WorkerService::GetInstance()->GetRendererForWorker( 37 if (!WorkerServiceImpl::GetInstance()->GetRendererForWorker(
36 info->child_id(), &origin_child_id_, &temp)) { 38 info->child_id(), &origin_child_id_, &temp)) {
37 origin_child_id_ = info->child_id(); 39 origin_child_id_ = info->child_id();
38 } 40 }
39 } 41 }
40 42
41 ResourceRequestDetails::~ResourceRequestDetails() {} 43 ResourceRequestDetails::~ResourceRequestDetails() {}
42 44
43 ResourceRedirectDetails::ResourceRedirectDetails(const net::URLRequest* request, 45 ResourceRedirectDetails::ResourceRedirectDetails(const net::URLRequest* request,
44 int cert_id, 46 int cert_id,
45 const GURL& new_url) 47 const GURL& new_url)
46 : ResourceRequestDetails(request, cert_id), 48 : ResourceRequestDetails(request, cert_id),
47 new_url_(new_url) { 49 new_url_(new_url) {
48 } 50 }
49 51
50 ResourceRedirectDetails::~ResourceRedirectDetails() {} 52 ResourceRedirectDetails::~ResourceRedirectDetails() {}
OLDNEW
« no previous file with comments | « content/browser/renderer_host/resource_dispatcher_host.cc ('k') | content/browser/worker_host/worker_message_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698