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

Side by Side Diff: chrome/browser/visitedlink/visitedlink_unittest.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
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 <cstdio> 5 #include <cstdio>
6 #include <string> 6 #include <string>
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after
519 virtual void WidgetRestored() OVERRIDE { widgets_++; } 519 virtual void WidgetRestored() OVERRIDE { widgets_++; }
520 virtual void WidgetHidden() OVERRIDE { widgets_--; } 520 virtual void WidgetHidden() OVERRIDE { widgets_--; }
521 virtual int VisibleWidgetCount() const OVERRIDE { return widgets_; } 521 virtual int VisibleWidgetCount() const OVERRIDE { return widgets_; }
522 522
523 virtual bool Send(IPC::Message* msg) OVERRIDE { 523 virtual bool Send(IPC::Message* msg) OVERRIDE {
524 VisitCountingProfile* counting_profile = 524 VisitCountingProfile* counting_profile =
525 static_cast<VisitCountingProfile*>( 525 static_cast<VisitCountingProfile*>(
526 Profile::FromBrowserContext(GetBrowserContext())); 526 Profile::FromBrowserContext(GetBrowserContext()));
527 527
528 if (msg->type() == ChromeViewMsg_VisitedLink_Add::ID) { 528 if (msg->type() == ChromeViewMsg_VisitedLink_Add::ID) {
529 void* iter = NULL; 529 PickleIterator iter(*msg);
530 std::vector<uint64> fingerprints; 530 std::vector<uint64> fingerprints;
531 CHECK(IPC::ReadParam(msg, &iter, &fingerprints)); 531 CHECK(IPC::ReadParam(msg, &iter, &fingerprints));
532 counting_profile->CountAddEvent(fingerprints.size()); 532 counting_profile->CountAddEvent(fingerprints.size());
533 } else if (msg->type() == ChromeViewMsg_VisitedLink_Reset::ID) { 533 } else if (msg->type() == ChromeViewMsg_VisitedLink_Reset::ID) {
534 counting_profile->CountResetEvent(); 534 counting_profile->CountResetEvent();
535 } 535 }
536 536
537 delete msg; 537 delete msg;
538 return true; 538 return true;
539 } 539 }
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
709 EXPECT_EQ(1, profile()->add_event_count()); 709 EXPECT_EQ(1, profile()->add_event_count());
710 EXPECT_EQ(0, profile()->reset_event_count()); 710 EXPECT_EQ(0, profile()->reset_event_count());
711 711
712 // Activate the tab. 712 // Activate the tab.
713 rvh()->WasRestored(); 713 rvh()->WasRestored();
714 714
715 // We should have only one more reset event. 715 // We should have only one more reset event.
716 EXPECT_EQ(1, profile()->add_event_count()); 716 EXPECT_EQ(1, profile()->add_event_count());
717 EXPECT_EQ(1, profile()->reset_event_count()); 717 EXPECT_EQ(1, profile()->reset_event_count());
718 } 718 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/extensions/browser_action_drag_data.cc ('k') | chrome/common/automation_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698