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

Side by Side Diff: webkit/glue/webkitplatformsupport_impl.cc

Issue 16096016: Expose parseDataURL to Platform (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add names to params like a real Chrome engineer Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « webkit/glue/webkitplatformsupport_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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "webkit/glue/webkitplatformsupport_impl.h" 5 #include "webkit/glue/webkitplatformsupport_impl.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 10 matching lines...) Expand all
21 #include "base/rand_util.h" 21 #include "base/rand_util.h"
22 #include "base/string_util.h" 22 #include "base/string_util.h"
23 #include "base/strings/string_number_conversions.h" 23 #include "base/strings/string_number_conversions.h"
24 #include "base/synchronization/lock.h" 24 #include "base/synchronization/lock.h"
25 #include "base/sys_info.h" 25 #include "base/sys_info.h"
26 #include "base/time.h" 26 #include "base/time.h"
27 #include "base/utf_string_conversions.h" 27 #include "base/utf_string_conversions.h"
28 #include "grit/webkit_chromium_resources.h" 28 #include "grit/webkit_chromium_resources.h"
29 #include "grit/webkit_resources.h" 29 #include "grit/webkit_resources.h"
30 #include "grit/webkit_strings.h" 30 #include "grit/webkit_strings.h"
31 #include "net/base/data_url.h"
32 #include "net/base/mime_util.h"
31 #include "net/base/net_errors.h" 33 #include "net/base/net_errors.h"
32 #include "third_party/WebKit/public/platform/WebCookie.h" 34 #include "third_party/WebKit/public/platform/WebCookie.h"
33 #include "third_party/WebKit/public/platform/WebData.h" 35 #include "third_party/WebKit/public/platform/WebData.h"
34 #include "third_party/WebKit/public/platform/WebDiscardableMemory.h" 36 #include "third_party/WebKit/public/platform/WebDiscardableMemory.h"
35 #include "third_party/WebKit/public/platform/WebGestureCurve.h" 37 #include "third_party/WebKit/public/platform/WebGestureCurve.h"
36 #include "third_party/WebKit/public/platform/WebPluginListBuilder.h" 38 #include "third_party/WebKit/public/platform/WebPluginListBuilder.h"
37 #include "third_party/WebKit/public/platform/WebString.h" 39 #include "third_party/WebKit/public/platform/WebString.h"
38 #include "third_party/WebKit/public/platform/WebURL.h" 40 #include "third_party/WebKit/public/platform/WebURL.h"
39 #include "third_party/WebKit/public/platform/WebVector.h" 41 #include "third_party/WebKit/public/platform/WebVector.h"
40 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrameClient.h" 42 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrameClient.h"
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 } 398 }
397 399
398 WebSocketStreamHandle* WebKitPlatformSupportImpl::createSocketStreamHandle() { 400 WebSocketStreamHandle* WebKitPlatformSupportImpl::createSocketStreamHandle() {
399 return new WebSocketStreamHandleImpl(this); 401 return new WebSocketStreamHandleImpl(this);
400 } 402 }
401 403
402 WebString WebKitPlatformSupportImpl::userAgent(const WebURL& url) { 404 WebString WebKitPlatformSupportImpl::userAgent(const WebURL& url) {
403 return WebString::fromUTF8(webkit_glue::GetUserAgent(url)); 405 return WebString::fromUTF8(webkit_glue::GetUserAgent(url));
404 } 406 }
405 407
408 WebData WebKitPlatformSupportImpl::parseDataURL(
409 const WebURL& url,
410 WebString& mimetype_out,
411 WebString& charset_out) {
412 std::string mime_type, char_set, data;
413 if (net::DataURL::Parse(url, &mime_type, &char_set, &data)
414 && net::IsSupportedMimeType(mime_type)) {
415 mimetype_out = WebString::fromUTF8(mime_type);
416 charset_out = WebString::fromUTF8(char_set);
417 return data;
418 }
419 return WebData();
420 }
421
406 WebURLError WebKitPlatformSupportImpl::cancelledError( 422 WebURLError WebKitPlatformSupportImpl::cancelledError(
407 const WebURL& unreachableURL) const { 423 const WebURL& unreachableURL) const {
408 return WebURLLoaderImpl::CreateError(unreachableURL, net::ERR_ABORTED); 424 return WebURLLoaderImpl::CreateError(unreachableURL, net::ERR_ABORTED);
409 } 425 }
410 426
411 void WebKitPlatformSupportImpl::getPluginList(bool refresh, 427 void WebKitPlatformSupportImpl::getPluginList(bool refresh,
412 WebPluginListBuilder* builder) { 428 WebPluginListBuilder* builder) {
413 std::vector<webkit::WebPluginInfo> plugins; 429 std::vector<webkit::WebPluginInfo> plugins;
414 GetPlugins(refresh, &plugins); 430 GetPlugins(refresh, &plugins);
415 431
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after
1000 } 1016 }
1001 1017
1002 #if defined(OS_ANDROID) 1018 #if defined(OS_ANDROID)
1003 webkit_media::WebAudioMediaCodecRunner 1019 webkit_media::WebAudioMediaCodecRunner
1004 WebKitPlatformSupportImpl::GetWebAudioMediaCodecRunner() { 1020 WebKitPlatformSupportImpl::GetWebAudioMediaCodecRunner() {
1005 return base::Bind(&NullRunWebAudioMediaCodec); 1021 return base::Bind(&NullRunWebAudioMediaCodec);
1006 } 1022 }
1007 #endif 1023 #endif
1008 1024
1009 } // namespace webkit_glue 1025 } // namespace webkit_glue
OLDNEW
« no previous file with comments | « webkit/glue/webkitplatformsupport_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698