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

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
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.h" 8 #include "content/browser/renderer_host/render_view_host.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::ResourceRequestInfoImpl;
19 using content::WebContents; 20 using content::WebContents;
20 21
21 SSLErrorHandler::SSLErrorHandler(ResourceDispatcherHost* rdh, 22 SSLErrorHandler::SSLErrorHandler(ResourceDispatcherHost* rdh,
22 net::URLRequest* request, 23 net::URLRequest* request,
23 ResourceType::Type resource_type) 24 ResourceType::Type resource_type)
24 : manager_(NULL), 25 : manager_(NULL),
25 request_id_(0, 0), 26 request_id_(0, 0),
26 resource_dispatcher_host_(rdh), 27 resource_dispatcher_host_(rdh),
27 request_url_(request->url()), 28 request_url_(request->url()),
28 resource_type_(resource_type), 29 resource_type_(resource_type),
29 request_has_been_notified_(false) { 30 request_has_been_notified_(false) {
30 DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::UI)); 31 DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::UI));
31 32
32 ResourceDispatcherHostRequestInfo* info = 33 ResourceRequestInfoImpl* info =
33 ResourceDispatcherHost::InfoForRequest(request); 34 ResourceDispatcherHost::InfoForRequest(request);
34 request_id_.child_id = info->child_id(); 35 request_id_.child_id = info->GetChildID();
35 request_id_.request_id = info->request_id(); 36 request_id_.request_id = info->GetRequestID();
36 37
37 if (!ResourceDispatcherHost::RenderViewForRequest(request, 38 if (!info->GetAssociatedRenderView(&render_process_id_, &render_view_id_))
38 &render_process_id_,
39 &render_view_id_))
40 NOTREACHED(); 39 NOTREACHED();
41 40
42 // This makes sure we don't disappear on the IO thread until we've given an 41 // This makes sure we don't disappear on the IO thread until we've given an
43 // answer to the net::URLRequest. 42 // answer to the net::URLRequest.
44 // 43 //
45 // Release in CompleteCancelRequest, CompleteContinueRequest, or 44 // Release in CompleteCancelRequest, CompleteContinueRequest, or
46 // CompleteTakeNoAction. 45 // CompleteTakeNoAction.
47 AddRef(); 46 AddRef();
48 } 47 }
49 48
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 // already have been deleted. 182 // already have been deleted.
184 DCHECK(!request_has_been_notified_); 183 DCHECK(!request_has_been_notified_);
185 if (request_has_been_notified_) 184 if (request_has_been_notified_)
186 return; 185 return;
187 186
188 request_has_been_notified_ = true; 187 request_has_been_notified_ = true;
189 188
190 // We're done with this object on the IO thread. 189 // We're done with this object on the IO thread.
191 Release(); 190 Release();
192 } 191 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698