| 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 "chrome/renderer/safe_browsing/phishing_classifier_delegate.h" | 5 #include "chrome/renderer/safe_browsing/phishing_classifier_delegate.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 content::BrowserThread::PostTask( | 139 content::BrowserThread::PostTask( |
| 140 content::BrowserThread::UI, FROM_HERE, runner_->QuitClosure()); | 140 content::BrowserThread::UI, FROM_HERE, runner_->QuitClosure()); |
| 141 } | 141 } |
| 142 } | 142 } |
| 143 | 143 |
| 144 protected: | 144 protected: |
| 145 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 145 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
| 146 command_line->AppendSwitch(switches::kSingleProcess); | 146 command_line->AppendSwitch(switches::kSingleProcess); |
| 147 #if defined(OS_WIN) | 147 #if defined(OS_WIN) |
| 148 // Don't want to try to create a GPU process. | 148 // Don't want to try to create a GPU process. |
| 149 command_line->AppendSwitch(switches::kDisableAcceleratedCompositing); | 149 command_line->AppendSwitch(switches::kDisableGpu); |
| 150 #endif | 150 #endif |
| 151 } | 151 } |
| 152 | 152 |
| 153 virtual void SetUpOnMainThread() OVERRIDE { | 153 virtual void SetUpOnMainThread() OVERRIDE { |
| 154 intercepting_filter_ = new InterceptingMessageFilter(); | 154 intercepting_filter_ = new InterceptingMessageFilter(); |
| 155 content::RenderView* render_view = | 155 content::RenderView* render_view = |
| 156 content::RenderView::FromRoutingID(kRenderViewRoutingId); | 156 content::RenderView::FromRoutingID(kRenderViewRoutingId); |
| 157 | 157 |
| 158 GetWebContents()->GetRenderProcessHost()->AddFilter( | 158 GetWebContents()->GetRenderProcessHost()->AddFilter( |
| 159 intercepting_filter_.get()); | 159 intercepting_filter_.get()); |
| (...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 626 RunClassificationDone(verdict); | 626 RunClassificationDone(verdict); |
| 627 ASSERT_TRUE(intercepting_filter_->verdict()); | 627 ASSERT_TRUE(intercepting_filter_->verdict()); |
| 628 EXPECT_EQ(verdict.SerializeAsString(), | 628 EXPECT_EQ(verdict.SerializeAsString(), |
| 629 intercepting_filter_->verdict()->SerializeAsString()); | 629 intercepting_filter_->verdict()->SerializeAsString()); |
| 630 | 630 |
| 631 // The delegate will cancel pending classification on destruction. | 631 // The delegate will cancel pending classification on destruction. |
| 632 EXPECT_CALL(*classifier_, CancelPendingClassification()); | 632 EXPECT_CALL(*classifier_, CancelPendingClassification()); |
| 633 } | 633 } |
| 634 | 634 |
| 635 } // namespace safe_browsing | 635 } // namespace safe_browsing |
| OLD | NEW |