summaryrefslogtreecommitdiffstats
path: root/mojo/common
diff options
context:
space:
mode:
authorjam <jam@chromium.org>2015-05-20 17:48:13 -0700
committerCommit bot <commit-bot@chromium.org>2015-05-21 00:48:16 +0000
commit3cf73ae56fd339f5ce180ab39a0f6dd3e5aa4b1d (patch)
treed5c1695f73b869e9009263251cd6c12e0f7ce9d4 /mojo/common
parent772156412f85c3aeed361dd84edb7556e56aa3c3 (diff)
downloadchromium_src-3cf73ae56fd339f5ce180ab39a0f6dd3e5aa4b1d.zip
chromium_src-3cf73ae56fd339f5ce180ab39a0f6dd3e5aa4b1d.tar.gz
chromium_src-3cf73ae56fd339f5ce180ab39a0f6dd3e5aa4b1d.tar.bz2
Move navigations with POST or referrer to the shell.
Previously we were doing them inside html_viewer because NavigatorHost was throwing out that extra data before it got to the network service. The fix is to pass through this url request information. Also: -add support for netlog to make debugging network issues easier. Use --log-net-log=file_path -ensure that mojo shell uses the same user agent as html_viewer. since this UA is sent to websites, they need to match or else there are bugs with Gmail (since it sees different UAs when logging in) BUG=481153 Review URL: https://codereview.chromium.org/1121783003 Cr-Commit-Position: refs/heads/master@{#330864}
Diffstat (limited to 'mojo/common')
-rw-r--r--mojo/common/BUILD.gn2
-rw-r--r--mojo/common/tracing_impl.cc4
-rw-r--r--mojo/common/user_agent.cc17
-rw-r--r--mojo/common/user_agent.h20
4 files changed, 42 insertions, 1 deletions
diff --git a/mojo/common/BUILD.gn b/mojo/common/BUILD.gn
index d9c1216..e87167c 100644
--- a/mojo/common/BUILD.gn
+++ b/mojo/common/BUILD.gn
@@ -28,6 +28,8 @@ component("common_base") {
"message_pump_mojo_handler.h",
"time_helper.cc",
"time_helper.h",
+ "user_agent.cc",
+ "user_agent.h",
"weak_binding_set.h",
"weak_interface_ptr_set.h",
]
diff --git a/mojo/common/tracing_impl.cc b/mojo/common/tracing_impl.cc
index 29a520d..a8d2f36 100644
--- a/mojo/common/tracing_impl.cc
+++ b/mojo/common/tracing_impl.cc
@@ -18,7 +18,9 @@ TracingImpl::~TracingImpl() {
}
void TracingImpl::Initialize(ApplicationImpl* app) {
- ApplicationConnection* connection = app->ConnectToApplication("mojo:tracing");
+ mojo::URLRequestPtr request(mojo::URLRequest::New());
+ request->url = mojo::String::From("mojo:tracing");
+ ApplicationConnection* connection = app->ConnectToApplication(request.Pass());
connection->AddService(this);
}
diff --git a/mojo/common/user_agent.cc b/mojo/common/user_agent.cc
new file mode 100644
index 0000000..4474e65
--- /dev/null
+++ b/mojo/common/user_agent.cc
@@ -0,0 +1,17 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "mojo/common/user_agent.h"
+
+namespace mojo {
+namespace common {
+
+std::string GetUserAgent() {
+ // TODO(jam): change depending on OS
+ return "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like "
+ "Gecko) Chrome/42.0.2311.68 Safari/537.36";
+}
+
+} // namespace common
+} // namespace mojo
diff --git a/mojo/common/user_agent.h b/mojo/common/user_agent.h
new file mode 100644
index 0000000..741ef8f
--- /dev/null
+++ b/mojo/common/user_agent.h
@@ -0,0 +1,20 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MOJO_COMMON_USER_AGENT_H_
+#define MOJO_COMMON_USER_AGENT_H_
+
+#include <string>
+
+#include "mojo/common/mojo_common_export.h"
+
+namespace mojo {
+namespace common {
+
+std::string GetUserAgent();
+
+} // namespace common
+} // namespace mojo
+
+#endif // MOJO_COMMON_USER_AGENT_H_