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

Side by Side Diff: content/child/blink_platform_impl.cc

Issue 191093002: Simplify the user agent code some more since after r255534 it's not affected by the site's URL. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: patchset 15 which works Created 6 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 | Annotate | Revision Log
« no previous file with comments | « content/child/blink_platform_impl.h ('k') | content/child/npapi/plugin_host.cc » ('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 "content/child/blink_platform_impl.h" 5 #include "content/child/blink_platform_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/process/process_metrics.h" 21 #include "base/process/process_metrics.h"
22 #include "base/rand_util.h" 22 #include "base/rand_util.h"
23 #include "base/strings/string_number_conversions.h" 23 #include "base/strings/string_number_conversions.h"
24 #include "base/strings/string_util.h" 24 #include "base/strings/string_util.h"
25 #include "base/strings/utf_string_conversions.h" 25 #include "base/strings/utf_string_conversions.h"
26 #include "base/synchronization/lock.h" 26 #include "base/synchronization/lock.h"
27 #include "base/sys_info.h" 27 #include "base/sys_info.h"
28 #include "base/time/time.h" 28 #include "base/time/time.h"
29 #include "content/child/web_socket_stream_handle_impl.h" 29 #include "content/child/web_socket_stream_handle_impl.h"
30 #include "content/child/web_url_loader_impl.h" 30 #include "content/child/web_url_loader_impl.h"
31 #include "content/public/common/content_client.h"
31 #include "grit/blink_resources.h" 32 #include "grit/blink_resources.h"
32 #include "grit/webkit_resources.h" 33 #include "grit/webkit_resources.h"
33 #include "grit/webkit_strings.h" 34 #include "grit/webkit_strings.h"
34 #include "net/base/data_url.h" 35 #include "net/base/data_url.h"
35 #include "net/base/mime_util.h" 36 #include "net/base/mime_util.h"
36 #include "net/base/net_errors.h" 37 #include "net/base/net_errors.h"
37 #include "third_party/WebKit/public/platform/WebData.h" 38 #include "third_party/WebKit/public/platform/WebData.h"
38 #include "third_party/WebKit/public/platform/WebString.h" 39 #include "third_party/WebKit/public/platform/WebString.h"
39 #include "ui/base/layout.h" 40 #include "ui/base/layout.h"
40 #include "webkit/child/webkit_child_helpers.h" 41 #include "webkit/child/webkit_child_helpers.h"
41 #include "webkit/common/user_agent/user_agent.h"
42 42
43 #if defined(OS_ANDROID) 43 #if defined(OS_ANDROID)
44 #include "base/android/sys_utils.h" 44 #include "base/android/sys_utils.h"
45 #endif 45 #endif
46 46
47 #if !defined(NO_TCMALLOC) && defined(USE_TCMALLOC) && !defined(OS_WIN) 47 #if !defined(NO_TCMALLOC) && defined(USE_TCMALLOC) && !defined(OS_WIN)
48 #include "third_party/tcmalloc/chromium/src/gperftools/heap-profiler.h" 48 #include "third_party/tcmalloc/chromium/src/gperftools/heap-profiler.h"
49 #endif 49 #endif
50 50
51 using blink::WebData; 51 using blink::WebData;
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 } 355 }
356 356
357 WebURLLoader* BlinkPlatformImpl::createURLLoader() { 357 WebURLLoader* BlinkPlatformImpl::createURLLoader() {
358 return new WebURLLoaderImpl(this); 358 return new WebURLLoaderImpl(this);
359 } 359 }
360 360
361 WebSocketStreamHandle* BlinkPlatformImpl::createSocketStreamHandle() { 361 WebSocketStreamHandle* BlinkPlatformImpl::createSocketStreamHandle() {
362 return new WebSocketStreamHandleImpl(this); 362 return new WebSocketStreamHandleImpl(this);
363 } 363 }
364 364
365 WebString BlinkPlatformImpl::userAgent() {
366 return WebString::fromUTF8(GetContentClient()->GetUserAgent());
367 }
368
365 WebString BlinkPlatformImpl::userAgent(const WebURL& url) { 369 WebString BlinkPlatformImpl::userAgent(const WebURL& url) {
366 return WebString::fromUTF8(webkit_glue::GetUserAgent(url)); 370 return userAgent();
367 } 371 }
368 372
369 WebData BlinkPlatformImpl::parseDataURL( 373 WebData BlinkPlatformImpl::parseDataURL(
370 const WebURL& url, 374 const WebURL& url,
371 WebString& mimetype_out, 375 WebString& mimetype_out,
372 WebString& charset_out) { 376 WebString& charset_out) {
373 std::string mime_type, char_set, data; 377 std::string mime_type, char_set, data;
374 if (net::DataURL::Parse(url, &mime_type, &char_set, &data) 378 if (net::DataURL::Parse(url, &mime_type, &char_set, &data)
375 && net::IsSupportedMimeType(mime_type)) { 379 && net::IsSupportedMimeType(mime_type)) {
376 mimetype_out = WebString::fromUTF8(mime_type); 380 mimetype_out = WebString::fromUTF8(mime_type);
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after
902 if (--shared_timer_suspended_ == 0 && 906 if (--shared_timer_suspended_ == 0 &&
903 (!shared_timer_.IsRunning() || 907 (!shared_timer_.IsRunning() ||
904 shared_timer_fire_time_was_set_while_suspended_)) { 908 shared_timer_fire_time_was_set_while_suspended_)) {
905 shared_timer_fire_time_was_set_while_suspended_ = false; 909 shared_timer_fire_time_was_set_while_suspended_ = false;
906 setSharedTimerFireInterval( 910 setSharedTimerFireInterval(
907 shared_timer_fire_time_ - monotonicallyIncreasingTime()); 911 shared_timer_fire_time_ - monotonicallyIncreasingTime());
908 } 912 }
909 } 913 }
910 914
911 } // namespace content 915 } // namespace content
OLDNEW
« no previous file with comments | « content/child/blink_platform_impl.h ('k') | content/child/npapi/plugin_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698