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

Side by Side Diff: chrome/browser/visitedlink/visitedlink_unittest.cc

Issue 7492051: Revert 94332 - Removal of Profile from content part 2. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 5 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 <vector> 5 #include <vector>
6 #include <string> 6 #include <string>
7 #include <cstdio> 7 #include <cstdio>
8 8
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after
517 } 517 }
518 518
519 virtual bool WaitForPaintMsg(int render_widget_id, 519 virtual bool WaitForPaintMsg(int render_widget_id,
520 const base::TimeDelta& max_delay, 520 const base::TimeDelta& max_delay,
521 IPC::Message* msg) { 521 IPC::Message* msg) {
522 return false; 522 return false;
523 } 523 }
524 524
525 virtual bool Send(IPC::Message* msg) { 525 virtual bool Send(IPC::Message* msg) {
526 VisitCountingProfile* counting_profile = 526 VisitCountingProfile* counting_profile =
527 static_cast<VisitCountingProfile*>( 527 static_cast<VisitCountingProfile*>(profile());
528 Profile::FromBrowserContext(browser_context()));
529 528
530 if (msg->type() == ViewMsg_VisitedLink_Add::ID) { 529 if (msg->type() == ViewMsg_VisitedLink_Add::ID) {
531 void* iter = NULL; 530 void* iter = NULL;
532 std::vector<uint64> fingerprints; 531 std::vector<uint64> fingerprints;
533 CHECK(IPC::ReadParam(msg, &iter, &fingerprints)); 532 CHECK(IPC::ReadParam(msg, &iter, &fingerprints));
534 counting_profile->CountAddEvent(fingerprints.size()); 533 counting_profile->CountAddEvent(fingerprints.size());
535 } else if (msg->type() == ViewMsg_VisitedLink_Reset::ID) { 534 } else if (msg->type() == ViewMsg_VisitedLink_Reset::ID) {
536 counting_profile->CountResetEvent(); 535 counting_profile->CountResetEvent();
537 } 536 }
538 537
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
720 EXPECT_EQ(1, profile()->add_event_count()); 719 EXPECT_EQ(1, profile()->add_event_count());
721 EXPECT_EQ(0, profile()->reset_event_count()); 720 EXPECT_EQ(0, profile()->reset_event_count());
722 721
723 // Activate the tab. 722 // Activate the tab.
724 rvh()->WasRestored(); 723 rvh()->WasRestored();
725 724
726 // We should have only one more reset event. 725 // We should have only one more reset event.
727 EXPECT_EQ(1, profile()->add_event_count()); 726 EXPECT_EQ(1, profile()->add_event_count());
728 EXPECT_EQ(1, profile()->reset_event_count()); 727 EXPECT_EQ(1, profile()->reset_event_count());
729 } 728 }
OLDNEW
« no previous file with comments | « chrome/browser/visitedlink/visitedlink_event_listener.cc ('k') | content/browser/browsing_instance.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698