OLD | NEW |
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 "mojo/services/html_viewer/blink_platform_impl.h" | 5 #include "mojo/services/html_viewer/blink_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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 blink::WebData BlinkPlatformImpl::loadResource(const char* resource) { | 152 blink::WebData BlinkPlatformImpl::loadResource(const char* resource) { |
153 for (size_t i = 0; i < arraysize(kDataResources); ++i) { | 153 for (size_t i = 0; i < arraysize(kDataResources); ++i) { |
154 if (!strcmp(resource, kDataResources[i].name)) { | 154 if (!strcmp(resource, kDataResources[i].name)) { |
155 int length; | 155 int length; |
156 const char* data = | 156 const char* data = |
157 blink_resource_map_.GetResource(kDataResources[i].id, &length); | 157 blink_resource_map_.GetResource(kDataResources[i].id, &length); |
158 CHECK(data != nullptr && length > 0); | 158 CHECK(data != nullptr && length > 0); |
159 return blink::WebData(data, length); | 159 return blink::WebData(data, length); |
160 } | 160 } |
161 } | 161 } |
162 NOTREACHED() << "Requested resource is unavailable!"; | 162 NOTREACHED() << "Requested resource is unavailable: " << resource; |
163 return blink::WebData(); | 163 return blink::WebData(); |
164 } | 164 } |
165 | 165 |
166 blink::WebURLLoader* BlinkPlatformImpl::createURLLoader() { | 166 blink::WebURLLoader* BlinkPlatformImpl::createURLLoader() { |
167 return NULL; | 167 return NULL; |
168 } | 168 } |
169 | 169 |
170 blink::WebSocketHandle* BlinkPlatformImpl::createWebSocketHandle() { | 170 blink::WebSocketHandle* BlinkPlatformImpl::createWebSocketHandle() { |
171 return NULL; | 171 return NULL; |
172 } | 172 } |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 } | 240 } |
241 | 241 |
242 // static | 242 // static |
243 void BlinkPlatformImpl::DestroyCurrentThread(void* thread) { | 243 void BlinkPlatformImpl::DestroyCurrentThread(void* thread) { |
244 WebThreadImplForMessageLoop* impl = | 244 WebThreadImplForMessageLoop* impl = |
245 static_cast<WebThreadImplForMessageLoop*>(thread); | 245 static_cast<WebThreadImplForMessageLoop*>(thread); |
246 delete impl; | 246 delete impl; |
247 } | 247 } |
248 | 248 |
249 } // namespace html_viewer | 249 } // namespace html_viewer |
OLD | NEW |