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

Side by Side Diff: chrome/browser/automation/url_request_automation_job.cc

Issue 9447084: Refactor Pickle Read methods to use higher performance PickleIterator. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: compile (racing with incoming CLs) 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
« no previous file with comments | « base/pickle_unittest.cc ('k') | chrome/browser/bookmarks/bookmark_node_data.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 "chrome/browser/automation/url_request_automation_job.h" 5 #include "chrome/browser/automation/url_request_automation_job.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/time.h" 10 #include "base/time.h"
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 net::HostPortPair URLRequestAutomationJob::GetSocketAddress() const { 246 net::HostPortPair URLRequestAutomationJob::GetSocketAddress() const {
247 return socket_address_; 247 return socket_address_;
248 } 248 }
249 249
250 bool URLRequestAutomationJob::MayFilterMessage(const IPC::Message& message, 250 bool URLRequestAutomationJob::MayFilterMessage(const IPC::Message& message,
251 int* request_id) { 251 int* request_id) {
252 switch (message.type()) { 252 switch (message.type()) {
253 case AutomationMsg_RequestStarted::ID: 253 case AutomationMsg_RequestStarted::ID:
254 case AutomationMsg_RequestData::ID: 254 case AutomationMsg_RequestData::ID:
255 case AutomationMsg_RequestEnd::ID: { 255 case AutomationMsg_RequestEnd::ID: {
256 void* iter = NULL; 256 PickleIterator iter(message);
257 if (message.ReadInt(&iter, request_id)) 257 if (message.ReadInt(&iter, request_id))
258 return true; 258 return true;
259 break; 259 break;
260 } 260 }
261 } 261 }
262 262
263 return false; 263 return false;
264 } 264 }
265 265
266 void URLRequestAutomationJob::OnMessage(const IPC::Message& message) { 266 void URLRequestAutomationJob::OnMessage(const IPC::Message& message) {
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 if (!is_done()) { 489 if (!is_done()) {
490 NotifyDone(request_status_); 490 NotifyDone(request_status_);
491 } 491 }
492 // Reset any pending reads. 492 // Reset any pending reads.
493 if (pending_buf_) { 493 if (pending_buf_) {
494 pending_buf_ = NULL; 494 pending_buf_ = NULL;
495 pending_buf_size_ = 0; 495 pending_buf_size_ = 0;
496 NotifyReadComplete(0); 496 NotifyReadComplete(0);
497 } 497 }
498 } 498 }
OLDNEW
« no previous file with comments | « base/pickle_unittest.cc ('k') | chrome/browser/bookmarks/bookmark_node_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698