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

Side by Side Diff: mojo/services/html_viewer/blink_platform_impl.cc

Issue 1038723002: Reland part 3 of 4: Modify blink users so they use blink images. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use 'const unsigned char' for resources. Created 5 years, 9 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
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 "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/command_line.h" 9 #include "base/command_line.h"
10 #include "base/rand_util.h" 10 #include "base/rand_util.h"
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 const unsigned char* BlinkPlatformImpl::getTraceCategoryEnabledFlag( 150 const unsigned char* BlinkPlatformImpl::getTraceCategoryEnabledFlag(
151 const char* category_name) { 151 const char* category_name) {
152 static const unsigned char buf[] = "*"; 152 static const unsigned char buf[] = "*";
153 return buf; 153 return buf;
154 } 154 }
155 155
156 blink::WebData BlinkPlatformImpl::loadResource(const char* resource) { 156 blink::WebData BlinkPlatformImpl::loadResource(const char* resource) {
157 for (size_t i = 0; i < arraysize(kDataResources); ++i) { 157 for (size_t i = 0; i < arraysize(kDataResources); ++i) {
158 if (!strcmp(resource, kDataResources[i].name)) { 158 if (!strcmp(resource, kDataResources[i].name)) {
159 int length; 159 int length;
160 const char* data = 160 const unsigned char* data =
161 blink_resource_map_.GetResource(kDataResources[i].id, &length); 161 blink_resource_map_.GetResource(kDataResources[i].id, &length);
162 CHECK(data != nullptr && length > 0); 162 CHECK(data != nullptr && length > 0);
163 return blink::WebData(data, length); 163 return blink::WebData(reinterpret_cast<const char*>(data), length);
164 } 164 }
165 } 165 }
166 NOTREACHED() << "Requested resource is unavailable: " << resource; 166 NOTREACHED() << "Requested resource is unavailable: " << resource;
167 return blink::WebData(); 167 return blink::WebData();
168 } 168 }
169 169
170 blink::WebURLLoader* BlinkPlatformImpl::createURLLoader() { 170 blink::WebURLLoader* BlinkPlatformImpl::createURLLoader() {
171 return NULL; 171 return NULL;
172 } 172 }
173 173
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 } 249 }
250 250
251 // static 251 // static
252 void BlinkPlatformImpl::DestroyCurrentThread(void* thread) { 252 void BlinkPlatformImpl::DestroyCurrentThread(void* thread) {
253 WebThreadImplForMessageLoop* impl = 253 WebThreadImplForMessageLoop* impl =
254 static_cast<WebThreadImplForMessageLoop*>(thread); 254 static_cast<WebThreadImplForMessageLoop*>(thread);
255 delete impl; 255 delete impl;
256 } 256 }
257 257
258 } // namespace html_viewer 258 } // namespace html_viewer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698