OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/renderer_host/safe_browsing_resource_handler.h" | 5 #include "chrome/browser/renderer_host/safe_browsing_resource_handler.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" | 8 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" |
9 #include "chrome/browser/renderer_host/resource_message_filter.h" | 9 #include "chrome/browser/renderer_host/resource_message_filter.h" |
10 #include "chrome/common/notification_service.h" | 10 #include "chrome/common/notification_service.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 Source<ResourceMessageFilter>( | 40 Source<ResourceMessageFilter>( |
41 static_cast<ResourceMessageFilter*>(receiver))); | 41 static_cast<ResourceMessageFilter*>(receiver))); |
42 } | 42 } |
43 | 43 |
44 SafeBrowsingResourceHandler::~SafeBrowsingResourceHandler() { | 44 SafeBrowsingResourceHandler::~SafeBrowsingResourceHandler() { |
45 } | 45 } |
46 | 46 |
47 bool SafeBrowsingResourceHandler::OnUploadProgress(int request_id, | 47 bool SafeBrowsingResourceHandler::OnUploadProgress(int request_id, |
48 uint64 position, | 48 uint64 position, |
49 uint64 size) { | 49 uint64 size) { |
50 CHECK(state_ == STATE_NONE); | |
51 CHECK(defer_state_ = DEFERRED_NONE); | |
52 return next_handler_->OnUploadProgress(request_id, position, size); | 50 return next_handler_->OnUploadProgress(request_id, position, size); |
53 } | 51 } |
54 | 52 |
55 bool SafeBrowsingResourceHandler::OnRequestRedirected( | 53 bool SafeBrowsingResourceHandler::OnRequestRedirected( |
56 int request_id, | 54 int request_id, |
57 const GURL& new_url, | 55 const GURL& new_url, |
58 ResourceResponse* response, | 56 ResourceResponse* response, |
59 bool* defer) { | 57 bool* defer) { |
60 CHECK(state_ == STATE_NONE); | 58 CHECK(state_ == STATE_NONE); |
61 CHECK(defer_state_ == DEFERRED_NONE); | 59 CHECK(defer_state_ == DEFERRED_NONE); |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 rdh_->FollowDeferredRedirect(render_process_host_id_, request_id, | 292 rdh_->FollowDeferredRedirect(render_process_host_id_, request_id, |
295 false, GURL()); | 293 false, GURL()); |
296 } | 294 } |
297 } | 295 } |
298 | 296 |
299 void SafeBrowsingResourceHandler::ClearDeferredRequestInfo() { | 297 void SafeBrowsingResourceHandler::ClearDeferredRequestInfo() { |
300 deferred_request_id_ = -1; | 298 deferred_request_id_ = -1; |
301 deferred_url_ = GURL(); | 299 deferred_url_ = GURL(); |
302 deferred_redirect_response_ = NULL; | 300 deferred_redirect_response_ = NULL; |
303 } | 301 } |
OLD | NEW |