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

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: Moving checks. 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, GURL(), appcache_completion_callback_);
michaeln 2011/08/31 23:42:08 is it possible to get the actual first_party_url v
marja 2011/09/05 10:42:24 Done.
116 116
117 *defer = true; 117 *defer = true;
118 return true; 118 return true;
119 } 119 }
120 return next_handler_->OnWillStart(request_id, url, defer); 120 return next_handler_->OnWillStart(request_id, url, defer);
121 } 121 }
122 122
123 // We'll let the original event handler provide a buffer, and reuse it for 123 // We'll let the original event handler provide a buffer, and reuse it for
124 // subsequent reads until we're done buffering. 124 // subsequent reads until we're done buffering.
125 bool OfflineResourceHandler::OnWillRead(int request_id, net::IOBuffer** buf, 125 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; 185 DVLOG(1) << "Resume load: this=" << this << ", request id=" << request_id;
186 next_handler_->OnWillStart(request_id, url, &defer); 186 next_handler_->OnWillStart(request_id, url, &defer);
187 if (!defer) 187 if (!defer)
188 rdh_->StartDeferredRequest(process_host_id_, request_id); 188 rdh_->StartDeferredRequest(process_host_id_, request_id);
189 } 189 }
190 190
191 void OfflineResourceHandler::ShowOfflinePage() { 191 void OfflineResourceHandler::ShowOfflinePage() {
192 chromeos::OfflineLoadPage::Show( 192 chromeos::OfflineLoadPage::Show(
193 process_host_id_, render_view_id_, deferred_url_, this); 193 process_host_id_, render_view_id_, deferred_url_, this);
194 } 194 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698