Move ResourceRequestBody to services/network in preparation of moving content/network.

https://chromium-review.googlesource.com/864422
This commit is contained in:
Aleksei Kuzmin 2018-04-11 10:42:14 +02:00 committed by Samuel Attard
parent d3c6aa12d1
commit 37168c0a95
8 changed files with 22 additions and 19 deletions

View file

@ -696,7 +696,7 @@ bool App::CanCreateWindow(
WindowOpenDisposition disposition, WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& features, const blink::mojom::WindowFeatures& features,
const std::vector<std::string>& additional_features, const std::vector<std::string>& additional_features,
const scoped_refptr<content::ResourceRequestBody>& body, const scoped_refptr<network::ResourceRequestBody>& body,
bool user_gesture, bool user_gesture,
bool opener_suppressed, bool opener_suppressed,
bool* no_javascript_access) { bool* no_javascript_access) {

View file

@ -147,7 +147,7 @@ class App : public AtomBrowserClient::Delegate,
WindowOpenDisposition disposition, WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& features, const blink::mojom::WindowFeatures& features,
const std::vector<std::string>& additional_features, const std::vector<std::string>& additional_features,
const scoped_refptr<content::ResourceRequestBody>& body, const scoped_refptr<network::ResourceRequestBody>& body,
bool user_gesture, bool user_gesture,
bool opener_suppressed, bool opener_suppressed,
bool* no_javascript_access) override; bool* no_javascript_access) override;

View file

@ -550,7 +550,7 @@ void WebContents::OnCreateWindow(
const std::string& frame_name, const std::string& frame_name,
WindowOpenDisposition disposition, WindowOpenDisposition disposition,
const std::vector<std::string>& features, const std::vector<std::string>& features,
const scoped_refptr<content::ResourceRequestBody>& body) { const scoped_refptr<network::ResourceRequestBody>& body) {
if (type_ == BROWSER_WINDOW || type_ == OFF_SCREEN) if (type_ == BROWSER_WINDOW || type_ == OFF_SCREEN)
Emit("-new-window", target_url, frame_name, disposition, features, body, Emit("-new-window", target_url, frame_name, disposition, features, body,
referrer); referrer);
@ -1175,7 +1175,7 @@ void WebContents::LoadURL(const GURL& url, const mate::Dictionary& options) {
if (options.Get("extraHeaders", &extra_headers)) if (options.Get("extraHeaders", &extra_headers))
params.extra_headers = extra_headers; params.extra_headers = extra_headers;
scoped_refptr<content::ResourceRequestBody> body; scoped_refptr<network::ResourceRequestBody> body;
if (options.Get("postData", &body)) { if (options.Get("postData", &body)) {
params.post_data = body; params.post_data = body;
params.load_type = content::NavigationController::LOAD_TYPE_HTTP_POST; params.load_type = content::NavigationController::LOAD_TYPE_HTTP_POST;

View file

@ -31,15 +31,15 @@ namespace brightray {
class InspectableWebContents; class InspectableWebContents;
} }
namespace content {
class ResourceRequestBody;
}
namespace mate { namespace mate {
class Arguments; class Arguments;
class Dictionary; class Dictionary;
} // namespace mate } // namespace mate
namespace network {
class ResourceRequestBody;
}
namespace atom { namespace atom {
struct SetSizeParams; struct SetSizeParams;
@ -228,7 +228,7 @@ class WebContents : public mate::TrackableObject<WebContents>,
const std::string& frame_name, const std::string& frame_name,
WindowOpenDisposition disposition, WindowOpenDisposition disposition,
const std::vector<std::string>& features, const std::vector<std::string>& features,
const scoped_refptr<content::ResourceRequestBody>& body); const scoped_refptr<network::ResourceRequestBody>& body);
// Returns the web preferences of current WebContents. // Returns the web preferences of current WebContents.
v8::Local<v8::Value> GetWebPreferences(v8::Isolate* isolate); v8::Local<v8::Value> GetWebPreferences(v8::Isolate* isolate);

View file

@ -44,11 +44,11 @@
#include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents.h"
#include "content/public/common/content_paths.h" #include "content/public/common/content_paths.h"
#include "content/public/common/content_switches.h" #include "content/public/common/content_switches.h"
#include "content/public/common/resource_request_body.h"
#include "content/public/common/url_constants.h" #include "content/public/common/url_constants.h"
#include "content/public/common/web_preferences.h" #include "content/public/common/web_preferences.h"
#include "net/ssl/ssl_cert_request_info.h" #include "net/ssl/ssl_cert_request_info.h"
#include "ppapi/host/ppapi_host.h" #include "ppapi/host/ppapi_host.h"
#include "services/network/public/cpp/resource_request_body.h"
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
#include "v8/include/v8.h" #include "v8/include/v8.h"
@ -415,7 +415,7 @@ bool AtomBrowserClient::CanCreateWindow(
WindowOpenDisposition disposition, WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& features, const blink::mojom::WindowFeatures& features,
const std::vector<std::string>& additional_features, const std::vector<std::string>& additional_features,
const scoped_refptr<content::ResourceRequestBody>& body, const scoped_refptr<network::ResourceRequestBody>& body,
bool user_gesture, bool user_gesture,
bool opener_suppressed, bool opener_suppressed,
bool* no_javascript_access) { bool* no_javascript_access) {

View file

@ -95,7 +95,7 @@ class AtomBrowserClient : public brightray::BrowserClient,
WindowOpenDisposition disposition, WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& features, const blink::mojom::WindowFeatures& features,
const std::vector<std::string>& additional_features, const std::vector<std::string>& additional_features,
const scoped_refptr<content::ResourceRequestBody>& body, const scoped_refptr<network::ResourceRequestBody>& body,
bool user_gesture, bool user_gesture,
bool opener_suppressed, bool opener_suppressed,
bool* no_javascript_access) override; bool* no_javascript_access) override;

View file

@ -17,10 +17,10 @@
#include "atom/common/native_mate_converters/value_converter.h" #include "atom/common/native_mate_converters/value_converter.h"
#include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents.h"
#include "content/public/common/context_menu_params.h" #include "content/public/common/context_menu_params.h"
#include "content/public/common/resource_request_body.h"
#include "native_mate/dictionary.h" #include "native_mate/dictionary.h"
#include "services/network/public/cpp/resource_request_body.h"
using content::ResourceRequestBody; using network::ResourceRequestBody;
namespace { namespace {
@ -251,7 +251,7 @@ bool Converter<scoped_refptr<ResourceRequestBody>>::FromV8(
auto list = std::make_unique<base::ListValue>(); auto list = std::make_unique<base::ListValue>();
if (!ConvertFromV8(isolate, val, list.get())) if (!ConvertFromV8(isolate, val, list.get()))
return false; return false;
*out = new content::ResourceRequestBody(); *out = new network::ResourceRequestBody();
for (size_t i = 0; i < list->GetSize(); ++i) { for (size_t i = 0; i < list->GetSize(); ++i) {
base::DictionaryValue* dict = nullptr; base::DictionaryValue* dict = nullptr;
std::string type; std::string type;

View file

@ -16,10 +16,13 @@
namespace content { namespace content {
struct ContextMenuParams; struct ContextMenuParams;
class ResourceRequestBody;
class WebContents; class WebContents;
} // namespace content } // namespace content
namespace network {
class ResourceRequestBody;
}
using ContextMenuParamsWithWebContents = using ContextMenuParamsWithWebContents =
std::pair<content::ContextMenuParams, content::WebContents*>; std::pair<content::ContextMenuParams, content::WebContents*>;
@ -51,13 +54,13 @@ struct Converter<content::PermissionType> {
}; };
template <> template <>
struct Converter<scoped_refptr<content::ResourceRequestBody>> { struct Converter<scoped_refptr<network::ResourceRequestBody>> {
static v8::Local<v8::Value> ToV8( static v8::Local<v8::Value> ToV8(
v8::Isolate* isolate, v8::Isolate* isolate,
const scoped_refptr<content::ResourceRequestBody>& val); const scoped_refptr<network::ResourceRequestBody>& val);
static bool FromV8(v8::Isolate* isolate, static bool FromV8(v8::Isolate* isolate,
v8::Local<v8::Value> val, v8::Local<v8::Value> val,
scoped_refptr<content::ResourceRequestBody>* out); scoped_refptr<network::ResourceRequestBody>* out);
}; };
template <> template <>