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

Side by Side Diff: sky/viewer/platform/platform_impl.cc

Issue 691623003: Remove Platform::parseDataURL (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/viewer/platform/platform_impl.h ('k') | no next file » | 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/viewer/platform/platform_impl.h" 5 #include "sky/viewer/platform/platform_impl.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/rand_util.h" 10 #include "base/rand_util.h"
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 } 137 }
138 138
139 mojo::NetworkService* PlatformImpl::networkService() { 139 mojo::NetworkService* PlatformImpl::networkService() {
140 return network_service_.get(); 140 return network_service_.get();
141 } 141 }
142 142
143 blink::WebURLLoader* PlatformImpl::createURLLoader() { 143 blink::WebURLLoader* PlatformImpl::createURLLoader() {
144 return new WebURLLoaderImpl(network_service_.get()); 144 return new WebURLLoaderImpl(network_service_.get());
145 } 145 }
146 146
147 blink::WebData PlatformImpl::parseDataURL(
148 const blink::WebURL& url,
149 blink::WebString& mimetype_out,
150 blink::WebString& charset_out) {
151 std::string mimetype, charset, data;
152 if (net::DataURL::Parse(url, &mimetype, &charset, &data)
153 && net::IsSupportedMimeType(mimetype)) {
154 mimetype_out = blink::WebString::fromUTF8(mimetype);
155 charset_out = blink::WebString::fromUTF8(charset);
156 return data;
157 }
158 return blink::WebData();
159 }
160
161 blink::WebURLError PlatformImpl::cancelledError(const blink::WebURL& url) 147 blink::WebURLError PlatformImpl::cancelledError(const blink::WebURL& url)
162 const { 148 const {
163 blink::WebURLError error; 149 blink::WebURLError error;
164 error.domain = blink::WebString::fromUTF8(net::kErrorDomain); 150 error.domain = blink::WebString::fromUTF8(net::kErrorDomain);
165 error.reason = net::ERR_ABORTED; 151 error.reason = net::ERR_ABORTED;
166 error.unreachableURL = url; 152 error.unreachableURL = url;
167 error.staleCopyInCache = false; 153 error.staleCopyInCache = false;
168 error.isCancellation = true; 154 error.isCancellation = true;
169 return error; 155 return error;
170 } 156 }
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 const unsigned char* category_group_enabled, 239 const unsigned char* category_group_enabled,
254 const char* name, 240 const char* name,
255 TraceEventHandle handle) { 241 TraceEventHandle handle) {
256 base::debug::TraceEventHandle traceEventHandle; 242 base::debug::TraceEventHandle traceEventHandle;
257 memcpy(&traceEventHandle, &handle, sizeof(handle)); 243 memcpy(&traceEventHandle, &handle, sizeof(handle));
258 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION( 244 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION(
259 category_group_enabled, name, traceEventHandle); 245 category_group_enabled, name, traceEventHandle);
260 } 246 }
261 247
262 } // namespace sky 248 } // namespace sky
OLDNEW
« no previous file with comments | « sky/viewer/platform/platform_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698