OLD | NEW |
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/files/file_util.h" | 9 #include "base/files/file_util.h" |
10 #include "base/memory/shared_memory.h" | 10 #include "base/memory/shared_memory.h" |
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
542 void WidgetRestored() override { widgets_++; } | 542 void WidgetRestored() override { widgets_++; } |
543 void WidgetHidden() override { widgets_--; } | 543 void WidgetHidden() override { widgets_--; } |
544 int VisibleWidgetCount() const override { return widgets_; } | 544 int VisibleWidgetCount() const override { return widgets_; } |
545 | 545 |
546 bool Send(IPC::Message* msg) override { | 546 bool Send(IPC::Message* msg) override { |
547 VisitCountingContext* counting_context = | 547 VisitCountingContext* counting_context = |
548 static_cast<VisitCountingContext*>( | 548 static_cast<VisitCountingContext*>( |
549 GetBrowserContext()); | 549 GetBrowserContext()); |
550 | 550 |
551 if (msg->type() == ChromeViewMsg_VisitedLink_Add::ID) { | 551 if (msg->type() == ChromeViewMsg_VisitedLink_Add::ID) { |
552 PickleIterator iter(*msg); | 552 base::PickleIterator iter(*msg); |
553 std::vector<uint64> fingerprints; | 553 std::vector<uint64> fingerprints; |
554 CHECK(IPC::ReadParam(msg, &iter, &fingerprints)); | 554 CHECK(IPC::ReadParam(msg, &iter, &fingerprints)); |
555 counting_context->CountAddEvent(fingerprints.size()); | 555 counting_context->CountAddEvent(fingerprints.size()); |
556 } else if (msg->type() == ChromeViewMsg_VisitedLink_Reset::ID) { | 556 } else if (msg->type() == ChromeViewMsg_VisitedLink_Reset::ID) { |
557 counting_context->CountResetEvent(); | 557 counting_context->CountResetEvent(); |
558 } else if (msg->type() == ChromeViewMsg_VisitedLink_NewTable::ID) { | 558 } else if (msg->type() == ChromeViewMsg_VisitedLink_NewTable::ID) { |
559 counting_context->CountNewTable(); | 559 counting_context->CountNewTable(); |
560 } | 560 } |
561 | 561 |
562 delete msg; | 562 delete msg; |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
757 content::NotificationService::current()->Notify( | 757 content::NotificationService::current()->Notify( |
758 content::NOTIFICATION_RENDERER_PROCESS_CREATED, | 758 content::NOTIFICATION_RENDERER_PROCESS_CREATED, |
759 content::Source<content::RenderProcessHost>(&different_process_host), | 759 content::Source<content::RenderProcessHost>(&different_process_host), |
760 content::NotificationService::NoDetails()); | 760 content::NotificationService::NoDetails()); |
761 WaitForCoalescense(); | 761 WaitForCoalescense(); |
762 | 762 |
763 EXPECT_EQ(0, different_context.new_table_count()); | 763 EXPECT_EQ(0, different_context.new_table_count()); |
764 } | 764 } |
765 | 765 |
766 } // namespace visitedlink | 766 } // namespace visitedlink |
OLD | NEW |