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

Side by Side Diff: content/browser/ssl/ssl_error_handler.cc

Issue 9580002: Add ResourceRequestInfo. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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 | « content/browser/ssl/ssl_client_auth_handler.cc ('k') | content/browser/ssl/ssl_manager.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/browser/ssl/ssl_error_handler.h" 5 #include "content/browser/ssl/ssl_error_handler.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "content/browser/renderer_host/render_view_host_impl.h" 8 #include "content/browser/renderer_host/render_view_host_impl.h"
9 #include "content/browser/renderer_host/resource_dispatcher_host.h" 9 #include "content/browser/renderer_host/resource_dispatcher_host.h"
10 #include "content/browser/renderer_host/resource_dispatcher_host_request_info.h" 10 #include "content/browser/renderer_host/resource_request_info_impl.h"
11 #include "content/browser/ssl/ssl_cert_error_handler.h" 11 #include "content/browser/ssl/ssl_cert_error_handler.h"
12 #include "content/browser/tab_contents/navigation_controller_impl.h" 12 #include "content/browser/tab_contents/navigation_controller_impl.h"
13 #include "content/browser/tab_contents/tab_contents.h" 13 #include "content/browser/tab_contents/tab_contents.h"
14 #include "content/public/browser/browser_thread.h" 14 #include "content/public/browser/browser_thread.h"
15 #include "net/base/net_errors.h" 15 #include "net/base/net_errors.h"
16 #include "net/url_request/url_request.h" 16 #include "net/url_request/url_request.h"
17 17
18 using content::BrowserThread; 18 using content::BrowserThread;
19 using content::RenderViewHostImpl; 19 using content::RenderViewHostImpl;
20 using content::ResourceRequestInfoImpl;
20 using content::WebContents; 21 using content::WebContents;
21 22
22 SSLErrorHandler::SSLErrorHandler(ResourceDispatcherHost* rdh, 23 SSLErrorHandler::SSLErrorHandler(ResourceDispatcherHost* rdh,
23 net::URLRequest* request, 24 net::URLRequest* request,
24 ResourceType::Type resource_type) 25 ResourceType::Type resource_type)
25 : manager_(NULL), 26 : manager_(NULL),
26 request_id_(0, 0), 27 request_id_(0, 0),
27 resource_dispatcher_host_(rdh), 28 resource_dispatcher_host_(rdh),
28 request_url_(request->url()), 29 request_url_(request->url()),
29 resource_type_(resource_type), 30 resource_type_(resource_type),
30 request_has_been_notified_(false) { 31 request_has_been_notified_(false) {
31 DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::UI)); 32 DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::UI));
32 33
33 ResourceDispatcherHostRequestInfo* info = 34 ResourceRequestInfoImpl* info =
34 ResourceDispatcherHost::InfoForRequest(request); 35 ResourceDispatcherHost::InfoForRequest(request);
35 request_id_.child_id = info->child_id(); 36 request_id_.child_id = info->GetChildID();
36 request_id_.request_id = info->request_id(); 37 request_id_.request_id = info->GetRequestID();
37 38
38 if (!ResourceDispatcherHost::RenderViewForRequest(request, 39 if (!info->GetAssociatedRenderView(&render_process_id_, &render_view_id_))
39 &render_process_id_,
40 &render_view_id_))
41 NOTREACHED(); 40 NOTREACHED();
42 41
43 // This makes sure we don't disappear on the IO thread until we've given an 42 // This makes sure we don't disappear on the IO thread until we've given an
44 // answer to the net::URLRequest. 43 // answer to the net::URLRequest.
45 // 44 //
46 // Release in CompleteCancelRequest, CompleteContinueRequest, or 45 // Release in CompleteCancelRequest, CompleteContinueRequest, or
47 // CompleteTakeNoAction. 46 // CompleteTakeNoAction.
48 AddRef(); 47 AddRef();
49 } 48 }
50 49
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 // already have been deleted. 183 // already have been deleted.
185 DCHECK(!request_has_been_notified_); 184 DCHECK(!request_has_been_notified_);
186 if (request_has_been_notified_) 185 if (request_has_been_notified_)
187 return; 186 return;
188 187
189 request_has_been_notified_ = true; 188 request_has_been_notified_ = true;
190 189
191 // We're done with this object on the IO thread. 190 // We're done with this object on the IO thread.
192 Release(); 191 Release();
193 } 192 }
OLDNEW
« no previous file with comments | « content/browser/ssl/ssl_client_auth_handler.cc ('k') | content/browser/ssl/ssl_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698