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

Side by Side Diff: chrome/browser/renderer_host/offline_resource_handler.cc

Issue 7720022: Third-party appcache blocking. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Keeping up to date with trunk. Created 9 years, 3 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 "chrome/browser/renderer_host/offline_resource_handler.h" 5 #include "chrome/browser/renderer_host/offline_resource_handler.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/singleton.h" 10 #include "base/memory/singleton.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 deferred_request_id_ = request_id; 105 deferred_request_id_ = request_id;
106 deferred_url_ = url; 106 deferred_url_ = url;
107 DVLOG(1) << "OnWillStart: this=" << this << ", request id=" << request_id 107 DVLOG(1) << "OnWillStart: this=" << this << ", request id=" << request_id
108 << ", url=" << url; 108 << ", url=" << url;
109 AddRef(); // Balanced with OnCanHandleOfflineComplete 109 AddRef(); // Balanced with OnCanHandleOfflineComplete
110 DCHECK(!appcache_completion_callback_); 110 DCHECK(!appcache_completion_callback_);
111 appcache_completion_callback_ = 111 appcache_completion_callback_ =
112 new net::CancelableCompletionCallback<OfflineResourceHandler>( 112 new net::CancelableCompletionCallback<OfflineResourceHandler>(
113 this, &OfflineResourceHandler::OnCanHandleOfflineComplete); 113 this, &OfflineResourceHandler::OnCanHandleOfflineComplete);
114 appcache_service_->CanHandleMainResourceOffline( 114 appcache_service_->CanHandleMainResourceOffline(
115 url, appcache_completion_callback_); 115 url, request_->first_party_for_cookies(),
116 appcache_completion_callback_);
116 117
117 *defer = true; 118 *defer = true;
118 return true; 119 return true;
119 } 120 }
120 return next_handler_->OnWillStart(request_id, url, defer); 121 return next_handler_->OnWillStart(request_id, url, defer);
121 } 122 }
122 123
123 // We'll let the original event handler provide a buffer, and reuse it for 124 // We'll let the original event handler provide a buffer, and reuse it for
124 // subsequent reads until we're done buffering. 125 // subsequent reads until we're done buffering.
125 bool OfflineResourceHandler::OnWillRead(int request_id, net::IOBuffer** buf, 126 bool OfflineResourceHandler::OnWillRead(int request_id, net::IOBuffer** buf,
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 DVLOG(1) << "Resume load: this=" << this << ", request id=" << request_id; 186 DVLOG(1) << "Resume load: this=" << this << ", request id=" << request_id;
186 next_handler_->OnWillStart(request_id, url, &defer); 187 next_handler_->OnWillStart(request_id, url, &defer);
187 if (!defer) 188 if (!defer)
188 rdh_->StartDeferredRequest(process_host_id_, request_id); 189 rdh_->StartDeferredRequest(process_host_id_, request_id);
189 } 190 }
190 191
191 void OfflineResourceHandler::ShowOfflinePage() { 192 void OfflineResourceHandler::ShowOfflinePage() {
192 chromeos::OfflineLoadPage::Show( 193 chromeos::OfflineLoadPage::Show(
193 process_host_id_, render_view_id_, deferred_url_, this); 194 process_host_id_, render_view_id_, deferred_url_, this);
194 } 195 }
OLDNEW
« no previous file with comments | « chrome/browser/chrome_content_browser_client.cc ('k') | content/browser/appcache/chrome_appcache_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698