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

Side by Side Diff: sky/engine/testing/platform/platform_impl.cc

Issue 691493004: Remove callOnMainThread (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 | « sky/engine/testing/platform/platform_impl.h ('k') | sky/engine/web/Sky.cpp » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "sky/engine/testing/platform/platform_impl.h" 5 #include "sky/engine/testing/platform/platform_impl.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "base/rand_util.h" 9 #include "base/rand_util.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 79
80 shared_timer_.Stop(); 80 shared_timer_.Stop();
81 shared_timer_.Start(FROM_HERE, base::TimeDelta::FromMicroseconds(interval), 81 shared_timer_.Start(FROM_HERE, base::TimeDelta::FromMicroseconds(interval),
82 this, &PlatformImpl::DoTimeout); 82 this, &PlatformImpl::DoTimeout);
83 } 83 }
84 84
85 void PlatformImpl::stopSharedTimer() { 85 void PlatformImpl::stopSharedTimer() {
86 shared_timer_.Stop(); 86 shared_timer_.Stop();
87 } 87 }
88 88
89 void PlatformImpl::callOnMainThread(
90 void (*func)(void*), void* context) {
91 main_loop_->PostTask(FROM_HERE, base::Bind(func, context));
92 }
93
94 blink::WebUnitTestSupport* PlatformImpl::unitTestSupport() { 89 blink::WebUnitTestSupport* PlatformImpl::unitTestSupport() {
95 return &unit_test_support_; 90 return &unit_test_support_;
96 } 91 }
97 92
98 blink::WebScrollbarBehavior* PlatformImpl::scrollbarBehavior() { 93 blink::WebScrollbarBehavior* PlatformImpl::scrollbarBehavior() {
99 return &scrollbar_behavior_; 94 return &scrollbar_behavior_;
100 } 95 }
101 96
102 const unsigned char* PlatformImpl::getTraceCategoryEnabledFlag( 97 const unsigned char* PlatformImpl::getTraceCategoryEnabledFlag(
103 const char* category_name) { 98 const char* category_name) {
104 static const unsigned char buf[] = "*"; 99 static const unsigned char buf[] = "*";
105 return buf; 100 return buf;
106 } 101 }
107 102
108 blink::WebData PlatformImpl::parseDataURL( 103 blink::WebData PlatformImpl::parseDataURL(
109 const blink::WebURL& url, 104 const blink::WebURL& url,
110 blink::WebString& mimetype_out, 105 blink::WebString& mimetype_out,
111 blink::WebString& charset_out) { 106 blink::WebString& charset_out) {
112 std::string mimetype, charset, data; 107 std::string mimetype, charset, data;
113 if (net::DataURL::Parse(url, &mimetype, &charset, &data) 108 if (net::DataURL::Parse(url, &mimetype, &charset, &data)
114 && net::IsSupportedMimeType(mimetype)) { 109 && net::IsSupportedMimeType(mimetype)) {
115 mimetype_out = blink::WebString::fromUTF8(mimetype); 110 mimetype_out = blink::WebString::fromUTF8(mimetype);
116 charset_out = blink::WebString::fromUTF8(charset); 111 charset_out = blink::WebString::fromUTF8(charset);
117 return data; 112 return data;
118 } 113 }
119 return blink::WebData(); 114 return blink::WebData();
120 } 115 }
121 116
122 } // namespace sky 117 } // namespace sky
OLDNEW
« no previous file with comments | « sky/engine/testing/platform/platform_impl.h ('k') | sky/engine/web/Sky.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698