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

Side by Side Diff: components/html_viewer/web_test_delegate_impl.cc

Issue 1309423004: Introduce WebTaskRunner Patch 4/5 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Try and fix compile Created 5 years, 3 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
« no previous file with comments | « no previous file | components/scheduler/child/web_scheduler_impl.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/html_viewer/web_test_delegate_impl.h" 5 #include "components/html_viewer/web_test_delegate_impl.h"
6 6
7 #include "base/time/time.h" 7 #include "base/time/time.h"
8 #include "cc/layers/texture_layer.h" 8 #include "cc/layers/texture_layer.h"
9 #include "components/test_runner/web_task.h" 9 #include "components/test_runner/web_task.h"
10 #include "components/test_runner/web_test_interfaces.h" 10 #include "components/test_runner/web_test_interfaces.h"
11 #include "components/test_runner/web_test_proxy.h" 11 #include "components/test_runner/web_test_proxy.h"
12 #include "third_party/WebKit/public/platform/Platform.h" 12 #include "third_party/WebKit/public/platform/Platform.h"
13 #include "third_party/WebKit/public/platform/WebString.h" 13 #include "third_party/WebKit/public/platform/WebString.h"
14 #include "third_party/WebKit/public/platform/WebTaskRunner.h"
14 #include "third_party/WebKit/public/platform/WebThread.h" 15 #include "third_party/WebKit/public/platform/WebThread.h"
15 #include "third_party/WebKit/public/platform/WebTraceLocation.h" 16 #include "third_party/WebKit/public/platform/WebTraceLocation.h"
16 #include "third_party/WebKit/public/platform/WebURL.h" 17 #include "third_party/WebKit/public/platform/WebURL.h"
17 #include "url/gurl.h" 18 #include "url/gurl.h"
18 19
19 namespace html_viewer { 20 namespace html_viewer {
20 21
21 namespace { 22 namespace {
22 23
23 class InvokeTaskHelper : public blink::WebThread::Task { 24 class InvokeTaskHelper : public blink::WebTaskRunner::Task {
24 public: 25 public:
25 InvokeTaskHelper(scoped_ptr<test_runner::WebTask> task) 26 InvokeTaskHelper(scoped_ptr<test_runner::WebTask> task)
26 : task_(task.Pass()) {} 27 : task_(task.Pass()) {}
27 28
28 // WebThread::Task implementation: 29 // WebThread::Task implementation:
29 void run() override { task_->run(); } 30 void run() override { task_->run(); }
30 31
31 private: 32 private:
32 scoped_ptr<test_runner::WebTask> task_; 33 scoped_ptr<test_runner::WebTask> task_;
33 }; 34 };
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 void WebTestDelegateImpl::DidChangeBatteryStatus( 82 void WebTestDelegateImpl::DidChangeBatteryStatus(
82 const blink::WebBatteryStatus& status) { 83 const blink::WebBatteryStatus& status) {
83 NOTIMPLEMENTED(); 84 NOTIMPLEMENTED();
84 } 85 }
85 86
86 void WebTestDelegateImpl::PrintMessage(const std::string& message) { 87 void WebTestDelegateImpl::PrintMessage(const std::string& message) {
87 fprintf(stderr, "%s", message.c_str()); 88 fprintf(stderr, "%s", message.c_str());
88 } 89 }
89 90
90 void WebTestDelegateImpl::PostTask(test_runner::WebTask* task) { 91 void WebTestDelegateImpl::PostTask(test_runner::WebTask* task) {
91 blink::Platform::current()->currentThread()->postTask( 92 blink::Platform::current()->currentThread()->taskRunner()->postTask(
92 blink::WebTraceLocation(__FUNCTION__, __FILE__), 93 blink::WebTraceLocation(__FUNCTION__, __FILE__),
93 new InvokeTaskHelper(make_scoped_ptr(task))); 94 new InvokeTaskHelper(make_scoped_ptr(task)));
94 } 95 }
95 96
96 void WebTestDelegateImpl::PostDelayedTask(test_runner::WebTask* task, 97 void WebTestDelegateImpl::PostDelayedTask(test_runner::WebTask* task,
97 long long ms) { 98 long long ms) {
98 blink::Platform::current()->currentThread()->postDelayedTask( 99 blink::Platform::current()->currentThread()->taskRunner()->postDelayedTask(
99 blink::WebTraceLocation(__FUNCTION__, __FILE__), 100 blink::WebTraceLocation(__FUNCTION__, __FILE__),
100 new InvokeTaskHelper(make_scoped_ptr(task)), ms); 101 new InvokeTaskHelper(make_scoped_ptr(task)), ms);
101 } 102 }
102 103
103 blink::WebString WebTestDelegateImpl::RegisterIsolatedFileSystem( 104 blink::WebString WebTestDelegateImpl::RegisterIsolatedFileSystem(
104 const blink::WebVector<blink::WebString>& absolute_filenames) { 105 const blink::WebVector<blink::WebString>& absolute_filenames) {
105 NOTIMPLEMENTED(); 106 NOTIMPLEMENTED();
106 return blink::WebString(); 107 return blink::WebString();
107 } 108 }
108 109
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 } 327 }
327 328
328 void WebTestDelegateImpl::OnWebTestProxyBaseDestroy( 329 void WebTestDelegateImpl::OnWebTestProxyBaseDestroy(
329 test_runner::WebTestProxyBase* base) { 330 test_runner::WebTestProxyBase* base) {
330 DCHECK_EQ(proxy_, base); 331 DCHECK_EQ(proxy_, base);
331 dump_tree_ = proxy_->CaptureTree(false, false); 332 dump_tree_ = proxy_->CaptureTree(false, false);
332 proxy_ = nullptr; 333 proxy_ = nullptr;
333 } 334 }
334 335
335 } // namespace html_viewer 336 } // namespace html_viewer
OLDNEW
« no previous file with comments | « no previous file | components/scheduler/child/web_scheduler_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698