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

Side by Side Diff: content/browser/loader/buffered_resource_handler.cc

Issue 153503004: Add logging to CrossSiteResourceHandler and BufferedResourceHandler (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: sync Created 6 years, 10 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 | « no previous file | content/browser/loader/cross_site_resource_handler.h » ('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/loader/buffered_resource_handler.h" 5 #include "content/browser/loader/buffered_resource_handler.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 return UseAlternateNextHandler(handler.Pass()); 326 return UseAlternateNextHandler(handler.Pass());
327 327
328 #if defined(ENABLE_PLUGINS) 328 #if defined(ENABLE_PLUGINS)
329 bool stale; 329 bool stale;
330 bool has_plugin = HasSupportingPlugin(&stale); 330 bool has_plugin = HasSupportingPlugin(&stale);
331 if (stale) { 331 if (stale) {
332 // Refresh the plugins asynchronously. 332 // Refresh the plugins asynchronously.
333 PluginServiceImpl::GetInstance()->GetPlugins( 333 PluginServiceImpl::GetInstance()->GetPlugins(
334 base::Bind(&BufferedResourceHandler::OnPluginsLoaded, 334 base::Bind(&BufferedResourceHandler::OnPluginsLoaded,
335 weak_ptr_factory_.GetWeakPtr())); 335 weak_ptr_factory_.GetWeakPtr()));
336 request()->LogBlockedBy("BufferedResourceHandler");
336 *defer = true; 337 *defer = true;
337 return true; 338 return true;
338 } 339 }
339 if (has_plugin) 340 if (has_plugin)
340 return true; 341 return true;
341 #endif 342 #endif
342 } 343 }
343 344
344 // Install download handler 345 // Install download handler
345 info->set_is_download(true); 346 info->set_is_download(true);
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 if (!next_handler_->OnWillRead(request_id, &buf, &buf_len, bytes_read_)) 464 if (!next_handler_->OnWillRead(request_id, &buf, &buf_len, bytes_read_))
464 return false; 465 return false;
465 466
466 CHECK((buf_len >= bytes_read_) && (bytes_read_ >= 0)); 467 CHECK((buf_len >= bytes_read_) && (bytes_read_ >= 0));
467 memcpy(buf->data(), read_buffer_->data(), bytes_read_); 468 memcpy(buf->data(), read_buffer_->data(), bytes_read_);
468 return true; 469 return true;
469 } 470 }
470 471
471 void BufferedResourceHandler::OnPluginsLoaded( 472 void BufferedResourceHandler::OnPluginsLoaded(
472 const std::vector<WebPluginInfo>& plugins) { 473 const std::vector<WebPluginInfo>& plugins) {
474 request()->LogUnblocked();
473 bool defer = false; 475 bool defer = false;
474 if (!ProcessResponse(&defer)) { 476 if (!ProcessResponse(&defer)) {
475 controller()->Cancel(); 477 controller()->Cancel();
476 } else if (!defer) { 478 } else if (!defer) {
477 controller()->Resume(); 479 controller()->Resume();
478 } 480 }
479 } 481 }
480 482
481 } // namespace content 483 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/loader/cross_site_resource_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698